2013-04-09 12:13:32 +00:00
|
|
|
<?php
|
|
|
|
class Mark_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,
|
|
|
|
"Bottom un/star button for the combined mode",
|
|
|
|
"fox");
|
|
|
|
}
|
|
|
|
|
|
|
|
function hook_article_button($line) {
|
|
|
|
$marked_pic = "";
|
2013-04-09 12:26:36 +00:00
|
|
|
$id = $line["id"];
|
2013-04-09 12:13:32 +00:00
|
|
|
|
2013-04-17 14:34:18 +00:00
|
|
|
if (get_pref("COMBINED_DISPLAY_MODE")) {
|
2013-04-09 12:13:32 +00:00
|
|
|
if (sql_bool_to_bool($line["marked"])) {
|
|
|
|
$marked_pic = "<img
|
2013-07-10 09:09:12 +00:00
|
|
|
src=\"images/mark_set.png\"
|
2018-12-01 05:20:09 +00:00
|
|
|
class=\"marked-pic marked-$id\" alt=\"Unstar article\"
|
2018-12-01 18:01:53 +00:00
|
|
|
onclick='Headlines.toggleMark($id)'>";
|
2013-04-09 12:13:32 +00:00
|
|
|
} else {
|
|
|
|
$marked_pic = "<img
|
2013-07-10 09:14:06 +00:00
|
|
|
src=\"images/mark_unset.png\"
|
2018-12-01 05:20:09 +00:00
|
|
|
class=\"marked-pic marked-$id\" alt=\"Star article\"
|
2018-12-01 18:01:53 +00:00
|
|
|
onclick='Headlines.toggleMark($id)'>";
|
2013-04-09 12:13:32 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return $marked_pic;
|
|
|
|
}
|
2013-04-19 13:31:56 +00:00
|
|
|
|
|
|
|
function api_version() {
|
|
|
|
return 2;
|
|
|
|
}
|
|
|
|
|
2013-04-09 12:13:32 +00:00
|
|
|
}
|