Esempio n. 1
0
 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());
     }
 }
Esempio n. 2
0
 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);
     }
 }
Esempio n. 3
0
 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');
 }
Esempio n. 4
0
File: Group.php Progetto: vijo/movim
 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);
 }
Esempio n. 5
0
File: Chat.php Progetto: Trim/movim
 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);
 }