2013-04-09 14:13:32 +02: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 14:26:36 +02:00
|
|
|
$id = $line["id"];
|
2013-04-09 14:13:32 +02:00
|
|
|
|
2013-04-17 16:34:18 +02:00
|
|
|
if (get_pref("COMBINED_DISPLAY_MODE")) {
|
2013-04-09 14:13:32 +02:00
|
|
|
if (sql_bool_to_bool($line["marked"])) {
|
|
|
|
$marked_pic = "<img
|
2013-07-10 11:09:12 +02:00
|
|
|
src=\"images/mark_set.png\"
|
2013-04-09 14:13:32 +02:00
|
|
|
class=\"markedPic\" alt=\"Unstar article\"
|
|
|
|
onclick='toggleMark($id)'>";
|
|
|
|
} else {
|
|
|
|
$marked_pic = "<img
|
2013-07-10 11:14:06 +02:00
|
|
|
src=\"images/mark_unset.png\"
|
2013-04-09 14:13:32 +02:00
|
|
|
class=\"markedPic\" alt=\"Star article\"
|
|
|
|
onclick='toggleMark($id)'>";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return $marked_pic;
|
|
|
|
}
|
2013-04-19 15:31:56 +02:00
|
|
|
|
|
|
|
function api_version() {
|
|
|
|
return 2;
|
|
|
|
}
|
|
|
|
|
2013-04-09 14:13:32 +02:00
|
|
|
}
|
|
|
|
?>
|