-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathjoin_collab_session.php
77 lines (67 loc) · 3.23 KB
/
join_collab_session.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
<?php
// This file is part of the Moodle block "EJSApp Collab Session"
//
// EJSApp Collab Session is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// EJSApp Collab Session is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// The GNU General Public License is available on <http://www.gnu.org/licenses/>
//
// EJSApp Collab Session has been developed by:
// - Luis de la Torre (1): [email protected]
// - Ruben Heradio (1): [email protected]
// - Carlos Jara (2): [email protected]
//
// (1): Computer Science and Automatic Control, Spanish Open University (UNED),
// Madrid, Spain
// (2): Physics, Systems Engineering and Signal Theory Department, University
// of Alicante, Spain
/**
* Page menu for users to accept an invitation to a collaborative session when they have been invited to one at least.
*
* @package block
* @subpackage ejsapp_collab_session
* @copyright 2012 Luis de la Torre, Ruben Heradio and Carlos Jara
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
require_once('../../config.php');
require_login();
global $CFG, $DB, $OUTPUT;
require_once('manage_collab_db.php');
$page_caller = get_string('navBarNonMasterUser', 'block_ejsapp_collab_session');
require('init_page.php');
if (is_the_user_participating_in_any_session()) {
echo $OUTPUT->heading(get_string('cantJoinSessionErr1', 'block_ejsapp_collab_session'));
} elseif ( !has_the_user_been_invited_to_any_session() ) {
echo $OUTPUT->heading(get_string('cantJoinSessionErr2', 'block_ejsapp_collab_session'));
} else {
echo $OUTPUT->heading(get_string('selectInvitation', 'block_ejsapp_collab_session'));
$my_invitations = get_sessions_where_i_am_invited();
$view_url = $CFG->wwwroot."/mod/ejsapp/view.php";
echo html_writer::start_tag('form', array('action'=>$view_url, 'method'=>'get'));
$i = 1;
foreach ($my_invitations as $master_user=>$ejsapp) {
$ejsapp_name = get_ejsapp_name($master_user);
$session = get_collaborative_session_id($master_user);
if ($i == 1) {
echo html_writer::nonempty_tag('input checked', get_user_name($master_user) . get_string('invitationMsg1', 'block_ejsapp_collab_session')
. "$ejsapp_name", array('type'=>'radio', 'name'=>'colsession', 'value'=>$session));
echo html_writer::tag('br', '');
} else {
echo html_writer::nonempty_tag('input', get_user_name($master_user) . get_string('invitationMsg1', 'block_ejsapp_collab_session')
. "$ejsapp_name", array('type'=>'radio', 'name'=>'colsession', 'value'=>$session));
echo html_writer::tag('br', '');
}
$i++;
}
echo html_writer::tag('br', '');
echo html_writer::empty_tag('input', array('type'=>'submit', 'value'=> get_string('acceptInvitation', 'block_ejsapp_collab_session')));
echo html_writer::end_tag('form');
} // if (is_the_user_participating_in_any_session())
echo $OUTPUT->footer();