Fix deprecation warnings
[lorea:beechat.git] / views / default / beechat / beechat.userjs.php
1 <script type="text/javascript">
2 BeeChat.Events.Messages = {
3             ConnectionStates: {
4                 CONNECTING: "<?php echo elgg_echo('beechat:connection:state:connecting'); ?>",
5                 AUTHENTICATING: "<?php echo elgg_echo('beechat:connection:state:authenticating'); ?>",
6                 FAILED: "<?php echo elgg_echo('beechat:connection:state:failed'); ?>",
7                 DISCONNECTING: "<?php echo elgg_echo('beechat:connection:state:disconnecting'); ?>",
8                 OFFLINE: "<?php echo elgg_echo('beechat:connection:state:offline'); ?>",
9                 ONLINE: "<?php echo elgg_echo('beechat:connection:state:online'); ?>"
10             }
11         }
12
13 BeeChat.UI.Resources.Strings = {
14             Availability: {
15                 AVAILABLE: "<?php echo elgg_echo('beechat:availability:available'); ?>",
16                 CHAT: "<?php echo elgg_echo('beechat:availability:available'); ?>",
17                 ONLINE: "<?php echo elgg_echo('beechat:availability:available'); ?>",
18                 DND: "<?php echo elgg_echo('beechat:availability:dnd'); ?>",
19                 AWAY: "<?php echo elgg_echo('beechat:availability:away'); ?>",
20                 XA:"<?php echo elgg_echo('beechat:availability:xa'); ?>",
21                 OFFLINE: "<?php echo elgg_echo('beechat:availability:offline'); ?>"
22             },
23
24             Contacts: {
25                 BUTTON: "<?php echo elgg_echo('beechat:contacts:button'); ?>"
26             },
27
28             ChatMessages: {
29                 SELF: "<?php echo $_SESSION['user']->name; ?>",
30                 COMPOSING: "<?php echo elgg_echo('beechat:chat:composing'); ?>"
31             },
32
33             Box: {
34                 MINIMIZE: "<?php echo elgg_echo('beechat:box:minimize'); ?>",
35                 CLOSE: "<?php echo elgg_echo('beechat:box:close'); ?>",
36                 SHOWHIDE: "<?php echo elgg_echo('beechat:box:showhide'); ?>"
37             }
38         }
39 g_user_rooms = new Array();
40 <?php
41 if (elgg_is_logged_in()) {
42         $user = elgg_get_logged_in_user_entity();
43         $chatrooms = elgg_get_entities_from_relationship(array('relationship' => 'groupchat',
44                                                                 'relationship_guid' => $user->guid,
45                                                                 'inverse_relationship' => false,
46                                                                 'limit' => 0));
47         if (!empty($chatrooms)) {
48           foreach($chatrooms as $chatroom) {
49             echo "g_user_rooms.push(['".beechat_friendly_title($chatroom->name)."@".get_plugin_setting("groupdomain", "beechat")."', '".$chatroom->guid."']);";
50           }
51         }
52 }
53 ?>
54 </script>