aa2d6537de
git-svn-id: file:///home/shish/svn/shimmie2/trunk@493 7f39781d-f577-437e-ae19-be835c7a54ca
72 lines
2.4 KiB
PHP
72 lines
2.4 KiB
PHP
<?php
|
|
class taggerTheme extends Themelet {
|
|
public function build ($page, $tags) {
|
|
$tag_html = "";
|
|
foreach ($tags as $tag) {
|
|
$tag_name = $tag['tag'];
|
|
$tag_trunc = $this->trimTag($tag_name,32);
|
|
$tag_html .= "<div id='tagger_tag_".$tag_name."'>"."
|
|
<a style='cursor:pointer;' onclick='addTag("".$tag_name."");' ".
|
|
"title='Add "".$tag_name."" to the tag list'>".$tag_trunc."</a>".
|
|
"</div>";
|
|
}
|
|
$url_more = make_link("about/tagger");
|
|
$html = <<<EOD
|
|
<span style="font-size:.7em;">Collapse this block to hide Tagger.</span>
|
|
<br/>
|
|
<h4>Use</h4>
|
|
<ul>
|
|
<li>Click the links to add the tag to the list, when done, press Set to save the tags.</li>
|
|
<li>Type in the filter box to remove tags you aren't looking for.</li>
|
|
<li>Enter tags not on the list in the second box. Tags must have 2 uses to display in the list.</li>
|
|
<li><a href='$url_more'>More</a></li>
|
|
</ul>
|
|
<div id="tagger_window" style="top:100px;left:800px;">
|
|
<div id="tagger_titlebar" title="'Drag to move" onmousedown="dragStart(event,"tagger_window");">
|
|
Tagger
|
|
</div>
|
|
<div id="tagger_body" style="height:300px;">
|
|
<input type="text" id="tagger_filter" onkeyup="tagger_filter("tagger_filter")" size="12"></input>
|
|
<hr/>
|
|
<input type="text" id="custTag" value="" size='12'></input>
|
|
<input type="button" value="Add" onclick="addTagById("custTag")"></input>
|
|
<hr/>
|
|
$tag_html
|
|
</div>
|
|
</div>
|
|
EOD;
|
|
$page->add_block( new Block("Tagger",
|
|
"".$html,
|
|
"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;
|
|
}
|
|
|
|
public function show_about ($event) {
|
|
global $page;
|
|
$html = <<<EOD
|
|
<h4>Author</h4>
|
|
Erik Youngren (Artanis) artanis.00@gmail.com
|
|
<h4>Use</h4>
|
|
<ul>
|
|
<li>Click the links to add the tag to the image's tag list, when done, press Set to save the tags.</li>
|
|
<li>Type in the filter box to remove tags you aren't looking for.<ul>
|
|
<li>Single letter filters will only match the first letter of the tags.</li>
|
|
<li>2 or more will match that letter combination anywhere in the tag. Starting a
|
|
filter with a space (' ') will prevent this behaviour.</li>
|
|
</ul></li>
|
|
<li>Enter tags not on the list in the second box. Tags must have 2 uses to display in the list.</li>
|
|
</ul>
|
|
EOD;
|
|
|
|
$page->add_block( new Block("About Tagger", $html,"main"));
|
|
}
|
|
}
|
|
?>
|