diff --git a/contrib/emoticons/main.php b/contrib/emoticons/main.php index faa7721e..5b1f0486 100644 --- a/contrib/emoticons/main.php +++ b/contrib/emoticons/main.php @@ -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/*")); + } + } +} ?> diff --git a/contrib/emoticons/theme.php b/contrib/emoticons/theme.php new file mode 100644 index 00000000..a21a2088 --- /dev/null +++ b/contrib/emoticons/theme.php @@ -0,0 +1,21 @@ +Emoticon list"; + $html .= ""; + $n = 1; + foreach($list as $item) { + $pathinfo = pathinfo($item); + $name = $pathinfo["filename"]; + $html .= ""; + if($n++ % 3 == 0) $html .= ""; + } + $html .= "
:$name:
"; + $html .= ""; + $page->set_mode("data"); + $page->set_data($html); + } +} +?>