aboutsummaryrefslogtreecommitdiff
path: root/app/views
diff options
context:
space:
mode:
authorGravatar Marien Fressinaud <dev@marienfressinaud.fr> 2014-06-13 18:51:52 +0200
committerGravatar Marien Fressinaud <dev@marienfressinaud.fr> 2014-06-13 18:51:52 +0200
commitf58fdfe93dbf969338fe9cecbd728e0f7add4617 (patch)
treee1629da3361235d1c4ef28944624326491628045 /app/views
parentc053825ff8f9792e692c101585481129b006937b (diff)
parent61f4d5457818204eb28ed394d4f1b97160542baa (diff)
Merge branch 'dev' into beta
Diffstat (limited to 'app/views')
-rw-r--r--app/views/configure/categorize.phtml12
-rw-r--r--app/views/configure/display.phtml127
-rw-r--r--app/views/configure/feed.phtml21
-rw-r--r--app/views/configure/importExport.phtml40
-rw-r--r--app/views/configure/reading.phtml125
-rw-r--r--app/views/configure/sharing.phtml81
-rw-r--r--app/views/configure/shortcut.phtml56
-rw-r--r--app/views/configure/users.phtml63
-rw-r--r--app/views/error/index.phtml10
-rw-r--r--app/views/feed/add.phtml91
-rw-r--r--app/views/helpers/export/articles.phtml47
-rw-r--r--app/views/helpers/export/opml.phtml28
-rw-r--r--app/views/helpers/javascript_vars.phtml17
-rw-r--r--app/views/helpers/view/normal_view.phtml81
-rw-r--r--app/views/helpers/view/reader_view.phtml3
-rwxr-xr-xapp/views/helpers/view/rss_view.phtml2
-rw-r--r--app/views/importExport/index.phtml52
-rw-r--r--app/views/index/formLogin.phtml56
-rw-r--r--app/views/index/index.phtml17
-rw-r--r--app/views/javascript/actualize.phtml55
20 files changed, 626 insertions, 358 deletions
diff --git a/app/views/configure/categorize.phtml b/app/views/configure/categorize.phtml
index a564e8cdd..9bae99b39 100644
--- a/app/views/configure/categorize.phtml
+++ b/app/views/configure/categorize.phtml
@@ -14,14 +14,16 @@
<?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 (); ?>" />
+ <div class="stick">
+ <input type="text" id="cat_<?php echo $cat->id (); ?>" name="categories[]" value="<?php echo $cat->name (); ?>" />
- <?php if ($cat->nbFeed () > 0) { ?>
- <a class="confirm" href="<?php echo _url ('feed', 'delete', 'id', $cat->id (), 'type', 'category'); ?>"><?php echo Minz_Translate::t ('ask_empty'); ?></a>
- <?php } ?>
+ <?php if ($cat->nbFeed () > 0) { ?>
+ <button type="submit" class="btn btn-attention confirm" formaction="<?php echo _url ('feed', 'delete', 'id', $cat->id (), 'type', 'category'); ?>"><?php echo Minz_Translate::t ('ask_empty'); ?></button>
+ <?php } ?>
+ </div>
(<?php echo Minz_Translate::t ('number_feeds', $cat->nbFeed ()); ?>)
- <?php if ($cat->id () == $this->defaultCategory->id ()) { ?>
+ <?php if ($cat->id () === $this->defaultCategory->id ()) { ?>
<?php echo FreshRSS_Themes::icon('help'); ?> <?php echo Minz_Translate::t ('can_not_be_deleted'); ?>
<?php } ?>
diff --git a/app/views/configure/display.phtml b/app/views/configure/display.phtml
index 9104e4ef1..955fc6747 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 ('theme'); ?></legend>
+ <legend><?php echo Minz_Translate::t ('display_configuration'); ?></legend>
<div class="form-group">
<label class="group-name" for="language"><?php echo Minz_Translate::t ('language'); ?></label>
@@ -35,122 +35,29 @@
</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>
-
+ <?php $width = $this->conf->content_width; ?>
<div class="form-group">
- <label class="group-name" for="sort_order"><?php echo Minz_Translate::t ('sort_order'); ?></label>
+ <label class="group-name" for="content_width"><?php echo Minz_Translate::t('content_width'); ?></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 name="content_width" id="content_width" required="">
+ <option value="thin" <?php echo $width === 'thin'? 'selected="selected"' : ''; ?>>
+ <?php echo Minz_Translate::t('width_thin'); ?>
+ </option>
+ <option value="medium" <?php echo $width === 'medium'? 'selected="selected"' : ''; ?>>
+ <?php echo Minz_Translate::t('width_medium'); ?>
+ </option>
+ <option value="large" <?php echo $width === 'large'? 'selected="selected"' : ''; ?>>
+ <?php echo Minz_Translate::t('width_large'); ?>
+ </option>
+ <option value="no_limit" <?php echo $width === 'no_limit'? 'selected="selected"' : ''; ?>>
+ <?php echo Minz_Translate::t('width_no_limit'); ?>
+ </option>
</select>
</div>
</div>
<div class="form-group">
- <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->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->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 Minz_Translate::t ('article_icons'); ?></label>
<table>
<thead>
<tr>
diff --git a/app/views/configure/feed.phtml b/app/views/configure/feed.phtml
index 138808a9f..27b0990ff 100644
--- a/app/views/configure/feed.phtml
+++ b/app/views/configure/feed.phtml
@@ -7,8 +7,12 @@
<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">
@@ -28,16 +32,21 @@
<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 class="stick">
+ <input type="text" name="website" id="website" class="extend" value="<?php echo $this->flux->website (); ?>" />
+ <a class="btn" target="_blank" href="<?php echo $this->flux->website (); ?>"><?php echo FreshRSS_Themes::icon('link'); ?></a>
+ </div>
</div>
</div>
<div class="form-group">
<label class="group-name" for="url"><?php echo Minz_Translate::t ('feed_url'); ?></label>
<div class="group-controls">
- <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 class="stick">
+ <input type="text" name="url" id="url" class="extend" value="<?php echo $this->flux->url (); ?>" />
+ <a class="btn" target="_blank" href="<?php echo $this->flux->url (); ?>"><?php echo FreshRSS_Themes::icon('link'); ?></a>
+ </div>
+
+ <a class="btn" target="_blank" href="http://validator.w3.org/feed/check.cgi?url=<?php echo $this->flux->url (); ?>"><?php echo Minz_Translate::t ('feed_validator'); ?></a>
</div>
</div>
<div class="form-group">
@@ -81,7 +90,7 @@
<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 $this->flux->nbEntries (); ?></span>
+ <span class="control"><?php echo $nbEntries; ?></span>
</div>
</div>
<div class="form-group">
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/reading.phtml b/app/views/configure/reading.phtml
new file mode 100644
index 000000000..456ab9522
--- /dev/null
+++ b/app/views/configure/reading.phtml
@@ -0,0 +1,125 @@
+<?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', 'reading'); ?>">
+ <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>
+ </div>
+ </div>
+
+ <div class="form-group">
+ <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->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="<?php echo FreshRSS_Entry::STATE_ALL; ?>"<?php echo $this->conf->default_view === FreshRSS_Entry::STATE_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="<?php echo FreshRSS_Entry::STATE_NOT_READ; ?>"<?php echo $this->conf->default_view === FreshRSS_Entry::STATE_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">
+ <div class="group-controls">
+ <label class="checkbox" for="sticky_post">
+ <input type="checkbox" name="sticky_post" id="sticky_post" value="1"<?php echo $this->conf->sticky_post ? ' checked="checked"' : ''; ?> />
+ <?php echo Minz_Translate::t ('sticky_post'); ?>
+ <noscript> — <strong><?php echo Minz_Translate::t ('javascript_should_be_activated'); ?></strong></noscript>
+ </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>
+
+ </form>
+</div>
diff --git a/app/views/configure/sharing.phtml b/app/views/configure/sharing.phtml
index e3ea11665..a952bc3b4 100644
--- a/app/views/configure/sharing.phtml
+++ b/app/views/configure/sharing.phtml
@@ -3,54 +3,49 @@
<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', 'sharing'); ?>">
+ <form method="post" action="<?php echo _url ('configure', 'sharing'); ?>"
+ data-simple='<div class="form-group"><label class="group-name">##label##</label><div class="group-controls"><a href="#" class="share remove btn btn-attention"><?php echo FreshRSS_Themes::icon('close'); ?></a>
+ <input type="hidden" id="share_##key##_type" name="share[##key##][type]" value="##type##" /></div></div>'
+ data-advanced='<div class="form-group"><label class="group-name">##label##</label><div class="group-controls">
+ <input type="hidden" id="share_##key##_type" name="share[##key##][type]" value="##type##" />
+ <div class="stick">
+ <input type="text" id="share_##key##_name" name="share[##key##][name]" class="extend" value="" placeholder="<?php echo Minz_Translate::t ('share_name'); ?>" size="64" />
+ <input type="url" id="share_##key##_url" name="share[##key##][url]" class="extend" value="" placeholder="<?php echo Minz_Translate::t ('share_url'); ?>" size="64" />
+ <a href="#" class="share remove btn btn-attention"><?php echo FreshRSS_Themes::icon('close'); ?></a></div>
+ <a target="_blank" class="btn" title="<?php echo Minz_Translate::t('more_information'); ?>" href="##help##"><?php echo FreshRSS_Themes::icon('help'); ?></a>
+ </div></div>'>
<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>
+ <?php foreach ($this->conf->sharing as $key => $sharing): ?>
+ <?php $share = $this->conf->shares[$sharing['type']]; ?>
+ <div class="form-group">
+ <label class="group-name">
+ <?php echo Minz_Translate::t ($sharing['type']); ?>
+ </label>
+ <div class="group-controls">
+ <input type='hidden' id='share_<?php echo $key;?>_type' name="share[<?php echo $key;?>][type]" value='<?php echo $sharing['type']?>' />
+ <?php if ($share['form'] === 'advanced'){ ?>
+ <div class="stick">
+ <input type="text" id="share_<?php echo $key;?>_name" name="share[<?php echo $key;?>][name]" class="extend" value="<?php echo $sharing['name']?>" placeholder="<?php echo Minz_Translate::t ('share_name'); ?>" size="64" />
+ <input type="url" id="share_<?php echo $key;?>_url" name="share[<?php echo $key;?>][url]" class="extend" value="<?php echo $sharing['url']?>" placeholder="<?php echo Minz_Translate::t ('share_url'); ?>" size="64" />
+ <a href='#' class='share remove btn btn-attention'><?php echo FreshRSS_Themes::icon('close'); ?></a>
+ </div>
+
+ <a target="_blank" class="btn" title="<?php echo Minz_Translate::t('more_information'); ?>" href="<?php echo $share['help']?>"><?php echo FreshRSS_Themes::icon('help'); ?></a>
+ <?php } else { ?>
+ <a href='#' class='share remove btn btn-attention'><?php echo FreshRSS_Themes::icon('close'); ?></a>
+ <?php } ?>
+ </div>
</div>
- </div>
+ <?php endforeach;?>
<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($this->conf->shares as $key => $params):?>
+ <option value='<?php echo $key?>' data-form='<?php echo $params['form']?>' data-help='<?php if (!empty($params['help'])) {echo $params['help'];}?>'><?php echo Minz_Translate::t($key) ?></option>
+ <?php endforeach; ?>
+ </select>
+ <a href='#' class='share add btn'><?php echo FreshRSS_Themes::icon('add'); ?></a>
</div>
</div>
diff --git a/app/views/configure/shortcut.phtml b/app/views/configure/shortcut.phtml
index b0867f711..bfb13f003 100644
--- a/app/views/configure/shortcut.phtml
+++ b/app/views/configure/shortcut.phtml
@@ -12,10 +12,44 @@
<?php $s = $this->conf->shortcuts; ?>
<form method="post" action="<?php echo _url ('configure', 'shortcut'); ?>">
- <legend><?php echo Minz_Translate::t ('shortcuts_management'); ?></legend>
+ <legend><?php echo Minz_Translate::t ('shortcuts'); ?></legend>
<noscript><p class="alert alert-error"><?php echo Minz_Translate::t ('javascript_for_shortcuts'); ?></p></noscript>
+ <legend><?php echo Minz_Translate::t ('shortcuts_navigation'); ?></legend>
+
+ <div class="form-group">
+ <label class="group-name" for="next_entry"><?php echo Minz_Translate::t ('next_article'); ?></label>
+ <div class="group-controls">
+ <input type="text" id="next_entry" name="shortcuts[next_entry]" list="keys" value="<?php echo $s['next_entry']; ?>" />
+ </div>
+ </div>
+
+ <div class="form-group">
+ <label class="group-name" for="prev_entry"><?php echo Minz_Translate::t ('previous_article'); ?></label>
+ <div class="group-controls">
+ <input type="text" id="prev_entry" name="shortcuts[prev_entry]" list="keys" value="<?php echo $s['prev_entry']; ?>" />
+ </div>
+ </div>
+
+ <div class="form-group">
+ <label class="group-name" for="first_entry"><?php echo Minz_Translate::t ('first_article'); ?></label>
+ <div class="group-controls">
+ <input type="text" id="first_entry" name="shortcuts[first_entry]" list="keys" value="<?php echo $s['first_entry']; ?>" />
+ </div>
+ </div>
+
+ <div class="form-group">
+ <label class="group-name" for="last_entry"><?php echo Minz_Translate::t ('last_article'); ?></label>
+ <div class="group-controls">
+ <input type="text" id="last_entry" name="shortcuts[last_entry]" list="keys" value="<?php echo $s['last_entry']; ?>" />
+ </div>
+ </div>
+
+ <div><?php echo Minz_Translate::t ('shortcuts_navigation_help');?></div>
+
+ <legend><?php echo Minz_Translate::t ('shortcuts_article_action');?></legend>
+
<div class="form-group">
<label class="group-name" for="mark_read"><?php echo Minz_Translate::t ('mark_read'); ?></label>
<div class="group-controls">
@@ -39,18 +73,10 @@
</div>
<div class="form-group">
- <label class="group-name" for="next_entry"><?php echo Minz_Translate::t ('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']; ?>" />
- <?php echo Minz_Translate::t ('shift_for_last'); ?>
- </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="auto_share_shortcut"><?php echo Minz_Translate::t ('auto_share'); ?></label>
<div class="group-controls">
- <input type="text" id="prev_entry" name="shortcuts[prev_entry]" list="keys" value="<?php echo $s['prev_entry']; ?>" />
- <?php echo Minz_Translate::t ('shift_for_first'); ?>
+ <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'); ?>
</div>
</div>
@@ -61,6 +87,8 @@
</div>
</div>
+ <legend><?php echo Minz_Translate::t ('shortcuts_other_action');?></legend>
+
<div class="form-group">
<label class="group-name" for="load_more_shortcut"><?php echo Minz_Translate::t ('load_more'); ?></label>
<div class="group-controls">
@@ -69,9 +97,9 @@
</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 Minz_Translate::t ('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']; ?>" />
+ <input type="text" id="focus_search_shortcut" name="shortcuts[focus_search]" list="keys" value="<?php echo $s['focus_search']; ?>" />
</div>
</div>
diff --git a/app/views/configure/users.phtml b/app/views/configure/users.phtml
index 8ab4c04ba..272896fb2 100644
--- a/app/views/configure/users.phtml
+++ b/app/views/configure/users.phtml
@@ -20,16 +20,31 @@
<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" pattern=".{7,}" />
+ <div class="stick">
+ <input type="password" id="passwordPlain" name="passwordPlain" autocomplete="off" pattern=".{7,}" <?php echo cryptAvailable() ? '' : 'disabled="disabled" '; ?>/>
+ <a class="btn toggle-password"><?php echo FreshRSS_Themes::icon('key'); ?></a>
+ </div>
<noscript><b><?php echo Minz_Translate::t('javascript_should_be_activated'); ?></b></noscript>
</div>
</div>
+ <?php if (Minz_Configuration::apiEnabled()) { ?>
+ <div class="form-group">
+ <label class="group-name" for="apiPasswordPlain"><?php echo Minz_Translate::t('password_api'); ?></label>
+ <div class="group-controls">
+ <div class="stick">
+ <input type="password" id="apiPasswordPlain" name="apiPasswordPlain" autocomplete="off" pattern=".{7,}" <?php echo cryptAvailable() ? '' : 'disabled="disabled" '; ?>/>
+ <a class="btn toggle-password"><?php echo FreshRSS_Themes::icon('key'); ?></a>
+ </div>
+ </div>
+ </div>
+ <?php } ?>
+
<div class="form-group">
<label class="group-name" for="mail_login"><?php echo Minz_Translate::t('persona_connection_email'); ?></label>
<?php $mail = $this->conf->mail_login; ?>
<div class="group-controls">
- <input type="email" id="mail_login" name="mail_login" class="extend" value="<?php echo $mail; ?>" <?php echo Minz_Configuration::isAdmin(Minz_Session::param('currentUser', '_')) ? '' : 'disabled="disabled"'; ?> placeholder="alice@example.net" />
+ <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>
@@ -52,7 +67,7 @@
<?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="form"<?php echo Minz_Configuration::authType() === 'form' ? ' selected="selected"' : '', cryptAvailable() ? '' : ' disabled="disabled"'; ?>><?php echo Minz_Translate::t('auth_form'); ?></option>
<option value="persona"<?php echo Minz_Configuration::authType() === 'persona' ? ' selected="selected"' : '', $this->conf->mail_login == '' ? ' disabled="disabled"' : ''; ?>><?php echo Minz_Translate::t('auth_persona'); ?></option>
<option value="http_auth"<?php echo Minz_Configuration::authType() === 'http_auth' ? ' selected="selected"' : '', httpAuthUser() == '' ? ' disabled="disabled"' : ''; ?>><?php echo Minz_Translate::t('http_auth'); ?> (REMOTE_USER = '<?php echo httpAuthUser(); ?>')</option>
<option value="none"<?php echo Minz_Configuration::authType() === 'none' ? ' selected="selected"' : ''; ?>><?php echo Minz_Translate::t('auth_none'); ?></option>
@@ -70,18 +85,49 @@
</div>
</div>
+ <div class="form-group">
+ <div class="group-controls">
+ <label class="checkbox" for="anon_refresh">
+ <input type="checkbox" name="anon_refresh" id="anon_refresh" value="1"<?php echo Minz_Configuration::allowAnonymousRefresh() ? ' checked="checked"' : '',
+ Minz_Configuration::canLogIn() ? '' : ' disabled="disabled"'; ?> />
+ <?php echo Minz_Translate::t('allow_anonymous_refresh'); ?>
+ </label>
+ </div>
+ </div>
+
+ <div class="form-group">
+ <div class="group-controls">
+ <label class="checkbox" for="unsafe_autologin">
+ <input type="checkbox" name="unsafe_autologin" id="unsafe_autologin" value="1"<?php echo Minz_Configuration::unsafeAutologinEnabled() ? ' checked="checked"' : '',
+ Minz_Configuration::canLogIn() ? '' : ' disabled="disabled"'; ?> />
+ <?php echo Minz_Translate::t('unsafe_autologin'); ?>
+ <kbd>p/i/?a=formLogin&amp;u=Alice&amp;p=1234</kbd>
+ </label>
+ </div>
+ </div>
+
<?php if (Minz_Configuration::canLogIn()) { ?>
<div class="form-group">
<label class="group-name" for="token"><?php echo Minz_Translate::t('auth_token'); ?></label>
<?php $token = $this->conf->token; ?>
<div class="group-controls">
- <input type="text" id="token" name="token" value="<?php echo $token; ?>" placeholder="<?php echo Minz_Translate::t('blank_to_disable'); ?>"<?php
+ <input type="text" id="token" name="token" value="<?php echo $token; ?>" placeholder="<?php echo Minz_Translate::t('blank_to_disable'); ?>"<?php
echo Minz_Configuration::canLogIn() ? '' : ' disabled="disabled"'; ?> />
<?php echo FreshRSS_Themes::icon('help'); ?> <?php echo Minz_Translate::t('explain_token', Minz_Url::display(null, 'html', true), $token); ?>
</div>
</div>
<?php } ?>
+ <div class="form-group">
+ <div class="group-controls">
+ <label class="checkbox" for="api_enabled">
+ <input type="checkbox" name="api_enabled" id="api_enabled" value="1"<?php echo Minz_Configuration::apiEnabled() ? ' checked="checked"' : '',
+ Minz_Configuration::needsLogin() ? '' : ' disabled="disabled"'; ?> />
+ <?php echo Minz_Translate::t('api_enabled'); ?>
+ </label>
+ </div>
+ </div>
+
<div class="form-group form-actions">
<div class="group-controls">
<button type="submit" class="btn btn-important"><?php echo Minz_Translate::t('save'); ?></button>
@@ -129,14 +175,17 @@
<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" />
+ <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" pattern=".{7,}" />
+ <div class="stick">
+ <input type="password" id="new_user_passwordPlain" name="new_user_passwordPlain" autocomplete="off" pattern=".{7,}" />
+ <a class="btn toggle-password"><?php echo FreshRSS_Themes::icon('key'); ?></a>
+ </div>
<noscript><b><?php echo Minz_Translate::t('javascript_should_be_activated'); ?></b></noscript>
</div>
</div>
@@ -145,7 +194,7 @@
<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" placeholder="alice@example.net" />
+ <input type="email" id="new_user_email" name="new_user_email" class="extend" autocomplete="off" placeholder="alice@example.net" />
</div>
</div>
diff --git a/app/views/error/index.phtml b/app/views/error/index.phtml
index 36fcb56f9..6a09c3aa2 100644
--- a/app/views/error/index.phtml
+++ b/app/views/error/index.phtml
@@ -3,7 +3,15 @@
<h1 class="alert-head"><?php echo $this->code; ?></h1>
<p>
- <?php echo Minz_Translate::t ('page_not_found'); ?><br />
+ <?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>
</p>
</div>
diff --git a/app/views/feed/add.phtml b/app/views/feed/add.phtml
new file mode 100644
index 000000000..849dacac6
--- /dev/null
+++ b/app/views/feed/add.phtml
@@ -0,0 +1,91 @@
+<?php if ($this->feed) { ?>
+<div class="post">
+ <h1><?php echo Minz_Translate::t ('add_rss_feed'); ?></h1>
+
+ <?php if (!$this->load_ok) { ?>
+ <p class="alert alert-error"><span class="alert-head"><?php echo Minz_Translate::t('damn'); ?></span> <?php echo Minz_Translate::t('internal_problem_feed', _url('index', 'logs')); ?></p>
+ <?php } ?>
+
+ <form method="post" action="<?php echo _url('feed', 'add'); ?>" autocomplete="off">
+ <legend><?php echo Minz_Translate::t('informations'); ?></legend>
+ <?php if ($this->load_ok) { ?>
+ <div class="form-group">
+ <label class="group-name"><?php echo Minz_Translate::t('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 Minz_Translate::t('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 Minz_Translate::t('website_url'); ?></label>
+ <div class="group-controls">
+ <?php echo $this->feed->website(); ?>
+ <a class="btn" target="_blank" href="<?php echo $this->feed->website(); ?>"><?php echo FreshRSS_Themes::icon('link'); ?></a>
+ </div>
+ </div>
+ <?php } ?>
+
+ <div class="form-group">
+ <label class="group-name" for="url"><?php echo Minz_Translate::t('feed_url'); ?></label>
+ <div class="group-controls">
+ <div class="stick">
+ <input type="text" name="url_rss" id="url" class="extend" value="<?php echo $this->feed->url(); ?>" />
+ <a class="btn" target="_blank" href="<?php echo $this->feed->url(); ?>"><?php echo FreshRSS_Themes::icon('link'); ?></a>
+ </div>
+ <a class="btn" target="_blank" href="http://validator.w3.org/feed/check.cgi?url=<?php echo $this->feed->url(); ?>"><?php echo Minz_Translate::t('feed_validator'); ?></a>
+ </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() == 1 ? ' selected="selected"' : ''; ?>>
+ <?php echo $cat->name(); ?>
+ </option>
+ <?php } ?>
+ <option value="nc"><?php echo Minz_Translate::t('new_category'); ?></option>
+ </select>
+
+ <span style="display: none;">
+ <input type="text" name="new_category[name]" id="new_category_name" autocomplete="off" placeholder="<?php echo Minz_Translate::t('new_category'); ?>" />
+ </span>
+ </div>
+ </div>
+
+ <legend><?php echo Minz_Translate::t('http_authentication'); ?></legend>
+ <?php $auth = $this->feed->httpAuth(false); ?>
+ <div class="form-group">
+ <label class="group-name" for="http_user"><?php echo Minz_Translate::t('http_username'); ?></label>
+ <div class="group-controls">
+ <input type="text" name="http_user" id="http_user" class="extend" value="<?php echo $auth['username']; ?>" autocomplete="off" />
+ </div>
+
+ <label class="group-name" for="http_pass"><?php echo Minz_Translate::t('http_password'); ?></label>
+ <div class="group-controls">
+ <input type="password" name="http_pass" id="http_pass" class="extend" value="<?php echo $auth['password']; ?>" autocomplete="off" />
+ </div>
+
+ <div class="group-controls">
+ <?php echo FreshRSS_Themes::icon('help'); ?> <?php echo Minz_Translate::t('access_protected_feeds'); ?>
+ </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 } ?>
diff --git a/app/views/helpers/export/articles.phtml b/app/views/helpers/export/articles.phtml
new file mode 100644
index 000000000..ffdca1daa
--- /dev/null
+++ b/app/views/helpers/export/articles.phtml
@@ -0,0 +1,47 @@
+<?php
+ $username = Minz_Session::param('currentUser', '_');
+
+ $articles = array(
+ 'id' => 'user/' . str_replace('/', '', $username) . '/state/org.freshrss/' . $this->type,
+ 'title' => $this->list_title,
+ 'author' => $username,
+ 'items' => array()
+ );
+
+ foreach ($this->entries as $entry) {
+ if (!isset($this->feed)) {
+ $feed = FreshRSS_CategoryDAO::findFeed($this->categories, $entry->feed ());
+ } else {
+ $feed = $this->feed;
+ }
+
+ $articles['items'][] = 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->id(),
+ 'title' => $feed->name(),
+ 'htmlUrl' => $feed->website(),
+ 'feedUrl' => $feed->url()
+ )
+ );
+ }
+
+ $options = 0;
+ if (version_compare(PHP_VERSION, '5.4.0') >= 0) {
+ $options = JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE;
+ }
+
+ echo json_encode($articles, $options);
+?>
diff --git a/app/views/helpers/export/opml.phtml b/app/views/helpers/export/opml.phtml
new file mode 100644
index 000000000..f667d093c
--- /dev/null
+++ b/app/views/helpers/export/opml.phtml
@@ -0,0 +1,28 @@
+<?php
+
+$opml_array = array(
+ 'head' => array(
+ 'title' => Minz_Configuration::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' => $feed->url(),
+ 'htmlUrl' => $feed->website(),
+ 'description' => $feed->description()
+ );
+ }
+}
+
+echo libopml_render($opml_array);
diff --git a/app/views/helpers/javascript_vars.phtml b/app/views/helpers/javascript_vars.phtml
index 0ecdc1bca..6e0a20de3 100644
--- a/app/views/helpers/javascript_vars.phtml
+++ b/app/views/helpers/javascript_vars.phtml
@@ -5,12 +5,14 @@ echo '"use strict";', "\n";
$mark = $this->conf->mark_when;
echo 'var ',
'hide_posts=', ($this->conf->display_posts || Minz_Request::param('output') === 'reader') ? 'false' : 'true',
+ ',display_order="', Minz_Request::param('order', $this->conf->sort_order), '"',
',auto_mark_article=', $mark['article'] ? 'true' : 'false',
',auto_mark_site=', $mark['site'] ? 'true' : 'false',
',auto_mark_scroll=', $mark['scroll'] ? 'true' : 'false',
',auto_load_more=', $this->conf->auto_load_more ? 'true' : 'false',
',full_lazyload=', $this->conf->lazyload && ($this->conf->display_posts || Minz_Request::param('output') === 'reader') ? 'true' : 'false',
- ',does_lazyload=', $this->conf->lazyload ? 'true' : 'false';
+ ',does_lazyload=', $this->conf->lazyload ? 'true' : 'false',
+ ',sticky_post=', $this->conf->sticky_post ? 'true' : 'false';
$s = $this->conf->shortcuts;
echo ',shortcuts={',
@@ -19,9 +21,12 @@ echo ',shortcuts={',
'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'], '"',
+ 'auto_share:"', $s['auto_share'], '",',
+ 'focus_search:"', $s['focus_search'], '"',
"},\n";
if (Minz_Request::param ('output') === 'global') {
@@ -30,7 +35,13 @@ if (Minz_Request::param ('output') === 'global') {
$authType = Minz_Configuration::authType();
if ($authType === 'persona') {
- echo 'current_user_mail="' . Minz_Session::param ('mail', '') . '",';
+ // 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, '",',
diff --git a/app/views/helpers/view/normal_view.phtml b/app/views/helpers/view/normal_view.phtml
index 7b7faccee..6f172d579 100644
--- a/app/views/helpers/view/normal_view.phtml
+++ b/app/views/helpers/view/normal_view.phtml
@@ -8,19 +8,10 @@ if (!empty($this->entries)) {
$display_yesterday = true;
$display_others = true;
if ($this->loginOk) {
- $shaarli = $this->conf->sharing ('shaarli');
- $wallabag = $this->conf->sharing ('wallabag');
- $diaspora = $this->conf->sharing ('diaspora');
+ $sharing = $this->conf->sharing;
} else {
- $shaarli = '';
- $wallabag = '';
- $diaspora = '';
+ $sharing = array();
}
- $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;
@@ -29,17 +20,17 @@ if (!empty($this->entries)) {
$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_sharing = $this->conf->bottomline_sharing && (count($sharing));
$bottomline_tags = $this->conf->bottomline_tags;
$bottomline_date = $this->conf->bottomline_date;
$bottomline_link = $this->conf->bottomline_link;
+
+ $content_width = $this->conf->content_width;
?>
<div id="stream" class="normal<?php echo $hidePosts ? ' hide_posts' : ''; ?>"><?php
?><div id="new-article">
- <a href="<?php echo _url('index', 'index'); ?>"><?php echo Minz_Translate::t ('new_article'); ?></a>
+ <a href="<?php echo Minz_Url::display ($this->url); ?>"><?php echo Minz_Translate::t ('new_article'); ?></a>
</div><?php
foreach ($this->entries as $item) {
if ($display_today && $item->isDay (FreshRSS_Days::TODAY, $this->today)) {
@@ -98,8 +89,8 @@ if (!empty($this->entries)) {
</ul>
<div class="flux_content">
- <div class="content">
- <h1 class="title"><?php echo $item->title (); ?></h1>
+ <div class="content <?php echo $content_width; ?>">
+ <h1 class="title"><a target="_blank" href="<?php echo $item->link (); ?>"><?php echo $item->title (); ?></a></h1>
<?php
$author = $item->author ();
echo $author != '' ? '<div class="author">' . Minz_Translate::t ('by_author', $author) . '</div>' : '';
@@ -146,55 +137,13 @@ if (!empty($this->entries)) {
<ul class="dropdown-menu">
<li class="dropdown-close"><a href="#close">❌</a></li>
- <?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 ($wallabag) { ?>
- <li class="item">
- <a target="_blank" href="<?php echo $wallabag . '?action=add&amp;url=' . base64_encode (urldecode($link)); ?>">
- <?php echo Minz_Translate::t ('wallabag'); ?>
- </a>
- </li>
- <?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'); ?>
- </a>
- </li>
- <?php } if ($twitter) { ?>
- <li class="item">
- <a target="_blank" href="https://twitter.com/share?url=<?php echo $link; ?>&amp;text=<?php echo $title; ?>">
- <?php echo Minz_Translate::t ('twitter'); ?>
- </a>
- </li>
- <?php } if ($google_plus) { ?>
- <li class="item">
- <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">
- <a target="_blank" href="https://www.facebook.com/sharer.php?u=<?php echo $link; ?>&amp;t=<?php echo $title; ?>">
- <?php echo Minz_Translate::t ('facebook'); ?>
- </a>
- </li>
- <?php } if ($email) { ?>
- <li class="item">
- <a href="mailto:?subject=<?php echo urldecode($title); ?>&amp;body=<?php echo $link; ?>">
- <?php echo Minz_Translate::t ('by_email'); ?>
- </a>
- </li>
- <?php } if ($print) { ?>
- <li class="item">
- <a href="#" class="print-article">
- <?php echo Minz_Translate::t ('print'); ?>
- </a>
- </li>
- <?php } ?>
+ <?php foreach ($sharing as $share) :?>
+ <li class="item share">
+ <a target="_blank" href="<?php echo FreshRSS_Share::generateUrl($this->conf->shares, $share, $item->link(), $item->title() . ' . ' . $feed->name())?>">
+ <?php echo Minz_Translate::t ($share['name']);?>
+ </a>
+ </li>
+ <?php endforeach;?>
</ul>
</div>
<?php } ?>
diff --git a/app/views/helpers/view/reader_view.phtml b/app/views/helpers/view/reader_view.phtml
index bda96e86d..e37c78cb4 100644
--- a/app/views/helpers/view/reader_view.phtml
+++ b/app/views/helpers/view/reader_view.phtml
@@ -3,6 +3,7 @@ $this->partial ('nav_menu');
if (!empty($this->entries)) {
$lazyload = $this->conf->lazyload;
+ $content_width = $this->conf->content_width;
?>
<div id="stream" class="reader">
@@ -10,7 +11,7 @@ if (!empty($this->entries)) {
<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">
+ <div class="content <?php echo $content_width; ?>">
<?php
$feed = FreshRSS_CategoryDAO::findFeed($this->cat_aside, $item->feed ()); //We most likely already have the feed object in cache
if (empty($feed)) $feed = $item->feed (true);
diff --git a/app/views/helpers/view/rss_view.phtml b/app/views/helpers/view/rss_view.phtml
index 620bf1388..2c6ca610b 100755
--- a/app/views/helpers/view/rss_view.phtml
+++ b/app/views/helpers/view/rss_view.phtml
@@ -6,7 +6,7 @@
<description><?php echo Minz_Translate::t ('rss_feeds_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) {
?>
diff --git a/app/views/importExport/index.phtml b/app/views/importExport/index.phtml
new file mode 100644
index 000000000..309058959
--- /dev/null
+++ b/app/views/importExport/index.phtml
@@ -0,0 +1,52 @@
+<?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('importExport', 'import'); ?>" enctype="multipart/form-data">
+ <legend><?php echo Minz_Translate::t ('import'); ?></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>
+ </div>
+ </div>
+ </form>
+
+ <?php if (count($this->feeds) > 0) { ?>
+ <form method="post" action="<?php echo _url('importExport', 'export'); ?>">
+ <legend><?php echo Minz_Translate::t ('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 Minz_Translate::t ('export_opml'); ?>
+ </label>
+
+ <label class="checkbox" for="export_starred">
+ <input type="checkbox" name="export_starred" id="export_starred" value="1" checked="checked" />
+ <?php echo Minz_Translate::t ('export_starred'); ?>
+ </label>
+
+ <select name="export_feeds[]" size="<?php echo min(10, count($this->feeds)); ?>" multiple="multiple">
+ <?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 Minz_Translate::t ('export'); ?></button>
+ </div>
+ </div>
+ </form>
+ <?php } ?>
+</div>
diff --git a/app/views/index/formLogin.phtml b/app/views/index/formLogin.phtml
index e4560c1a0..cc925ea59 100644
--- a/app/views/index/formLogin.phtml
+++ b/app/views/index/formLogin.phtml
@@ -1,34 +1,32 @@
<div class="prompt">
-<?php
-if (Minz_Configuration::canLogIn()) {
- ?><h1><?php echo Minz_Translate::t('login'); ?></h1><?php
- switch (Minz_Configuration::authType()) {
+ <h1><?php echo Minz_Translate::t('login'); ?></h1><?php
- case 'form':
- ?><form id="loginForm" method="post" action="<?php echo _url('index', 'formLogin'); ?>">
- <p>
- <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" />
- </p><p>
- <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>
- </p><p>
- <button id="loginButton" type="submit" class="btn btn-important"><?php echo Minz_Translate::t('login'); ?></button>
- </p>
- </form><?php
- break;
+ 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'); ?></a></p><?php
- break;
- }
-} else {
- ?><h1>FreshRSS</h1>
- <p><?php echo Minz_Translate::t('forbidden_access', Minz_Configuration::authType()); ?></p><?php
-}
-?>
+ 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>
+ <p><a href="<?php echo _url('index', 'about'); ?>"><?php echo Minz_Translate::t('about_freshrss'); ?></a></p>
</div>
diff --git a/app/views/index/index.phtml b/app/views/index/index.phtml
index 4545a33e4..1ff36ca8e 100644
--- a/app/views/index/index.phtml
+++ b/app/views/index/index.phtml
@@ -5,26 +5,21 @@ $output = Minz_Request::param ('output', 'normal');
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') {
$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 = $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 {
- Minz_Request::forward(array('c' => 'index', 'a' => 'formLogin'), true);
- }
+ // token has already been checked in the controller so we can show the view
+ $this->renderHelper ('view/rss_view');
} else {
- Minz_Request::forward(array('c' => 'index', 'a' => 'formLogin'), true);
+ // 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/javascript/actualize.phtml b/app/views/javascript/actualize.phtml
index 1f6072c29..6a92e5642 100644
--- a/app/views/javascript/actualize.phtml
+++ b/app/views/javascript/actualize.phtml
@@ -1,14 +1,17 @@
"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'); ?>");
-<?php } ?>
+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 / " + feeds.length + "</span><br />\
- <progress id=\"actualizeProgressBar\" value=\"0\" max=\"" + feeds.length + "\"></progress>\
+ $("body").after("\<div id=\"actualizeProgress\" class=\"notification good\">\
+ <?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();
@@ -16,27 +19,37 @@ function initProgressBar(init) {
}
function updateProgressBar(i) {
$("#actualizeProgressBar").val(i);
- $("#actualizeProgress .progress").html(i + " / " + feeds.length);
+ $("#actualizeProgress .progress").html(i + " / " + feed_count);
}
function updateFeeds() {
- if (feeds.length === 0) {
+ if (feed_count === 0) {
+ openNotification("<?php echo Minz_Translate::t ('no_feed_to_refresh'); ?>", "good");
return;
}
initProgressBar(true);
- var i = 0;
- for (var f in feeds) {
- $.ajax({
- type: 'POST',
- url: feeds[f],
- }).done(function (data) {
- i++;
- updateProgressBar(i);
+ for (var i = 0; i < 10; i++) {
+ updateFeed();
+ }
+}
- if (i === feeds.length) {
- initProgressBar(false);
- }
- });
+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();
+ }
+ });
}