X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=lib%2Fchannel.php;h=e5e8eaa0f5a2da9e9dc675dd386ac2eed010472a;hb=e8d1bb25469fe1ef0cbcb32c3022010997aca4b0;hp=e83960ac5402cc41fbe1867ca2bceea31c7280f6;hpb=0cfaae48a34da0307c0e713164ebbf5440cb3de0;p=quix0rs-gnu-social.git diff --git a/lib/channel.php b/lib/channel.php index e83960ac54..e5e8eaa0f5 100644 --- a/lib/channel.php +++ b/lib/channel.php @@ -19,6 +19,9 @@ if (!defined('STATUSNET') && !defined('LACONICA')) { exit(1); } +/** + * @todo Needs documentation. + */ class Channel { function on($user) @@ -92,11 +95,12 @@ class WebChannel extends Channel function output($user, $text) { - # XXX: buffer all output and send it at the end - # XXX: even better, redirect to appropriate page - # depending on what command was run + // XXX: buffer all output and send it at the end + // XXX: even better, redirect to appropriate page + // depending on what command was run $this->out->startHTML(); $this->out->elementStart('head'); + // TRANS: Title for command results. $this->out->element('title', null, _('Command results')); $this->out->elementEnd('head'); $this->out->elementStart('body'); @@ -117,6 +121,7 @@ class AjaxWebChannel extends WebChannel { $this->out->startHTML('text/xml;charset=utf-8'); $this->out->elementStart('head'); + // TRANS: Title for command results. $this->out->element('title', null, _('Command results')); $this->out->elementEnd('head'); $this->out->elementStart('body'); @@ -129,7 +134,8 @@ class AjaxWebChannel extends WebChannel { $this->out->startHTML('text/xml;charset=utf-8'); $this->out->elementStart('head'); - $this->out->element('title', null, _('Ajax Error')); + // TRANS: Title for command results. + $this->out->element('title', null, _('AJAX error')); $this->out->elementEnd('head'); $this->out->elementStart('body'); $this->out->element('p', array('id' => 'error'), $text); @@ -140,7 +146,6 @@ class AjaxWebChannel extends WebChannel class MailChannel extends Channel { - var $addr = null; function source() @@ -155,20 +160,20 @@ class MailChannel extends Channel function on($user) { - return $this->set_notify($user, 1); + return $this->setNotify($user, 1); } function off($user) { - return $this->set_notify($user, 0); + return $this->setNotify($user, 0); } function output($user, $text) { - $headers['From'] = $user->incomingemail; $headers['To'] = $this->addr; + // TRANS: E-mail subject when a command has completed. $headers['Subject'] = _('Command complete'); return mail_send(array($this->addr), $headers, $text); @@ -176,16 +181,16 @@ class MailChannel extends Channel function error($user, $text) { - $headers['From'] = $user->incomingemail; $headers['To'] = $this->addr; + // TRANS: E-mail subject when a command has failed. $headers['Subject'] = _('Command failed'); return mail_send(array($this->addr), $headers, $text); } - function set_notify($user, $value) + function setNotify($user, $value) { $orig = clone($user); $user->smsnotify = $value;