emoticon list

This commit is contained in:
Shish 2009-08-08 17:43:18 +01:00
parent 512503799d
commit d95855411d
2 changed files with 29 additions and 0 deletions

View File

@ -24,4 +24,12 @@ class Emoticons extends FormatterExtension {
}
}
add_event_listener(new Emoticons());
class EmoticonList extends SimpleExtension {
public function onPageRequest($event) {
if($event->page_matches("emote/list")) {
$this->theme->display_emotes(glob("ext/emoticons/default/*"));
}
}
}
?>

View File

@ -0,0 +1,21 @@
<?php
class EmoticonListTheme extends Themelet {
public function display_emotes($list) {
global $page;
$data_href = get_base_href();
$html = "<html><head><title>Emoticon list</title></head><body>";
$html .= "<table><tr>";
$n = 1;
foreach($list as $item) {
$pathinfo = pathinfo($item);
$name = $pathinfo["filename"];
$html .= "<td><img src='$data_href/$item'> :$name:</td>";
if($n++ % 3 == 0) $html .= "</tr><tr>";
}
$html .= "</tr></table>";
$html .= "</body></html>";
$page->set_mode("data");
$page->set_data($html);
}
}
?>