mirror of https://github.com/movim/movim
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
38 lines
915 B
38 lines
915 B
<?php
|
|
|
|
use Movim\Widget\Base;
|
|
|
|
include_once WIDGETS_PATH . 'CommunitiesServer/CommunitiesServer.php';
|
|
|
|
class CommunitySubscriptions extends Base
|
|
{
|
|
private $_list_server;
|
|
|
|
public function load()
|
|
{
|
|
$this->addjs('communitysubscriptions.js');
|
|
}
|
|
|
|
public function checkNewServer($node)
|
|
{
|
|
$r = ($this->_list_server != $node->server);
|
|
$this->_list_server = $node->server;
|
|
return $r;
|
|
}
|
|
|
|
public function ajaxHttpGet()
|
|
{
|
|
$view = $this->tpl();
|
|
$view->assign('subscriptions', $this->user->subscriptions()
|
|
->notComments()
|
|
->orderBy('server')->orderBy('node')
|
|
->get());
|
|
|
|
$this->rpc('MovimTpl.fill', '#subscriptions', $view->draw('_communitysubscriptions'));
|
|
}
|
|
|
|
public function prepareTicket(\App\Info $community)
|
|
{
|
|
return (new CommunitiesServer)->prepareTicket($community);
|
|
}
|
|
}
|