Skip to content

Commit 4918896

Browse files
committed
BBB plugin: Add share blocks for html or flash see BT#14664
1 parent 90d7800 commit 4918896

File tree

3 files changed

+76
-22
lines changed

3 files changed

+76
-22
lines changed

plugin/bbb/lib/bbb_plugin.class.php

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -253,16 +253,18 @@ public function uninstall()
253253
}
254254

255255
/**
256+
* Return an array with URL
257+
*
256258
* @param string $conferenceUrl
257259
*
258-
* @return string
260+
* @return array
259261
*/
260262
public function getUrlInterfaceLinks($conferenceUrl)
261263
{
262-
$url = $this->getFlashUrl($conferenceUrl);
263-
$url .= ' '.$this->getHtmlUrl($conferenceUrl);
264+
$urlList[] = $this->getFlashUrl($conferenceUrl);
265+
$urlList[] = $this->getHtmlUrl($conferenceUrl);
264266

265-
return $url;
267+
return $urlList;
266268
}
267269

268270
/**

plugin/bbb/listing.php

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -193,27 +193,30 @@
193193
$tpl->assign('form', $formToString);
194194

195195
// Default URL
196-
$url = Display::url(
196+
$urlList[] = Display::url(
197197
$plugin->get_lang('EnterConference'),
198198
$conferenceUrl,
199199
['target' => '_blank', 'class' => 'btn btn-primary btn-large']
200200
);
201201

202202
$type = $plugin->get('launch_type');
203203
$warningIntefaceMessage = '';
204+
$showClientOptions = false;
204205

205206
switch ($type) {
206207
case BBBPlugin::LAUNCH_TYPE_DEFAULT:
207-
$url = Display::url(
208+
$urlList = [];
209+
$urlList[] = Display::url(
208210
$plugin->get_lang('EnterConference'),
209211
$conferenceUrl.'&interface='.$plugin->get('interface'),
210212
['target' => '_blank', 'class' => 'btn btn-primary btn-large']
211213
);
212214
break;
213215
case BBBPlugin::LAUNCH_TYPE_SET_BY_TEACHER:
214216
if ($conferenceManager) {
215-
$url = $plugin->getUrlInterfaceLinks($conferenceUrl);
217+
$urlList = $plugin->getUrlInterfaceLinks($conferenceUrl);
216218
$warningIntefaceMessage = Display::return_message($plugin->get_lang('ParticipantsWillUseSameInterface'));
219+
$showClientOptions = true;
217220
} else {
218221
$meetingInfo = $bbb->getMeetingByName($videoConferenceName);
219222
switch ($meetingInfo['interface']) {
@@ -228,12 +231,14 @@
228231
break;
229232
case BBBPlugin::LAUNCH_TYPE_SET_BY_STUDENT:
230233
if ($conferenceManager) {
231-
$url = $plugin->getUrlInterfaceLinks($conferenceUrl);
234+
$urlList = $plugin->getUrlInterfaceLinks($conferenceUrl);
235+
$showClientOptions = true;
232236
} else {
233237
if ($meetingExists) {
234238
$meetingInfo = $bbb->getMeetingByName($videoConferenceName);
235239
$meetinUserInfo = $bbb->getMeetingParticipantInfo($meetingInfo['id'], api_get_user_id());
236-
$url = $plugin->getUrlInterfaceLinks($conferenceUrl);
240+
$urlList = $plugin->getUrlInterfaceLinks($conferenceUrl);
241+
$showClientOptions = true;
237242

238243
/*if (empty($meetinUserInfo)) {
239244
$url = $plugin->getUrlInterfaceLinks($conferenceUrl);
@@ -253,8 +258,9 @@
253258
break;
254259
}
255260

256-
$tpl->assign('enter_conference_links', $url);
261+
$tpl->assign('enter_conference_links', $urlList);
257262
$tpl->assign('warning_inteface_msg', $warningIntefaceMessage);
263+
$tpl->assign('show_client_options', $showClientOptions);
258264

259265
$listing_tpl = 'bbb/listing.tpl';
260266
$content = $tpl->fetch($listing_tpl);

plugin/bbb/listing.tpl

Lines changed: 58 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,64 @@
33
<div class ="col-md-12" style="text-align:center">
44
{{ form }}
55
{% if show_join_button == true %}
6+
{% if show_client_options %}
7+
<div class="row">
8+
<div class="col-md-6">
9+
<div class="well">
10+
{{ enter_conference_links.0 }}
11+
<br />
12+
<strong>{{ 'UrlMeetingToShare'| get_plugin_lang('BBBPlugin') }}</strong>
13+
<div class="form-inline">
14+
<div class="form-group">
15+
<input id="share_button_flash" type="text"
16+
style="width:300px"
17+
class="form-control" readonly value="{{ conference_url }}&inteface=0">
18+
19+
<button onclick="copyTextToClipBoard('share_button_flash');" class="btn btn-default">
20+
<span class="fa fa-copy"></span> {{ 'CopyTextToClipboard' | get_lang }}
21+
</button>
22+
</div>
23+
</div>
24+
</div>
25+
</div>
26+
<div class="col-md-6">
27+
<div class="well">
28+
{{ enter_conference_links.1 }}
29+
<br />
30+
<strong>{{ 'UrlMeetingToShare'| get_plugin_lang('BBBPlugin') }}</strong>
31+
<div class="form-inline">
32+
<div class="form-group">
33+
<input id="share_button_html" type="text"
34+
style="width:300px"
35+
class="form-control" readonly value="{{ conference_url }}&inteface=1">
36+
37+
<button onclick="copyTextToClipBoard('share_button_html');" class="btn btn-default">
38+
<span class="fa fa-copy"></span> {{ 'CopyTextToClipboard' | get_lang }}
39+
</button>
40+
</div>
41+
</div>
42+
</div>
43+
</div>
44+
</div>
45+
{% else %}
46+
{{ enter_conference_links.0 }}
47+
<br />
48+
<strong>{{ 'UrlMeetingToShare'| get_plugin_lang('BBBPlugin') }}</strong>
49+
<div class="well">
50+
<div class="form-inline">
51+
<div class="form-group">
52+
<input id="share_button"
53+
type="text"
54+
style="width:600px"
55+
class="form-control" readonly value="{{ conference_url }}">
56+
<button onclick="copyTextToClipBoard('share_button');" class="btn btn-default">
57+
<span class="fa fa-copy"></span> {{ 'CopyTextToClipboard' | get_lang }}
58+
</button>
59+
</div>
60+
</div>
61+
</div>
62+
{% endif %}
663
<p>
7-
{{ enter_conference_links }}
864
<span id="users_online" class="label label-warning">
965
{{ 'XUsersOnLine'| get_plugin_lang('BBBPlugin') | format(users_online) }}
1066
</span>
@@ -17,17 +73,7 @@
1773
<p>{{ 'MaxXUsersWarning' | get_plugin_lang('BBBPlugin') | format(max_users_limit) }}</p>
1874
{% endif %}
1975
{% endif %}
20-
<div class="well">
21-
<strong>{{ 'UrlMeetingToShare'| get_plugin_lang('BBBPlugin') }}</strong>
22-
<div class="form-inline">
23-
<div class="form-group">
24-
<input id="share_button" type="text" style="width:600px" class="form-control" readonly value="{{ conference_url }}">
25-
<button onclick="copyTextToClipBoard('share_button');" class="btn btn-default">
26-
<span class="fa fa-copy"></span> {{ 'CopyTextToClipboard' | get_lang }}
27-
</button>
28-
</div>
29-
</div>
30-
</div>
76+
</div>
3177
{% elseif max_users_limit > 0 %}
3278
{% if conference_manager == true %}
3379
<p>{{ 'MaxXUsersReachedManager' | get_plugin_lang('BBBPlugin') | format(max_users_limit) }}</p>

0 commit comments

Comments
 (0)