summaryrefslogtreecommitdiff
path: root/classes
diff options
context:
space:
mode:
authorZach Copley <zach@controlyourself.ca>2008-12-09 16:06:54 -0500
committerZach Copley <zach@controlyourself.ca>2008-12-09 16:06:54 -0500
commit407ce3bd8fa6ef6fe3c73d41bb0a0d11e64bac99 (patch)
tree28437bad54c893207ba43fff9d8e4787636e867e /classes
parent792cb7a5358c4b7f80b124d5a80c625a7d4d89ea (diff)
New AjaxWebChannel for returning ajaxy responses to notice input box commands
darcs-hash:20081209210654-7b5ce-2ef432aa8cb7bf5cc1a973a71eb70e6b2aae4ab6.gz
Diffstat (limited to 'classes')
-rw-r--r--classes/Channel.php27
1 files changed, 27 insertions, 0 deletions
diff --git a/classes/Channel.php b/classes/Channel.php
index 87f02b316..34735c450 100644
--- a/classes/Channel.php
+++ b/classes/Channel.php
@@ -120,6 +120,33 @@ class WebChannel extends Channel {
}
}
+
+class AjaxWebChannel extends WebChannel {
+
+ function output($user, $text) {
+ common_start_html('text/xml;charset=utf-8', false);
+ common_element_start('head');
+ common_element('title', null, _('Command results'));
+ common_element_end('head');
+ common_element_start('body');
+ common_element('p', array('class' => 'command_results'), $text);
+ common_element_end('body');
+ common_element_end('html');
+ }
+
+ function error($user, $text) {
+ common_start_html('text/xml;charset=utf-8', false);
+ common_element_start('head');
+ common_element('title', null, _('Ajax Error'));
+ common_element_end('head');
+ common_element_start('body');
+ common_element('p', array('class' => 'error'), $text);
+ common_element_end('body');
+ common_element_end('html');
+ }
+}
+
+
class MailChannel extends Channel {
var $addr = NULL;