BMLT Root Server
index.php
Go to the documentation of this file.
1 <?php
2 define('ROOTPATH', __DIR__ . '/../..');
3 defined('BMLT_EXEC') or define('BMLT_EXEC', 1);
4 require_once('../../local_server/server_admin/c_comdef_admin_main_console.class.php');
6 $local_strings = $console_object->my_server->GetLocalStrings();
7 $user_obj = $console_object->my_server->GetCurrentUserObj();
8 if ($user_obj instanceof c_comdef_user && $user_obj->GetUserLevel() != _USER_LEVEL_DISABLED) {
9  $service_body_ids = [];
10  $service_body_set = [];
11  $user_level = intval($user_obj->GetUserLevel());
12  if ($user_level === _USER_LEVEL_OBSERVER) {
13  $service_body_set = $console_object->my_observable_service_bodies;
14  } else if ($user_level === _USER_LEVEL_SERVICE_BODY_ADMIN) {
15  $service_body_set = $console_object->my_service_bodies;
16  } else if ($user_level === _USER_LEVEL_SERVER_ADMIN) {
17  $service_body_set = $console_object->my_all_service_bodies;
18  }
19 
20  foreach ($service_body_set as $service_body_id) {
21  array_push($service_body_ids, intval($service_body_id->GetID()));
22  }
23 
24  function getBCP47TagForISO631Language($code)
25  {
26  $default = 'en-US';
27 
28  $iso630tobcp47 = [
29  'de' => 'de-DE',
30  'dk' => 'da-DK',
31  'es' => 'es-US',
32  'fa' => 'fa-IR',
33  'fr' => 'fr-CA',
34  'it' => 'it-IT',
35  'pl' => 'pl-PL',
36  'pt' => 'pt-BR',
37  'sv' => 'sv-SE'
38  ];
39 
40  return array_key_exists($code, $iso630tobcp47) ? $iso630tobcp47[$code] : $default;
41  }?>
42 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
43 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
44 <head>
45  <meta http-equiv="content-type" content="text/html; charset=utf-8" />
46  <meta name="viewport" content="width=device-width, initial-scale=1">
47  <?php
48  $url = dirname(dirname(dirname($_SERVER['PHP_SELF']))) !== "/" ? dirname(dirname(dirname($_SERVER['PHP_SELF']))) : '';
49  ?>
50  <link rel="icon" href="<?php echo sprintf("%s/local_server/server_admin/style/images/shortcut.png", $url) ?>" />
51  <link rel="stylesheet" href="<?php echo sprintf("%s/local_server/server_admin/style/styles.css", $url) ?>" />
52  <link rel="stylesheet" type="text/css" href="croutonjs/crouton.min.css" />
53  <script type="text/javascript" src="croutonjs/crouton.min.js"></script>
54  <script type="text/javascript">
55  // Full list of parameters: https://github.com/bmlt-enabled/crouton/blob/master/croutonjs/src/js/crouton-core.js#L13
56  var crouton = new Crouton({
57  root_server: "<?php echo str_replace('client_interface/html/', '', GetURLToMainServerDirectory()) ?>",
58  service_body: <?php echo json_encode($service_body_ids) ?>,
59  template_path: "croutonjs/templates",
60  theme: "<?php echo $local_strings["meeting_browser_theme"] ?>",
61  has_languages: "1",
62  has_areas: "1",
63  time_format: "H:mm (h:mma) z",
64  google_api_key: "<?php echo $local_strings["google_api_key"] ?>",
65  show_map: true,
66  language: "<?php echo getBCP47TagForISO631Language($_COOKIE["bmlt_admin_lang_pref"]) ?>",
67  meeting_data_template: "{{#isTemporarilyClosed this}}<div class='temporarilyClosed'><span class='glyphicon glyphicon-flag'></span> {{temporarilyClosed this}}</div>{{/isTemporarilyClosed}}<div class='meeting-name'>{{this.meeting_name}}</div><div class='location-text'>{{this.location_text}}</div><div class='meeting-address'>{{this.formatted_address}}</div><div class='location-information'>{{this.formatted_location_info}}</div>{{#if this.virtual_meeting_additional_info}}<div class='meeting-additional-info'>{{this.virtual_meeting_additional_info}}</div>{{/if}}{{#if this.bus_lines}}<div class='meeting-bus-lines'>{{this.bus_lines}}</div>{{/if}}{{#if this.train_lines}}<div class='meeting-train-lines'>{{this.train_lines}}</div>{{/if}}"
68  });
69  crouton.render();
70  </script>
71  </head>
72  <body>
73  <div id="bmlt-tabs">
74  <div style="text-align: center;">
75  <img style="margin: 25% 0;" alt="spinning loader" src="data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBzdGFuZGFsb25lPSJubyI/Pgo8IURPQ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4LjQ5MzksNS44NTc4NloiIHN0eWxlPSJmaWxsOnJnYig1MCw1MCw1MCk7Ii8+CiAgICAgICAgPC9nPgogICAgPC9nPgo8L3N2Zz4K" />
76  </div>
77  </div>
78  </body>
79  <?php
80 }
81 ?>
82 </html>
if($handler instanceof c_comdef_admin_ajax_handler)
$local_strings
Definition: index.php:6
const BMLT_EXEC
Definition: index.php:21
This class handles BMLT users. One instance is created for each user on the server.
$console_object
Definition: index.php:5
const _USER_LEVEL_SERVICE_BODY_ADMIN
const _USER_LEVEL_OBSERVER
var s
const _USER_LEVEL_DISABLED
const _USER_LEVEL_SERVER_ADMIN
defined('BMLT_EXEC') or define('BMLT_EXEC'
Definition: index.php:3
$user_obj
Definition: index.php:7
Controls display of the main BMLT administration console.