]> CyberLeo.Net >> Repos - SourceForge/phpwiki.git/blob - lib/plugin/JabberPresence.php
Remove unused
[SourceForge/phpwiki.git] / lib / plugin / JabberPresence.php
1 <?php
2
3 /*
4  * Copyright (C) 2004 $ThePhpWikiProgrammingTeam
5  *
6  * This file is part of PhpWiki.
7  *
8  * PhpWiki is free software; you can redistribute it and/or modify
9  * it under the terms of the GNU General Public License as published by
10  * the Free Software Foundation; either version 2 of the License, or
11  * (at your option) any later version.
12  *
13  * PhpWiki is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16  * GNU General Public License for more details.
17  *
18  * You should have received a copy of the GNU General Public License along
19  * with PhpWiki; if not, write to the Free Software Foundation, Inc.,
20  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
21  */
22
23 /**
24  * A simple Jabber presence WikiPlugin.
25  * http://wiki.crao.net/index.php/JabberPr%E9sence/Source
26  * http://edgar.netflint.net/howto.php
27  *
28  * Usage:
29  *  <<JabberPresence scripturl=http://edgar.netflint.net/status.php
30  *                          jid=yourid@jabberserver type=html iconset=phpbb >>
31  *
32  * @author: Arnaud Fontaine
33  */
34
35 if (!defined('MY_JABBER_ID'))
36     define('MY_JABBER_ID', $GLOBALS['request']->_user->UserName() . "@jabber.com"); // or "@netflint.net"
37
38 class WikiPlugin_JabberPresence
39     extends WikiPlugin
40 {
41     function getName()
42     {
43         return _("JabberPresence");
44     }
45
46     function getDescription()
47     {
48         return _("Display Jabber presence.");
49     }
50
51     // Establish default values for each of this plugin's arguments.
52     function getDefaultArguments()
53     {
54         return array('scripturl' => "http://edgar.netflint.net/status.php",
55             'jid' => MY_JABBER_ID,
56             'type' => 'image',
57             'iconset' => "gabber");
58     }
59
60     function run($dbi, $argstr, $request)
61     {
62         extract($this->getArgs($argstr, $request));
63         // Any text that is returned will not be further transformed,
64         // so use html where necessary.
65         if (empty($jid))
66             $html = HTML();
67         else
68             $html = HTML::img(array('src' => urlencode($scripturl) .
69                 '&jid=' . urlencode($jid) .
70                 '&type=' . urlencode($type) .
71                 '&iconset=' . ($iconset),
72                 'alt' => ""));
73         return $html;
74     }
75 }
76
77 // Local Variables:
78 // mode: php
79 // tab-width: 8
80 // c-basic-offset: 4
81 // c-hanging-comment-ender-p: nil
82 // indent-tabs-mode: nil
83 // End: