summaryrefslogtreecommitdiff
path: root/init.php
blob: c1169fc344d94fedb55e211332599e848ac916e1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
<?php
class Close_Button extends Plugin {
	private $host;

	function init($host) {
		$this->host = $host;

		$host->add_hook($host::HOOK_ARTICLE_BUTTON, $this);
	}

	function about() {
		return array(null,
			"Adds a button to close article panel",
			"fox");
	}

	function get_css() {
		return ".post .header .buttons i.material-icons.icon-close-article { color : red; }";
	}

	function hook_article_button($line) {
		if (!get_pref(Prefs::COMBINED_DISPLAY_MODE)) {
			return "<i class='material-icons icon-close-article'
				style='cursor : pointer' onclick='Article.close()'
				title='".__('Close article')."'>close</i>";
		}
	}

	function api_version() {
		return 2;
	}

}