mirror of
https://codeberg.org/streams/streams.git
synced 2024-09-20 02:55:13 +00:00
32 lines
700 B
PHP
32 lines
700 B
PHP
<?php
|
|
|
|
namespace Code\Widget;
|
|
|
|
use App;
|
|
use Code\Lib\Chatroom;
|
|
use Code\Render\Theme;
|
|
|
|
|
|
class Chatroom_list implements WidgetInterface
|
|
{
|
|
|
|
public function widget(array $arguments): string
|
|
{
|
|
if (!App::$profile) {
|
|
return '';
|
|
}
|
|
|
|
$r = Chatroom::roomlist(App::$profile['profile_uid']);
|
|
|
|
if ($r) {
|
|
return replace_macros(Theme::get_template('chatroomlist.tpl'), [
|
|
'$header' => t('Chatrooms'),
|
|
'$baseurl' => z_root(),
|
|
'$nickname' => App::$profile['channel_address'],
|
|
'$items' => $r,
|
|
'$overview' => t('Overview')
|
|
]);
|
|
}
|
|
return '';
|
|
}
|
|
}
|