function onForm($package) { $form = $package->content; $xtf = new \XMPPtoForm(); if (!empty($form->x)) { switch ($form->x->attributes()->xmlns) { case 'jabber:x:data': $formview = $this->tpl(); $formh = $xtf->getHTML($form->x->asXML()); $formview->assign('submitdata', $this->call('ajaxRegister', "movim_form_to_json('data')")); $formview->assign('formh', $formh); $html = $formview->draw('_accountnext_form', true); RPC::call('movim_fill', 'subscription_form', $html); break; case 'jabber:x:oob': $oobview = $this->tpl(); $oobview->assign('url', (string) $form->x->url); $html = $oobview->draw('_accountnext_oob', true); RPC::call('movim_fill', 'subscription_form', $html); break; } } else { $formh = $xtf->getHTML($form->asXML()); } }
function onRegister($package) { $content = $package->content; $view = $this->tpl(); if (isset($content->x)) { $xml = new \XMPPtoForm(); $form = $xml->getHTML($content->x->asXML()); $view->assign('form', $form); $view->assign('attributes', $content->attributes()); $view->assign('actions', null); if (isset($content->actions)) { $view->assign('actions', $content->actions); } Dialog::fill($view->draw('_account_form', true), true); } }
function onCommand($package) { $command = $package->content; $view = $this->tpl(); if (isset($command->note)) { $view->assign('note', $command->note); Dialog::fill($view->draw('_adhoc_note', true)); } if (isset($command->x)) { $xml = new \XMPPtoForm(); $form = $xml->getHTML($command->x->asXML()); $view->assign('form', $form); $view->assign('attributes', $command->attributes()); $view->assign('actions', null); if (isset($command->actions)) { $view->assign('actions', $command->actions); } Dialog::fill($view->draw('_adhoc_form', true), true); } RPC::call('AdHoc.initForm'); }
function onConfig($packet) { list($config, $server, $node) = array_values($packet->content); $view = $this->tpl(); $xml = new \XMPPtoForm(); $form = $xml->getHTML($config->x->asXML()); $view->assign('form', $form); $view->assign('server', $server); $view->assign('node', $node); $view->assign('attributes', $config->attributes()); Dialog::fill($view->draw('_group_config', true), true); }
function onRoomConfig($packet) { list($config, $room) = array_values($packet->content); $view = $this->tpl(); $xml = new \XMPPtoForm(); $form = $xml->getHTML($config->x->asXML()); $view->assign('form', $form); $view->assign('room', $room); Dialog::fill($view->draw('_chat_config_room', true), true); }