From 0140448a562b97859be0b9a6e480e1f6aa4d1b1d Mon Sep 17 00:00:00 2001 From: Marien Fressinaud Date: Wed, 7 Jan 2015 14:59:18 +0100 Subject: Refactor FreshRSS_Share object to be more usable - FreshRSS_Share is the only object we manipulate - Add a way to register new share options easily - Move some i18n keys from index.php to gen.php See https://github.com/FreshRSS/FreshRSS/issues/730 --- app/views/configure/sharing.phtml | 27 ++++++++++++++++----------- app/views/index/normal.phtml | 28 +++++++++++++--------------- 2 files changed, 29 insertions(+), 26 deletions(-) (limited to 'app/views') diff --git a/app/views/configure/sharing.phtml b/app/views/configure/sharing.phtml index f5c133f07..da7557480 100644 --- a/app/views/configure/sharing.phtml +++ b/app/views/configure/sharing.phtml @@ -15,22 +15,25 @@ '> - sharing as $key => $sharing) { ?> - shares[$sharing['type']]; ?> -
+ sharing as $key => $share_options) { + $share = FreshRSS_Share::get($share_options['type']); + $share->update($share_options); + ?> +
- ' /> - + + formType() === 'advanced') { ?>
- - + +
- + @@ -41,8 +44,10 @@
diff --git a/app/views/index/normal.phtml b/app/views/index/normal.phtml index c2cf7c887..8c6ddd1ee 100644 --- a/app/views/index/normal.phtml +++ b/app/views/index/normal.phtml @@ -129,8 +129,6 @@ if (!empty($this->entries)) { } ?>
  • link()); - $title = urlencode($item->title() . ' · ' . $feed->name()); ?>
  • link(); + $title = $item->title() . ' · ' . $feed->name(); + foreach (FreshRSS_Context::$user_conf->sharing as $share_options) { + $share = FreshRSS_Share::get($share_options['type']); + $share_options['link'] = $link; + $share_options['title'] = $title; + $share->update($share_options); + ?>