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.
34 lines
841 B
34 lines
841 B
<?php
|
|
|
|
class ContactDiscoPosts extends \Movim\Widget\Base
|
|
{
|
|
public function load()
|
|
{
|
|
$this->addjs('contactdiscoposts.js');
|
|
}
|
|
|
|
public function ajaxGet()
|
|
{
|
|
$this->rpc('MovimTpl.fill', '#contactdiscoposts', $this->preparePosts());
|
|
}
|
|
|
|
public function prepareTicket(\App\Post $post)
|
|
{
|
|
return (new Post)->prepareTicket($post);
|
|
}
|
|
|
|
public function preparePosts()
|
|
{
|
|
$view = $this->tpl();
|
|
|
|
$blogs = \App\Post::restrictToMicroblog()
|
|
->restrictUserHost()
|
|
->restrictNSFW()
|
|
->where('open', true)
|
|
->orderBy('published', 'desc')
|
|
->get();
|
|
$view->assign('blogs', $blogs);
|
|
|
|
return $view->draw('_contactdiscoposts', true);
|
|
}
|
|
}
|