2013-02-20 12:04:15 +00:00
|
|
|
<?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(1.0,
|
|
|
|
"Adds a button to close article panel",
|
|
|
|
"fox");
|
|
|
|
}
|
|
|
|
|
2018-12-09 13:35:00 +00:00
|
|
|
function get_css() {
|
|
|
|
return "i.icon-close-article { color : red; }";
|
|
|
|
}
|
|
|
|
|
2013-02-20 12:04:15 +00:00
|
|
|
function hook_article_button($line) {
|
2013-04-17 14:34:18 +00:00
|
|
|
if (!get_pref("COMBINED_DISPLAY_MODE")) {
|
2021-02-10 18:40:31 +00:00
|
|
|
return "<i class='material-icons icon-close-article'
|
2018-12-09 13:35:00 +00:00
|
|
|
style='cursor : pointer' onclick='Article.close()'
|
|
|
|
title='".__('Close article')."'>close</i>";
|
2013-02-20 12:04:15 +00:00
|
|
|
}
|
|
|
|
}
|
2013-04-19 13:31:56 +00:00
|
|
|
|
|
|
|
function api_version() {
|
|
|
|
return 2;
|
|
|
|
}
|
|
|
|
|
2021-02-08 16:42:10 +00:00
|
|
|
}
|