From b8094f804458e586cf5bbeb8d7b6cf7ee4ed8da9 Mon Sep 17 00:00:00 2001 From: Alexandre Alapetite Date: Sat, 3 Mar 2018 15:06:22 +0100 Subject: Move shares (#1812) From ./data/ to ./app/ Fix manual updates like https://github.com/FreshRSS/FreshRSS/issues/1803#issuecomment-369371907 Left for later: support a ./data/shares.local.php for user-defined shares. --- app/FreshRSS.php | 2 +- app/shares.php | 129 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ data/shares.php | 129 ------------------------------------------------------- 3 files changed, 130 insertions(+), 130 deletions(-) create mode 100644 app/shares.php delete mode 100644 data/shares.php diff --git a/app/FreshRSS.php b/app/FreshRSS.php index f53c85bfb..25fd429a2 100644 --- a/app/FreshRSS.php +++ b/app/FreshRSS.php @@ -128,7 +128,7 @@ class FreshRSS extends Minz_FrontController { } header("X-Content-Type-Options: nosniff"); - FreshRSS_Share::load(join_path(DATA_PATH, 'shares.php')); + FreshRSS_Share::load(join_path(APP_PATH, 'shares.php')); self::loadStylesAndScripts(); } } diff --git a/app/shares.php b/app/shares.php new file mode 100644 index 000000000..5403fd48c --- /dev/null +++ b/app/shares.php @@ -0,0 +1,129 @@ + array( + 'url' => '~URL~?post=~LINK~&title=~TITLE~&source=FreshRSS', + 'transform' => array('rawurlencode'), + 'help' => 'http://sebsauvage.net/wiki/doku.php?id=php:shaarli', + 'form' => 'advanced', + 'method' => 'GET', + ), + 'blogotext' => array( + 'url' => '~URL~/admin/links.php?url=~LINK~', + 'transform' => array(), + 'help' => 'http://lehollandaisvolant.net/blogotext/fr/', + 'form' => 'advanced', + 'method' => 'GET', + ), + 'wallabag' => array( + 'url' => '~URL~?action=add&url=~LINK~', + 'transform' => array( + 'link' => array('base64_encode'), + 'title' => array(), + ), + 'help' => 'http://www.wallabag.org/', + 'form' => 'advanced', + 'method' => 'GET', + ), + 'wallabagv2' => array( + 'url' => '~URL~/bookmarklet?url=~LINK~', + 'transform' => array( + 'link' => array('rawurlencode'), + 'title' => array(), + ), + 'help' => 'http://www.wallabag.org/', + 'form' => 'advanced', + 'method' => 'GET', + ), + 'diaspora' => array( + 'url' => '~URL~/bookmarklet?url=~LINK~&title=~TITLE~', + 'transform' => array('rawurlencode'), + 'help' => 'https://diasporafoundation.org/', + 'form' => 'advanced', + 'method' => 'GET', + ), + 'movim' => array( + 'url' => '~URL~/?share/~LINK~', + 'transform' => array('rawurlencode', 'urlencode'), + 'help' => 'https://github.com/edhelas/movim', + 'form' => 'advanced', + 'method' => 'GET', + ), + 'twitter' => array( + 'url' => 'https://twitter.com/share?url=~LINK~&text=~TITLE~', + 'transform' => array('rawurlencode'), + 'form' => 'simple', + 'method' => 'GET', + ), + 'g+' => array( + 'url' => 'https://plus.google.com/share?url=~LINK~', + 'transform' => array('rawurlencode'), + 'form' => 'simple', + 'method' => 'GET', + ), + 'facebook' => array( + 'url' => 'https://www.facebook.com/sharer.php?u=~LINK~&t=~TITLE~', + 'transform' => array('rawurlencode'), + 'form' => 'simple', + 'method' => 'GET', + ), + 'email' => array( + 'url' => 'mailto:?subject=~TITLE~&body=~LINK~', + 'transform' => array('rawurlencode'), + 'form' => 'simple', + 'method' => 'GET', + ), + 'print' => array( + 'url' => '#', + 'transform' => array(), + 'form' => 'simple', + 'method' => 'GET', + ), + 'jdh' => array( + 'url' => 'https://www.journalduhacker.net/stories/new?url=~LINK~&title=~TITLE~', + 'transform' => array('rawurlencode'), + 'form' => 'simple', + 'method' => 'GET', + ), + 'Known' => array( + 'url' => '~URL~/share?share_url=~LINK~&share_title=~TITLE~', + 'transform' => array('rawurlencode'), + 'help' => 'https://withknown.com/', + 'form' => 'advanced', + 'method' => 'GET', + ), + 'gnusocial' => array( + 'url' => '~URL~/notice/new?content=~TITLE~%20~LINK~', + 'transform' => array('urlencode'), + 'help' => 'https://gnu.io/social/', + 'form' => 'advanced', + 'method' => 'GET', + ), + 'mastodon' => array( + 'url' => '~URL~/api/v1/statuses', + 'transform' => array(), + 'form' => 'advanced', + 'method' => 'POST', + 'field' => 'status', + ), +); diff --git a/data/shares.php b/data/shares.php deleted file mode 100644 index 5403fd48c..000000000 --- a/data/shares.php +++ /dev/null @@ -1,129 +0,0 @@ - array( - 'url' => '~URL~?post=~LINK~&title=~TITLE~&source=FreshRSS', - 'transform' => array('rawurlencode'), - 'help' => 'http://sebsauvage.net/wiki/doku.php?id=php:shaarli', - 'form' => 'advanced', - 'method' => 'GET', - ), - 'blogotext' => array( - 'url' => '~URL~/admin/links.php?url=~LINK~', - 'transform' => array(), - 'help' => 'http://lehollandaisvolant.net/blogotext/fr/', - 'form' => 'advanced', - 'method' => 'GET', - ), - 'wallabag' => array( - 'url' => '~URL~?action=add&url=~LINK~', - 'transform' => array( - 'link' => array('base64_encode'), - 'title' => array(), - ), - 'help' => 'http://www.wallabag.org/', - 'form' => 'advanced', - 'method' => 'GET', - ), - 'wallabagv2' => array( - 'url' => '~URL~/bookmarklet?url=~LINK~', - 'transform' => array( - 'link' => array('rawurlencode'), - 'title' => array(), - ), - 'help' => 'http://www.wallabag.org/', - 'form' => 'advanced', - 'method' => 'GET', - ), - 'diaspora' => array( - 'url' => '~URL~/bookmarklet?url=~LINK~&title=~TITLE~', - 'transform' => array('rawurlencode'), - 'help' => 'https://diasporafoundation.org/', - 'form' => 'advanced', - 'method' => 'GET', - ), - 'movim' => array( - 'url' => '~URL~/?share/~LINK~', - 'transform' => array('rawurlencode', 'urlencode'), - 'help' => 'https://github.com/edhelas/movim', - 'form' => 'advanced', - 'method' => 'GET', - ), - 'twitter' => array( - 'url' => 'https://twitter.com/share?url=~LINK~&text=~TITLE~', - 'transform' => array('rawurlencode'), - 'form' => 'simple', - 'method' => 'GET', - ), - 'g+' => array( - 'url' => 'https://plus.google.com/share?url=~LINK~', - 'transform' => array('rawurlencode'), - 'form' => 'simple', - 'method' => 'GET', - ), - 'facebook' => array( - 'url' => 'https://www.facebook.com/sharer.php?u=~LINK~&t=~TITLE~', - 'transform' => array('rawurlencode'), - 'form' => 'simple', - 'method' => 'GET', - ), - 'email' => array( - 'url' => 'mailto:?subject=~TITLE~&body=~LINK~', - 'transform' => array('rawurlencode'), - 'form' => 'simple', - 'method' => 'GET', - ), - 'print' => array( - 'url' => '#', - 'transform' => array(), - 'form' => 'simple', - 'method' => 'GET', - ), - 'jdh' => array( - 'url' => 'https://www.journalduhacker.net/stories/new?url=~LINK~&title=~TITLE~', - 'transform' => array('rawurlencode'), - 'form' => 'simple', - 'method' => 'GET', - ), - 'Known' => array( - 'url' => '~URL~/share?share_url=~LINK~&share_title=~TITLE~', - 'transform' => array('rawurlencode'), - 'help' => 'https://withknown.com/', - 'form' => 'advanced', - 'method' => 'GET', - ), - 'gnusocial' => array( - 'url' => '~URL~/notice/new?content=~TITLE~%20~LINK~', - 'transform' => array('urlencode'), - 'help' => 'https://gnu.io/social/', - 'form' => 'advanced', - 'method' => 'GET', - ), - 'mastodon' => array( - 'url' => '~URL~/api/v1/statuses', - 'transform' => array(), - 'form' => 'advanced', - 'method' => 'POST', - 'field' => 'status', - ), -); -- cgit v1.2.3