* * @version 1.0 * @date 17 April 2013 * * Copyright (C)2010 MOVIM project * * See COPYING for licensing information. */ use Moxl\Xec\Action\Pubsub\GetAffiliations; use Moxl\Xec\Action\Pubsub\SetAffiliations; class NodeAffiliations extends WidgetBase { function load() { $this->registerEvent('pubsubaffiliations', 'onGroupMemberList'); $this->registerEvent('pubsubaffiliationssubmited', 'onSubmit'); } function display() { $this->view->assign('pepfilter', !filter_var($_GET['s'], FILTER_VALIDATE_EMAIL)); $this->view->assign('getaffiliations', $this->call('ajaxGetGroupMemberList', "'".$_GET['s']."'", "'".$_GET['n']."'")); } function prepareList($list) { //0:data 1:server 2:node $affiliation = array("owner", "member", "none"); $html = '
'; return $html; } function onSubmit($stanza) { Notification::append(null, $this->__('affiliations.saved')); RPC::commit(); } function onGroupMemberList($list) { $html = $this->prepareList($list); RPC::call('movim_fill', 'memberlist', $html); RPC::commit(); } function ajaxChangeAffiliation($server, $node, $data){ $r = new SetAffiliations; $r->setNode($node)->setTo($server)->setData($data) ->request(); } function ajaxGetGroupMemberList($server, $node){ $r = new GetAffiliations; $r->setTo($server)->setNode($node) ->request(); } }