From 0fc783e2b350b8ac6ff275fd9b201674cbcf2c16 Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Tue, 16 Feb 2021 22:07:37 +0300 Subject: cleanup markup in some plugins, make nsfw generate dijit widgets --- plugins/nsfw/init.php | 84 +++++++++++++++++++++++---------------------------- 1 file changed, 37 insertions(+), 47 deletions(-) (limited to 'plugins/nsfw/init.php') diff --git a/plugins/nsfw/init.php b/plugins/nsfw/init.php index 1b27cc017..fecbc62af 100644 --- a/plugins/nsfw/init.php +++ b/plugins/nsfw/init.php @@ -27,74 +27,64 @@ class NSFW extends Plugin { $a_tags = array_map("trim", explode(",", $article["tag_cache"])); if (count(array_intersect($tags, $a_tags)) > 0) { - $article["content"] = "
-
"; + $article["content"] = "
". + \Controls\button_tag(__("Not work safe (click to toggle)"), '', ['onclick' => 'Plugins.NSFW.toggle(this)']). + " +
"; } return $article; } function hook_render_article_cdm($article) { - $tags = array_map("trim", explode(",", $this->host->get($this, "tags"))); - $a_tags = array_map("trim", explode(",", $article["tag_cache"])); - - if (count(array_intersect($tags, $a_tags)) > 0) { - $article["content"] = "
-
"; - } - - return $article; + return $this->hook_render_article($article); } function hook_prefs_tab($args) { if ($args != "prefPrefs") return; - print "
extension ".__("NSFW Plugin")."\">"; - - print "
"; - $tags = $this->host->get($this, "tags"); - print "
"; - - print ""; - - print \Controls\hidden_tag("op", "pluginhandler"); - print \Controls\hidden_tag("method", "save"); - print \Controls\hidden_tag("plugin", "nsfw"); - - print ""; - - print ""; - print ""; + - print "
".__("Tags to consider NSFW (comma-separated)")."
"; +
- print "

"; +

+ +
- print "
"; +
- print "
"; #pane + + + + host->set($this, "tags", $tags); -- cgit v1.2.3-54-g00ecf