Revert "Fixed direct messaging: AjaxWebChannel is now using Action's methods."

This reverts commit 0f2c43bd04.

Making Channel a subclass of Action for no other reason than to let
the AjaxWebChannel do some output is the really, really wrong way to
do this. A Channel is not an Action.

I'll change AjaxWebChannel so it takes an Action as a constructor
paramater and uses that Action for its output. We do this for most
Widget subclasses and it makes sense here, too.
This commit is contained in:
Evan Prodromou 2009-02-04 07:33:10 -05:00
parent 92c6034b25
commit 15b96f78ab

View File

@ -19,7 +19,7 @@
if (!defined('LACONICA')) { exit(1); } if (!defined('LACONICA')) { exit(1); }
class Channel extends Action class Channel
{ {
function on($user) function on($user)
@ -129,7 +129,6 @@ class WebChannel extends Channel
# XXX: buffer all output and send it at the end # XXX: buffer all output and send it at the end
# XXX: even better, redirect to appropriate page # XXX: even better, redirect to appropriate page
# depending on what command was run # depending on what command was run
common_show_header(_('Command results')); common_show_header(_('Command results'));
common_element('p', null, $text); common_element('p', null, $text);
common_show_footer(); common_show_footer();
@ -147,26 +146,26 @@ class AjaxWebChannel extends WebChannel
function output($user, $text) function output($user, $text)
{ {
$this->startHTML('text/xml;charset=utf-8', true); common_start_html('text/xml;charset=utf-8', true);
$this->elementStart('head'); common_element_start('head');
$this->element('title', null, _('Command results')); common_element('title', null, _('Command results'));
$this->elementEnd('head'); common_element_end('head');
$this->elementStart('body'); common_element_start('body');
$this->element('p', array('id' => 'command_result'), $text); common_element('p', array('id' => 'command_result'), $text);
$this->elementEnd('body'); common_element_end('body');
$this->elementEnd('html'); common_element_end('html');
} }
function error($user, $text) function error($user, $text)
{ {
$this->startHTML('text/xml;charset=utf-8', true); common_start_html('text/xml;charset=utf-8', true);
$this->elementStart('head'); common_element_start('head');
$this->element('title', null, _('Ajax error')); common_element('title', null, _('Ajax Error'));
$this->elementEnd('head'); common_element_end('head');
$this->elementStart('body'); common_element_start('body');
$this->element('p', array('id' => 'error'), $text); common_element('p', array('id' => 'error'), $text);
$this->elementEnd('body'); common_element_end('body');
$this->elementEnd('html'); common_element_end('html');
} }
} }