* * @version 1.0 * @date 24 March 2013 * * Copyright (C)2010 MOVIM project * * See COPYING for licensing information. */ use Moxl\Xec\Action\PubsubSubscription\ListGet; use Moxl\Xec\Action\PubsubSubscription\ListAdd; use Moxl\Xec\Action\PubsubSubscription\ListRemove; class PubsubSubscriptionConfig extends WidgetBase { function load() { $this->registerEvent('groupsubscribedlist', 'onGroupSubscribedList'); $this->registerEvent('groupadded', 'onGroupAdded'); $this->registerEvent('groupremoved', 'onGroupRemoved'); } function display() { $this->view->assign( 'getsubscribedlist', $this->call('ajaxGetGroupSubscribedList') ); } function onGroupSubscribedList($list) { $html = $this->prepareList($list); RPC::call('movim_fill', 'groupsubscribedlistconfig', $html); } function prepareList($list) { $configlist = $this->tpl(); $sd = new \Modl\SubscriptionDAO(); $listhtml = ''; //if($sd != null && $sd->getSubscribed() != null) { foreach($sd->getSubscribed() as $s) { if($s->name != null) $name = $s->name; else $name = $s->node; if(isset($list[$s->server.$s->node])) $checked = 'checked'; else $checked = ''; $switch = $this->call( 'ajaxChangeSubscribed', "'".$s->server."'", "'".$s->node."'", "this.checked", "'".$name."'"); $listhtml .= '