mirror of
https://git.tt-rss.org/git/tt-rss.git
synced 2025-12-13 10:25:56 +00:00
share: move unsharing all articles into the plugin
This commit is contained in:
@@ -12,12 +12,18 @@ class Share extends Plugin {
|
||||
$this->host = $host;
|
||||
|
||||
$host->add_hook($host::HOOK_ARTICLE_BUTTON, $this);
|
||||
$host->add_hook($host::HOOK_PREFS_TAB_SECTION, $this);
|
||||
}
|
||||
|
||||
function get_js() {
|
||||
return file_get_contents(dirname(__FILE__) . "/share.js");
|
||||
}
|
||||
|
||||
function get_prefs_js() {
|
||||
return file_get_contents(dirname(__FILE__) . "/share_prefs.js");
|
||||
}
|
||||
|
||||
|
||||
function unshare() {
|
||||
$id = db_escape_string($_REQUEST['id']);
|
||||
|
||||
@@ -27,6 +33,30 @@ class Share extends Plugin {
|
||||
print "OK";
|
||||
}
|
||||
|
||||
function hook_prefs_tab_section($id) {
|
||||
if ($id == "prefFeedsPublishedGenerated") {
|
||||
|
||||
print_warning(__("You can disable all articles shared by unique URLs here."));
|
||||
|
||||
print "<p>";
|
||||
|
||||
print "<button dojoType=\"dijit.form.Button\" onclick=\"return clearArticleAccessKeys()\">".
|
||||
__('Unshare all articles')."</button> ";
|
||||
|
||||
print "</p>";
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
// Silent
|
||||
function clearArticleKeys() {
|
||||
db_query("UPDATE ttrss_user_entries SET uuid = '' WHERE
|
||||
owner_uid = " . $_SESSION["uid"]);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
function newkey() {
|
||||
$id = db_escape_string($_REQUEST['id']);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user