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 .= ' <li class="action"> <span class="icon bubble color ' . stringToColor($s->node) . '"> ' . firstLetterCapitalize($s->node) . ' </span> <form> <div class="action"> <div class="checkbox"> <input type="checkbox" id="privacy' . $s->node . '" name="privacy' . $s->node . '" ' . $checked . ' onchange="' . $switch . '"/> <label for="privacy' . $s->node . '"></label> </div> </div> </form> <a href="' . Route::urlize('node', array($s->server, $s->node)) . '">' . $name . ' </a> </li>'; } $configlist->assign('list', $listhtml); return $configlist->draw('_pubsubsubscriptionconfig_list', true); //} else return t('No public groups found'); }
public function setBookmark($item = false) { $arr = []; if ($item) { array_push($arr, $item); } $sd = new \Modl\SubscriptionDAO(); $cd = new \Modl\ConferenceDAO(); $session = Session::start(); $subscribed = $sd->getSubscribed(); if ($subscribed) { foreach ($subscribed as $s) { array_push($arr, ['type' => 'subscription', 'server' => $s->server, 'title' => $s->title, 'subid' => $s->subid, 'tags' => unserialize($s->tags), 'node' => $s->node]); } } $conferences = $cd->getAll(); if ($conferences) { foreach ($conferences as $c) { array_push($arr, ['type' => 'conference', 'name' => $c->name, 'autojoin' => $c->autojoin, 'nick' => $c->nick, 'jid' => $c->conference]); } } $b = new Set(); $b->setArr($arr)->setTo($session->get('jid'))->request(); }