true);
}
/** @return void */
function save() {
$enable_share_anything = checkbox_to_sql_bool($_POST["enable_share_anything"] ?? "");
$this->host->set($this, "enable_share_anything", $enable_share_anything);
echo __("Data saved.");
}
function init($host)
{
$this->host = $host;
$host->add_hook($host::HOOK_ARTICLE_FILTER, $this);
$host->add_hook($host::HOOK_PREFS_TAB, $this);
$host->add_hook($host::HOOK_PREFS_EDIT_FEED, $this);
$host->add_hook($host::HOOK_PREFS_SAVE_FEED, $this);
$host->add_hook($host::HOOK_ARTICLE_BUTTON, $this);
// Note: we have to install the hook even if disabled because init() is being run before plugin data has loaded
// so we can't check for our storage-set options here
$host->add_hook($host::HOOK_GET_FULL_TEXT, $this);
$host->add_filter_action($this, "action_inline", __("Inline content"));
$host->add_filter_action($this, "action_inline_append", __("Append content"));
}
function get_js() {
return file_get_contents(__DIR__ . "/init.js");
}
function hook_article_button($line) {
return "description";
}
function hook_prefs_tab($args) {
if ($args != "prefFeeds") return;
$enable_share_anything = sql_bool_to_bool($this->host->get($this, "enable_share_anything"));
?>
= format_notice("Enable for specific feeds in the feed editor.") ?>
filter_unknown_feeds(
$this->get_stored_array("enabled_feeds"));
$append_feeds = $this->filter_unknown_feeds(
$this->get_stored_array("append_feeds"));
$this->host->set($this, "enabled_feeds", $enabled_feeds);
$this->host->set($this, "append_feeds", $append_feeds);
?>
0) { ?>