-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.php
151 lines (119 loc) · 6.51 KB
/
index.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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
<?php
define('AT_INCLUDE_PATH', '../../include/');
require (AT_INCLUDE_PATH.'vitals.inc.php');
require_once('constants.php');
$_custom_head .= '
<script type="text/javascript" src="'.$_base_path.'mods/chat_new/js/xmpp_client.js"></script>
<script type="text/javascript" src="'.$_base_path.'mods/chat_new/js/xmpp_console.js"></script>
<script type="text/javascript" src="'.$_base_path.'mods/chat_new/js/interface.js"></script>
<script type="text/javascript" src="'.$_base_path.'mods/chat_new/js/libraries/strophe&flXHR/strophe_sha1.js"></script>
<script type="text/javascript" src="'.$_base_path.'mods/chat_new/js/libraries/strophe&flXHR/sha1.js"></script>
<script type="text/javascript" src="'.$_base_path.'mods/chat_new/js/libraries/strophe&flXHR/strophe.muc.js"></script>
<script type="text/javascript" src="'.$_base_path.'mods/chat_new/js/libraries/strophe&flXHR/flXHR.js"></script>
<script type="text/javascript" src="'.$_base_path.'mods/chat_new/js/libraries/strophe&flXHR/strophe.flxhr.js"></script>
<script type="text/javascript" src="'.$_base_path.'mods/chat_new/js/libraries/moment.min.js"></script>';
$_custom_css = $_base_path.'mods/chat_new/module.css';
require (AT_INCLUDE_PATH.'header.inc.php');
?>
<div id="welcome" class="fl-container-flex90" style="display: none;">
Welcome to the new version of chat!<br/><br/>
In order to login you need a free account on <a href="https://www.talkr.im/">talkr.im</a> server that is used by the chat.
By logging in you agree with the fact that <a href="https://www.talkr.im/">talkr.im</a> hosts the messages.<br/><br/>
It is highly recommended that you use the registered account only within the ATutor chat client to avoid loss of data or other undesirable consequences.<br/>
Please see <a href="<?php echo $_base_path; ?>mods/chat_new/ATutor_XMPP_Chat_READ_ME_2.0.pdf" target="_blank">the helping document</a> for more details.
<table id="welcome_form">
<tr>
<td><label>Nickname:</label></td>
<td><input class="welcome_form_input" id="welcome_form_jid" maxlength="100" type="text" name="jid"/> @ talkr.im</td>
</tr>
<tr>
<td><label>Password:</label></td>
<td><input class="welcome_form_input" id="welcome_form_pass" maxlength="100" type="password" name="pass"/></td>
</tr>
<tr>
<td><input type="hidden" name="member_id" id="welcome_form_member_id" value="<?php echo $_SESSION['member_id']; ?>"/></td>
<td><input id="welcome_form_login" type="button" value="Log In" onclick="Interface.connect(null, null);"/></td>
</tr>
</table>
<div id='log'>
</div>
</div><!--end welcome-->
<div id="chat" style="display: none;">
<div id="<?php echo $_SESSION[course_id]; ?>"></div>
<div id="<?php echo $_SESSION[member_id]; ?>"></div>
<div class="fl-container-flex90 fl-left democ-linearize-sections ui-tabs ui-widget ui-widget-content ui-corner-all" id="tabs">
<ul class="ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all" role="tablist">
<li class="ui-state-default ui-corner-top ui-tabs-selected ui-state-active" role="presentation"><a href="#tab_inbox">Inbox list</a></li>
<li class="ui-state-default ui-corner-top"><a href="#tab_conversations">Conversations</a></li>
<li class="ui-state-default ui-corner-top" role="presentation"><a href="#tab_friends">Group chat</a></li>
<li class="ui-state-default ui-corner-top" role="presentation"><a href="#tab_settings">Help</a></li>
</ul>
<div id="tab_inbox">
<?php require ('includes/inbox_list.inc.php'); ?>
</div>
<div id="tab_conversations">
<?php require ('includes/conversations.inc.php'); ?>
</div>
<div id="tab_friends">
<?php require ('includes/friends.inc.php'); ?>
</div>
<div id="tab_settings">
<?php require ('includes/help.inc.php'); ?>
</div>
</div>
</div><!--end chat-->
<ul id="xmpp-logs" aria-live="polite" aria-atomic="false" style="list-style: none; list-style: none; font-size: 0.1em; color: white;">
</ul>
<div id="dialog_message" title="Connecting...">
<p>
<span class="ui-icon ui-icon-circle-check" style="float:left; margin:0 7px 50px 0;"></span>
The XMPP Chat is currently connecting to the server.
This can take several seconds, please wait.
</p>
</div>
<?php
if ($XMPP_CONSOLE_ENABLED == 1) {
$console = "<h4>Peek XMPP console</h4>
<div id='peek'>
<div id='console'></div>
<textarea id='console_input' class='disabled' disabled='disabled'></textarea>
<div id='buttonbar'>
<input id='send_button' type='button' value='Send Data' disabled='disabled' class='button' onclick='console_send();'>
<input id='disconnect_button' type='button' value='Disconnect' disabled='disabled' class='button' onclick='console_disconnect();'>
</div>
</div>";
echo $console;
}
?>
<!--hack to ensure all js was loaded-->
<?php echo '<script src="'.$_base_path.'mods/chat_new/js/xmpp_client.js"></script>'; ?>
<?php echo '<script src="'.$_base_path.'mods/chat_new/js/xmpp_console.js"></script>'; ?>
<?php echo '<script src="'.$_base_path.'mods/chat_new/js/interface.js"></script>'; ?>
<?php echo '<script src="'.$_base_path.'mods/chat_new/js/libraries/strophe&flXHR/strophe_sha1.js"></script>'; ?>
<?php echo '<script src="'.$_base_path.'mods/chat_new/js/libraries/strophe&flXHR/sha1.js"></script>'; ?>
<?php echo '<script src="'.$_base_path.'mods/chat_new/js/libraries/strophe&flXHR/strophe.muc.js"></script>'; ?>
<?php echo '<script src="'.$_base_path.'mods/chat_new/js/libraries/strophe&flXHR/flXHR.js"></script>'; ?>
<?php echo '<script src="'.$_base_path.'mods/chat_new/js/libraries/strophe&flXHR/strophe.flxhr.js"></script>'; ?>
<?php echo '<script src="'.$_base_path.'mods/chat_new/js/libraries/moment.min.js"></script>'; ?>
<script>
var ATUTOR_BASE_PATH = "<?php echo $_base_path; ?>".substring(1);
var CONNECTION_MANAGER = "<?php echo $BOSH_CONNECTION_MANAGER; ?>";
jQuery("#tabs, #subtabs").tabs();
jQuery('#subtabs').tabs({
select: function(event, ui){
var jid_id = ui.tab.hash;
Interface.on_select_subtab(jid_id.slice(6, jid_id.length));
}
});
jQuery('#tabs').tabs({
select: function(event, ui){
if (ui.tab.hash == "#tab_conversations") {
Interface.on_select_conversation_tab();
}
}
});
Interface.refresh_form();
Interface.show_div();
Interface.load_inbox();
</script>
<?php require (AT_INCLUDE_PATH.'footer.inc.php'); ?>