/**
* For initializing members of the class.
*
- * @param array $argarray misc. arguments
+ * @param array $args misc. arguments
*
* @return boolean true
+ * @throws ClientException
*/
- function prepare($argarray)
+ function prepare(array $args = [])
{
- parent::prepare($argarray);
+ parent::prepare($args);
$this->user = common_current_user();
/**
* Handler method
*
- * @param array $argarray is ignored since it's now passed in in prepare()
- *
* @return void
*/
- function handle($argarray=null)
+ function handle()
{
- parent::handle($argarray);
+ parent::handle();
if ($this->isPost()) {
$this->newPoll();
function newPoll()
{
if ($this->boolean('ajax')) {
- StatusNet::setApi(true);
+ GNUsocial::setApi(true);
}
try {
if (empty($this->question)) {
}
if ($this->boolean('ajax')) {
- header('Content-Type: text/xml;charset=utf-8');
- $this->xw->startDocument('1.0', 'UTF-8');
- $this->elementStart('html');
+ $this->startHTML('text/xml;charset=utf-8');
$this->elementStart('head');
// TRANS: Page title after sending a notice.
$this->element('title', null, _m('Notice posted'));
$this->elementStart('body');
$this->showNotice($saved);
$this->elementEnd('body');
- $this->elementEnd('html');
+ $this->endHTML();
} else {
- common_redirect($saved->bestUrl(), 303);
+ common_redirect($saved->getUrl(), 303);
}
}
*
* @return void
*/
- function showNotice($notice)
+ function showNotice(Notice $notice)
{
class_exists('NoticeList'); // @fixme hack for autoloader
$nli = new NoticeListItem($notice, $this);