2017-03-16 04:26:28 +00:00
|
|
|
<?php
|
|
|
|
|
2022-02-16 04:08:28 +00:00
|
|
|
namespace Code\Widget;
|
2017-03-16 04:26:28 +00:00
|
|
|
|
2021-12-02 22:33:36 +00:00
|
|
|
use App;
|
2022-02-16 04:08:28 +00:00
|
|
|
use Code\Lib\Chatroom;
|
|
|
|
use Code\Render\Theme;
|
2022-02-12 20:43:29 +00:00
|
|
|
|
2021-12-02 22:33:36 +00:00
|
|
|
|
2021-12-02 23:02:31 +00:00
|
|
|
class Chatroom_list
|
|
|
|
{
|
2017-03-16 04:26:28 +00:00
|
|
|
|
2021-12-02 23:02:31 +00:00
|
|
|
public function widget($arr)
|
|
|
|
{
|
2017-03-16 04:26:28 +00:00
|
|
|
|
2021-12-03 03:01:39 +00:00
|
|
|
if (!App::$profile) {
|
2021-12-02 23:02:31 +00:00
|
|
|
return '';
|
2021-12-03 03:01:39 +00:00
|
|
|
}
|
2017-03-16 04:26:28 +00:00
|
|
|
|
2021-12-02 23:02:31 +00:00
|
|
|
$r = Chatroom::roomlist(App::$profile['profile_uid']);
|
2017-03-16 04:26:28 +00:00
|
|
|
|
2021-12-02 23:02:31 +00:00
|
|
|
if ($r) {
|
2022-02-12 20:43:29 +00:00
|
|
|
return replace_macros(Theme::get_template('chatroomlist.tpl'), array(
|
2021-12-02 23:02:31 +00:00
|
|
|
'$header' => t('Chatrooms'),
|
|
|
|
'$baseurl' => z_root(),
|
|
|
|
'$nickname' => App::$profile['channel_address'],
|
|
|
|
'$items' => $r,
|
|
|
|
'$overview' => t('Overview')
|
|
|
|
));
|
|
|
|
}
|
|
|
|
}
|
2017-03-16 04:26:28 +00:00
|
|
|
}
|