2007-09-25 21:28:09 +00:00
|
|
|
<?php
|
|
|
|
class taggerTheme extends Themelet {
|
|
|
|
public function build ($page, $tags) {
|
2007-09-26 09:40:51 +00:00
|
|
|
|
2007-09-26 07:23:16 +00:00
|
|
|
$tag_html = "";
|
2007-09-25 21:28:09 +00:00
|
|
|
foreach ($tags as $tag) {
|
2007-09-26 07:23:16 +00:00
|
|
|
$tag_name = $tag['tag'];
|
2007-09-26 09:40:51 +00:00
|
|
|
$tag_trunc = $this->trimTag($tag_name,16);
|
2007-09-26 07:23:16 +00:00
|
|
|
$tag_html .= "<div id='tagger_tag_".$tag_name."'>"."
|
2007-09-26 09:40:51 +00:00
|
|
|
<a style='cursor:pointer;' onclick='toggleTag("".$tag_name."");' ".
|
2007-09-26 07:23:16 +00:00
|
|
|
"title='Add "".$tag_name."" to the tag list'>".$tag_trunc."</a>".
|
|
|
|
"</div>";
|
2007-09-25 21:28:09 +00:00
|
|
|
}
|
2007-09-26 07:23:16 +00:00
|
|
|
$url_more = make_link("about/tagger");
|
2007-09-26 09:40:51 +00:00
|
|
|
|
2007-09-26 07:23:16 +00:00
|
|
|
$html = <<<EOD
|
|
|
|
<span style="font-size:.7em;">Collapse this block to hide Tagger.</span>
|
|
|
|
<br/>
|
2007-09-26 09:40:51 +00:00
|
|
|
<a href='$url_more'>About Tagger</a>
|
|
|
|
<div id="tagger_window" style="top:100px;left:100px;" onmousedown="setTagIndicators("tagger_window");">
|
2007-09-26 07:23:16 +00:00
|
|
|
<div id="tagger_titlebar" title="'Drag to move" onmousedown="dragStart(event,"tagger_window");">
|
|
|
|
Tagger
|
|
|
|
</div>
|
|
|
|
<div id="tagger_body" style="height:300px;">
|
2007-09-26 09:40:51 +00:00
|
|
|
<input type="text" id="tagger_custTag" value="" onkeyup="tagger_filter("tagger_custTag")" size='12'></input>
|
|
|
|
<input type="button" value="Add" onclick="addTagById("tagger_custTag")"></input>
|
2007-09-26 07:23:16 +00:00
|
|
|
<hr/>
|
2007-09-26 09:40:51 +00:00
|
|
|
$tag_html
|
2007-09-26 07:23:16 +00:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
EOD;
|
2007-09-25 21:28:09 +00:00
|
|
|
$page->add_block( new Block("Tagger",
|
2007-09-26 07:23:16 +00:00
|
|
|
"".$html,
|
2007-09-25 21:28:09 +00:00
|
|
|
"left",
|
|
|
|
0));
|
|
|
|
}
|
|
|
|
|
|
|
|
public function trimTag($s,$len=80) {
|
|
|
|
if(strlen($s) > $len) {
|
|
|
|
$s = substr($s, 0,$len-1);
|
|
|
|
$s = substr($s,0, strrpos($s,'_'))."...";
|
|
|
|
}
|
|
|
|
return $s;
|
|
|
|
}
|
2007-09-26 07:23:16 +00:00
|
|
|
|
|
|
|
public function show_about ($event) {
|
|
|
|
global $page;
|
|
|
|
$html = <<<EOD
|
|
|
|
<ul>
|
|
|
|
<li>Click the links to add the tag to the image's tag list, when done, press Set to save the tags.</li>
|
2007-09-26 09:40:51 +00:00
|
|
|
<li>
|
|
|
|
If you are having trouble finding the tag you are looking for, enter it into the box at the top.<br/>
|
|
|
|
As you type, Tagger will remove tags that do not match to aid your search.<br/>
|
|
|
|
If it is not in the list, click Add to add the tag to the image's tag list.<br/>
|
|
|
|
Tags must have two uses to appear in Tagger's list, so you'll have to enter the tag at least once more.
|
|
|
|
</li>
|
2007-09-26 07:23:16 +00:00
|
|
|
</ul>
|
|
|
|
EOD;
|
2007-09-26 09:40:51 +00:00
|
|
|
$page->set_title("About Extension: Tagger");
|
|
|
|
$page->set_heading("About Extension: Tagger");
|
|
|
|
$page->add_block( new Block("Author","Erik Youngren (Artanis) artanis.00@gmail.com","main",0));
|
|
|
|
$page->add_block( new Block("Use", $html,"main",1));
|
2007-09-26 07:23:16 +00:00
|
|
|
}
|
2007-09-25 21:28:09 +00:00
|
|
|
}
|
2007-09-25 10:16:26 +00:00
|
|
|
?>
|