From d95855411d5a14a825a51be44892e309eb5fe047 Mon Sep 17 00:00:00 2001 From: Shish Date: Sat, 8 Aug 2009 17:43:18 +0100 Subject: [PATCH] emoticon list --- contrib/emoticons/main.php | 8 ++++++++ contrib/emoticons/theme.php | 21 +++++++++++++++++++++ 2 files changed, 29 insertions(+) create mode 100644 contrib/emoticons/theme.php 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); + } +} +?>