BMLT Root Server
c_comdef_admin_main_console.class.php
Go to the documentation of this file.
1 <?php
2 /*
3  This file is part of the Basic Meeting List Toolbox (BMLT).
4 
5  Find out more at: https://bmlt.app
6 
7  BMLT is free software: you can redistribute it and/or modify
8  it under the terms of the MIT License.
9 
10  BMLT is distributed in the hope that it will be useful,
11  but WITHOUT ANY WARRANTY; without even the implied warranty of
12  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  MIT License for more details.
14 
15  You should have received a copy of the MIT License along with this code.
16  If not, see <https://opensource.org/licenses/MIT>.
17 */
18 defined('BMLT_EXEC') or die('Cannot Execute Directly'); // Makes sure that this file is in the correct context.
19 require_once(dirname(__FILE__).'/../../server/c_comdef_server.class.php');
20 require_once(dirname(__FILE__).'/../../server/shared/Array2Json.php');
21 
22 // #define ( '__NAWS_IMPORT__', 1 ) /* Uncomment to enable the NAWS import functionality. */
23 
24 /************************************************************************************************************//**
25  \class c_comdef_admin_main_console
26  \brief Controls display of the main BMLT administration console.
27 ****************************************************************************************************************/
28 // phpcs:disable PSR1.Classes.ClassDeclaration.MissingNamespace
29 // phpcs:disable Squiz.Classes.ValidClassName.NotCamelCaps
31 // phpcs:enable PSR1.Classes.ClassDeclaration.MissingNamespace
32 // phpcs:enable Squiz.Classes.ValidClassName.NotCamelCaps
33 {
34  public $my_localized_strings; ///< This will contain the localized strings and whatnot for display.
35  public $my_server; ///< This hold the server object.
36  public $my_user; ///< This holds the instance of the logged-in user.
37  public $my_ajax_uri; ///< This will be the URI for AJAX calls.
38  public $my_http_vars; ///< Contains the HTTP vars sent in.
39  public $my_service_bodies; ///< This will be an array that contains all the Service bodies this user can edit.
40  public $my_users; ///< This will be an array of all the user objects.
41  public $my_formats; ///< The format objects that are available for meetings.
42  public $my_data_field_templates; ///< This holds the keys for all the possible data fields for this server.
43  public $my_editable_service_bodies; ///< This will contain all the Service bodies that we can actually directly edit.
44  public $my_all_service_bodies; ///< This contains all Service bodies, cleaned for orphans.
45  public $my_observable_service_bodies; ///< This contains all observable service bodies.
46  public $my_lang_ids; ///< Contains the enumerations for all the server langs.
47 
48  /********************************************************************************************************//**
49  \brief
50  ************************************************************************************************************/
51  public function __construct( $in_http_vars ///< The HTTP transaction parameters
52  )
53  {
54  $this->my_http_vars = $in_http_vars;
55  $this->my_localized_strings = c_comdef_server::GetLocalStrings();
56  $this->my_server = c_comdef_server::MakeServer();
57  $this->my_user = $this->my_server->GetCurrentUserObj();
58 
59  // We check this every chance that we get.
60  if (!$this->my_user || ($this->my_user->GetUserLevel() == _USER_LEVEL_DISABLED)) {
61  die('NOT AUTHORIZED');
62  }
63 
64  $this->my_users = array_values($this->my_server->GetServerUsersObj()->GetUsersArray());
65  usort($this->my_users, array("c_comdef_admin_main_console", "compare_names"));
67  $this->my_ajax_uri = $url_path.'?bmlt_ajax_callback=1';
68 
69  $this->my_formats = array();
70  $langs = $this->my_server->GetFormatLangs();
71  $this->my_lang_ids = array_keys($langs);
72  $server_format_array = $this->my_server->GetFormatsArray();
73  $format_ids = array();
74  usort($server_format_array[$this->my_server->GetLocalLang()], function ($a, $b) {
75  return strnatcasecmp($a->GetKey(), $b->GetKey());
76  });
77  // We will build an array of formats in the structure we'll need for our editor. We start by gathering all of the shared IDs.
78  foreach ($langs as $lang_key => $lang_name) {
79  if (isset($server_format_array[$lang_key])) {
80  $the_format_object_array = $server_format_array[$lang_key];
81  foreach ($the_format_object_array as $format) {
82  $format_ids['format_'.$format->GetSharedID()] = $format->GetSharedID();
83  }
84  }
85  }
86 
87  // OK, we have a sorted array of unique format IDs. Now, we assign each one an array of format data per language.
88 
89  foreach ($format_ids as $id) {
90  $single_format = array();
91  // Walk through the server languages...
92  foreach ($langs as $lang_key => $lang_name) {
93  // Then through all the formats with data in each language...
94  if (isset($server_format_array[$lang_key])) {
95  $the_format_object_array = $server_format_array[$lang_key];
96  foreach ($the_format_object_array as $format) {
97  // If the format is available with data in this language, we add it to our ID.
98  if ($format->GetSharedID() == $id) {
99  $single_format[$lang_key]['shared_id'] = $id;
100  $single_format[$lang_key]['lang_key'] = $lang_key;
101  $single_format[$lang_key]['lang_name'] = $lang_name;
102  $single_format[$lang_key]['key'] = $format->GetKey();
103  $single_format[$lang_key]['name'] = $format->GetLocalName();
104  $single_format[$lang_key]['description'] = $format->GetLocalDescription();
105  $single_format[$lang_key]['type'] = $format->GetFormatType();
106  $single_format[$lang_key]['worldid_mixed'] = $format->GetWorldID();
107  }
108  }
109  }
110  }
111 
112  $this->my_formats[] = array ( 'id' => $id, 'formats' => $single_format );
113  }
114 
115  $service_bodies = $this->my_server->GetServiceBodyArray();
116  usort($service_bodies, array("c_comdef_admin_main_console", "compare_names"));
117  $this->my_service_bodies = array();
118  $this->my_editable_service_bodies = array();
119  $this->my_all_service_bodies = array();
120  $this->my_observable_service_bodies = array();
121 
122  for ($c = 0; $c < count($service_bodies); $c++) {
123  $service_body = $service_bodies[$c];
124  if ($service_body->UserCanEditMeetings()) {
125  array_push($this->my_service_bodies, $service_body);
126  }
127 
128  if ($service_body->UserCanEdit()) {
129  array_push($this->my_editable_service_bodies, $service_body);
130  }
131 
132  if ($service_body->UserCanObserve()) {
133  array_push($this->my_observable_service_bodies, $service_body);
134  }
135 
136  array_push($this->my_all_service_bodies, $service_body);
137  }
138 
139  // We get all the available data fields, and create a local data member for their keys.
140  $this->my_data_field_templates = c_comdef_meeting::GetDataTableTemplate();
142 
143  // We merge the two tables (data and longdata).
144  if (is_array($this->my_data_field_templates) && count($this->my_data_field_templates) && is_array($longdata_obj) && count($longdata_obj)) {
145  $this->my_data_field_templates = array_merge($this->my_data_field_templates, $longdata_obj);
146  }
147 
148  // Sort them by their field keys, so we have a consistent order.
149  $flags = ( defined('SORT_NATURAL') && defined('SORT_FLAG_CASE') ) ? intval(SORT_NATURAL | SORT_FLAG_CASE) : null;
150  ksort($this->my_data_field_templates, $flags);
151  }
152 
153  /********************************************************************************************************//**
154  \brief Returns the HTML for the main admin console.
155  \returns HTML code.
156  ************************************************************************************************************/
157  // phpcs:disable PSR1.Methods.CamelCapsMethodName.NotCamelCaps
158  public function return_main_console_html()
159  {
160  // phpcs:enable PSR1.Methods.CamelCapsMethodName.NotCamelCaps
161  $ret = '<div id="bmlt_admin_main_console" class="bmlt_admin_main_console_wrapper_div">'.(defined('__DEBUG_MODE__') ? "\n" : '');
162  // We actually include the JS directly into the HTML. This gives us a lot more flexibility as to how we deploy and gatekeep this file.
163  $ret .= '<script type="text/javascript" src="https://maps.googleapis.com/maps/api/js?key='.$this->my_localized_strings['google_api_key'].'&libraries=geometry"></script>';
164  $ret .= '<script type="text/javascript">';
165  $ret .= 'var my_localized_strings = '.json_encode($this->my_localized_strings).';';
166  $ret .= 'var g_ajax_callback_uri = \''.self::js_html($this->my_ajax_uri).'\';'.(defined('__DEBUG_MODE__') ? "\n" : '');
167  $ret .= 'var g_current_user_id = \''.self::js_html($this->my_user->GetID()).'\';'.(defined('__DEBUG_MODE__') ? "\n" : '');
168  $ret .= 'var g_is_server_admin = '. ($this->my_user->GetUserLevel() == _USER_LEVEL_SERVER_ADMIN ? 'true' : 'false' ).';'.(defined('__DEBUG_MODE__') ? "\n" : '');
169  $ret .= 'var g_formats_array = '.array2json($this->my_formats).';'.(defined('__DEBUG_MODE__') ? "\n" : '');
170  $ret .= 'var g_langs = ["'.implode('","', $this->my_lang_ids).'"];'.(defined('__DEBUG_MODE__') ? "\n" : '');
171  $ret .= 'var g_lang_names = '.array2json($this->my_server->GetFormatLangs()).';'.(defined('__DEBUG_MODE__') ? "\n" : '');
172  $ret .= 'var g_AJAX_Auth_Failure = \''.self::js_html($this->my_localized_strings['comdef_server_admin_strings']['AJAX_Auth_Failure']).'\';'.(defined('__DEBUG_MODE__') ? "\n" : '');
173  $ret .= 'var g_check_all_text = \''.self::js_html($this->my_localized_strings['comdef_server_admin_strings']['check_all']).'\';'.(defined('__DEBUG_MODE__') ? "\n" : '');
174  $ret .= 'var g_uncheck_all_text = \''.self::js_html($this->my_localized_strings['comdef_server_admin_strings']['uncheck_all']).'\';'.(defined('__DEBUG_MODE__') ? "\n" : '');
175  $ret .= 'var g_auto_geocoding_enabled = '.self::js_html($this->my_localized_strings['auto_geocoding_enabled'] ? 'true' : 'false').';'.(defined('__DEBUG_MODE__') ? "\n" : '');
176  $ret .= 'var g_county_auto_geocoding_enabled = '.self::js_html($this->my_localized_strings['county_auto_geocoding_enabled'] ? 'true' : 'false').';'.(defined('__DEBUG_MODE__') ? "\n" : '');
177  $ret .= 'var g_zip_auto_geocoding_enabled = '.self::js_html($this->my_localized_strings['zip_auto_geocoding_enabled'] ? 'true' : 'false').';'.(defined('__DEBUG_MODE__') ? "\n" : '');
178  $ret .= 'var g_maps_api_key_warning = \''.self::js_html($this->my_localized_strings['comdef_server_admin_strings']['Maps_API_Key_Warning']).'\';'.(defined('__DEBUG_MODE__') ? "\n" : '');
179  $ret .= 'var g_maps_api_key_not_set = \''.self::js_html($this->my_localized_strings['comdef_server_admin_strings']['Maps_API_Key_Not_Set']).'\';'.(defined('__DEBUG_MODE__') ? "\n" : '');
180  $ret .= 'var g_meeting_time_zones_enabled = ' . ($this->my_localized_strings['meeting_time_zones_enabled'] ? 'true' : 'false') . ';'.(defined('__DEBUG_MODE__') ? "\n" : '');
181  $ret .= 'var g_service_bodies_array = [';
182  for ($c = 0; $c < count($this->my_service_bodies); $c++) {
183  $service_body = $this->my_service_bodies[$c];
184  $ret .= '[';
185  /* ID:0 */ $ret .= $service_body->GetID().',';
186  /* Owner ID:1 */ $ret .= $service_body->GetOwnerID().',';
187  /* Name:2 */ $ret .= '\''.self::js_html($service_body->GetLocalName()).'\',';
188  /* Description:3 */ $ret .= '\''.self::js_html($service_body->GetLocalDescription()).'\',';
189  /* Main User ID:4 */ $ret .= $service_body->GetPrincipalUserID().',';
190  /* Editor IDs:5 */ $ret .= '\''.implode(',', $service_body->GetEditors()).'\',';
191  /* Contact Email:6 */ $ret .= '\''.self::js_html($service_body->GetContactEmail()).'\',';
192  /* URI:7 */ $ret .= '\''.self::js_html($service_body->GetURI()).'\',';
193  /* Helpline:8 */ $ret .= '\''.self::js_html($service_body->GetHelpline()).'\',';
194  /* SB Type:9 */ $ret .= '\''.$service_body->GetSBType().'\',';
195 /* User Can Edit:10 */ $ret .= ($service_body->UserCanEdit() ? 'true' : 'false').',';
196 /* Edit Meetings:11 */ $ret .= ($service_body->UserCanEditMeetings() ? 'true' : 'false').',';
197  /* World ID:12 */ $ret .= '\''.self::js_html($service_body->GetWorldID()).'\'';
198  $ret .=']';
199  if ($c < (count($this->my_service_bodies) - 1)) {
200  $ret .= ',';
201  }
202  }
203  $ret .= '];'.(defined('__DEBUG_MODE__') ? "\n" : '');
204  $ret .= 'var g_editable_service_bodies_array = [';
205  for ($c = 0; $c < count($this->my_editable_service_bodies); $c++) {
206  $service_body = $this->my_editable_service_bodies[$c];
207  $ret .= '[';
208  /* ID:0 */ $ret .= $service_body->GetID().',';
209  /* Owner ID:1 */ $ret .= $service_body->GetOwnerID().',';
210  /* Name:2 */ $ret .= '\''.self::js_html($service_body->GetLocalName()).'\',';
211  /* Description:3 */ $ret .= '\''.self::js_html($service_body->GetLocalDescription()).'\',';
212  /* Main User ID:4 */ $ret .= $service_body->GetPrincipalUserID().',';
213  /* Editor IDs:5 */ $ret .= '\''.implode(',', $service_body->GetEditors()).'\',';
214  /* Contact Email:6 */ $ret .= '\''.self::js_html($service_body->GetContactEmail()).'\',';
215  /* URI:7 */ $ret .= '\''.self::js_html($service_body->GetURI()).'\',';
216  /* Helpline:8 */ $ret .= '\''.self::js_html($service_body->GetHelpline()).'\',';
217  /* SB Type:9 */ $ret .= '\''.$service_body->GetSBType().'\',';
218 /* User Can Edit:10 */ $ret .= 'true,';
219 /* Edit Meetings:11 */ $ret .= 'true,';
220  /* World ID:12 */ $ret .= '\''.self::js_html($service_body->GetWorldID()).'\'';
221  $ret .=']';
222  if ($c < (count($this->my_service_bodies) - 1)) {
223  $ret .= ',';
224  }
225  }
226  $ret .= '];'.(defined('__DEBUG_MODE__') ? "\n" : '');
227  $ret .= 'var g_users = [';
228  for ($c = 0; $c < count($this->my_users); $c++) {
229  $user = $this->my_users[$c];
230  $ret .= '[';
231  /* ID:0 */ $ret .= $user->GetID().',';
232  /* Login:1 */ $ret .= '\''.self::js_html(( ($this->my_user->GetUserLevel() == _USER_LEVEL_SERVICE_BODY_ADMIN) || ($this->my_user->GetUserLevel() == _USER_LEVEL_SERVER_ADMIN) ) ? $user->GetLogin() : '').'\',';
233  /* Name:2 */ $ret .= '\''.self::js_html($user->GetLocalName()).'\',';
234  /* Description:3 */ $ret .= '\''.self::js_html($user->GetLocalDescription()).'\',';
235  /* eMail:4 */ $ret .= '\''.self::js_html(( ($this->my_user->GetUserLevel() == _USER_LEVEL_SERVICE_BODY_ADMIN) || ($this->my_user->GetUserLevel() == _USER_LEVEL_SERVER_ADMIN) || ($user->GetID() == $this->my_user->GetID()) ) ? $user->GetEmailAddress() : '').'\',';
236  /* User Level:5 */ $ret .= $user->GetUserLevel().',';
237  /* Password:6 */ $ret .= '\'\','; // We do not give a password, but one can be sent in to change the current one, so we have a placeholder.
238  /* User Owner:7 */ $ret .= self::js_html($user->GetOwnerID());
239  $ret .=']';
240  if ($c < (count($this->my_users) - 1)) {
241  $ret .= ',';
242  }
243  }
244 
245  $ret .= '];'.(defined('__DEBUG_MODE__') ? "\n" : '');
246  $ret .= 'var g_user_levels = [';
247  $ret .= '[1,\''.self::js_html($this->my_localized_strings['comdef_server_admin_strings']['user_editor_account_type_1']).'\'],';
248  $ret .= '[2,\''.self::js_html($this->my_localized_strings['comdef_server_admin_strings']['user_editor_account_type_2']).'\'],';
249  $ret .= '[3,\''.self::js_html($this->my_localized_strings['comdef_server_admin_strings']['user_editor_account_type_3']).'\'],';
250  $ret .= '[4,\''.self::js_html($this->my_localized_strings['comdef_server_admin_strings']['user_editor_account_type_4']).'\'],';
251  $ret .= '[5,\''.self::js_html($this->my_localized_strings['comdef_server_admin_strings']['user_editor_account_type_5']).'\']';
252  $ret .= '];'.(defined('__DEBUG_MODE__') ? "\n" : '');
253  $ret .= 'var g_weekday_name_array = [';
254  for ($c = 1; $c < 8; $c++) {
255  $ret .= '\''.self::js_html($this->my_localized_strings['comdef_server_admin_strings']['meeting_search_weekdays_names'][$c]).'\'';
256  if ($c < 8) {
257  $ret .= ',';
258  }
259  }
260  $ret .= '];'.(defined('__DEBUG_MODE__') ? "\n" : '');
261  $ret .= 'var g_format_object_array = [';
262  $first = true;
263  foreach ($this->my_formats as $formats) {
264  if (isset($formats['formats'][$this->my_server->GetLocalLang()])) {
265  $format = $formats['formats'][$this->my_server->GetLocalLang()];
266  if ($format) {
267  if (!$first) {
268  $ret .= ',';
269  } else {
270  $first = false;
271  }
272 
273  $ret .= '{';
274  $ret .= '"id":'.$format['shared_id'];
275  $ret .= ',"key":"'.str_replace('"', '\"', str_replace("\n", ' ', $format['key'])).'"';
276  $ret .= ',"name":"'.str_replace('"', '\"', str_replace("\n", ' ', $format['name'])).'"';
277  $ret .= ',"description":"'.str_replace('"', '\"', str_replace("\n", ' ', $format['description'])).'"';
278  $ret .= ',"worldid_mixed":"'.str_replace('"', '\"', str_replace("\n", ' ', $format['worldid_mixed'])).'"';
279  $ret .= '}'.(defined('__DEBUG_MODE__') ? "\n" : '');
280  }
281  }
282  }
283  $ret .= '];'.(defined('__DEBUG_MODE__') ? "\n" : '');
284  $ret .= 'var g_other_field_ids = [';
285  $first = true;
286  foreach ($this->my_data_field_templates as $data_field) {
287  $key = $data_field['key'];
288  switch ($key) {
289  case 'id_bigint': // All of these are ignored, as they are taken care of in other option sheets.
290  case 'worldid_mixed':
291  case 'shared_group_id_bigint':
292  case 'service_body_bigint':
293  case 'weekday_tinyint':
294  case 'start_time':
295  case 'formats':
296  case 'lang_enum':
297  case 'longitude':
298  case 'latitude':
299  case 'email_contact':
300  case 'meeting_name':
301  case 'location_text':
302  case 'location_info':
303  case 'location_street':
304  case 'location_neighborhood':
305  case 'location_city_subsection':
306  case 'location_municipality':
307  case 'location_sub_province':
308  case 'location_province':
309  case 'location_postal_code_1':
310  case 'location_nation':
311  break;
312 
313  default: // We display these ones.
314  if (!$first) {
315  $ret .= ',';
316  } else {
317  $first = false;
318  }
319  $ret .= "'".self::js_html($key)."'";
320  break;
321  }
322  }
323  $ret .= '];'.(defined('__DEBUG_MODE__') ? "\n" : '');
324  $ret .= 'var g_logout_uri = \''.self::js_html($_SERVER['PHP_SELF'].'?admin_action=logout').'\';'.(defined('__DEBUG_MODE__') ? "\n" : '');
325  $ret .= 'var g_meeting_closure_confirm_text = \''.self::js_html($this->my_localized_strings['comdef_server_admin_strings']['meeting_editor_screen_cancel_confirm']).'\';'.(defined('__DEBUG_MODE__') ? "\n" : '');
326  $ret .= 'var g_default_longitude = '.floatval($this->my_localized_strings['search_spec_map_center']['longitude']).';'.(defined('__DEBUG_MODE__') ? "\n" : '');
327  $ret .= 'var g_default_latitude = '.floatval($this->my_localized_strings['search_spec_map_center']['latitude']).';'.(defined('__DEBUG_MODE__') ? "\n" : '');
328  $ret .= 'var g_default_zoom = '.floatval($this->my_localized_strings['comdef_server_admin_strings']['meeting_editor_default_zoom']).';'.(defined('__DEBUG_MODE__') ? "\n" : '');
329  $ret .= 'var g_meeting_lookup_failed = \''.self::js_html($this->my_localized_strings['comdef_server_admin_strings']['meeting_lookup_failed']).'\';'.(defined('__DEBUG_MODE__') ? "\n" : '');
330  $ret .= 'var g_region_bias = \''.self::js_html($this->my_localized_strings['region_bias']).'\';'.(defined('__DEBUG_MODE__') ? "\n" : '');
331  $ret .= 'var g_style_dir = \''.self::js_html((((dirname($_SERVER['PHP_SELF']) != '/') && (dirname($_SERVER['PHP_SELF']) != '\\')) ? dirname($_SERVER['PHP_SELF']) : '').'/local_server/server_admin/style').'\';'.(defined('__DEBUG_MODE__') ? "\n" : '');
332  $ret .= 'var g_Create_new_meeting_button_name = \''.self::js_html($this->my_localized_strings['comdef_server_admin_strings']['meeting_create_button_name']).'\';'.(defined('__DEBUG_MODE__') ? "\n" : '');
333  $ret .= 'var g_Save_meeting_button_name = \''.self::js_html($this->my_localized_strings['comdef_server_admin_strings']['meeting_save_buttonName']).'\';'.(defined('__DEBUG_MODE__') ? "\n" : '');
334  $ret .= 'var g_default_meeting_published = \''.self::js_html($this->my_localized_strings['default_meeting_published']).'\';'.(defined('__DEBUG_MODE__') ? "\n" : '');
335  $ret .= 'var g_default_meeting_weekday = '.intVal($this->my_localized_strings['comdef_server_admin_strings']['meeting_editor_default_weekday']).';'.(defined('__DEBUG_MODE__') ? "\n" : '');
336  $ret .= 'var g_default_meeting_start_time = \''.self::js_html($this->my_localized_strings['comdef_server_admin_strings']['meeting_editor_default_start_time']).'\';'.(defined('__DEBUG_MODE__') ? "\n" : '');
337  $ret .= 'var g_default_meeting_duration = \''.self::js_html($this->my_localized_strings['default_duration_time']).'\';'.(defined('__DEBUG_MODE__') ? "\n" : '');
338  $ret .= 'var g_default_minute_interval = '.self::js_html($this->my_localized_strings['default_minute_interval']).';'.(defined('__DEBUG_MODE__') ? "\n" : '');
339  $ret .= 'var g_no_search_results_text = \''.self::js_html($this->my_localized_strings['comdef_server_admin_strings']['meeting_search_no_results_text']).'\';'.(defined('__DEBUG_MODE__') ? "\n" : '');
340  $ret .= 'var g_new_meeting_header_text = \''.self::js_html($this->my_localized_strings['comdef_server_admin_strings']['meeting_editor_create_new_text']).'\';'.(defined('__DEBUG_MODE__') ? "\n" : '');
341  $ret .= 'var g_meeting_lookup_failed_not_enough_address_info = \''.self::js_html($this->my_localized_strings['comdef_server_admin_strings']['meeting_lookup_failed_not_enough_address_info']).'\';'.(defined('__DEBUG_MODE__') ? "\n" : '');
342  $ret .= 'var g_meeting_editor_result_count_format = \''.self::js_html($this->my_localized_strings['comdef_server_admin_strings']['meeting_editor_result_count_format']).'\';'.(defined('__DEBUG_MODE__') ? "\n" : '');
343  $ret .= 'var g_meeting_editor_screen_delete_button_confirm = \''.self::js_html($this->my_localized_strings['comdef_server_admin_strings']['meeting_editor_screen_delete_button_confirm']).'\';'.(defined('__DEBUG_MODE__') ? "\n" : '');
344  $ret .= 'var g_meeting_editor_already_editing_confirm = \''.self::js_html($this->my_localized_strings['comdef_server_admin_strings']['meeting_editor_already_editing_confirm']).'\';'.(defined('__DEBUG_MODE__') ? "\n" : '');
345  $ret .= 'var g_history_header_format = \''.str_replace('>', '&gt;', str_replace('<', '&lt;', $this->my_localized_strings['comdef_server_admin_strings']['history_header_format'])).'\';'.(defined('__DEBUG_MODE__') ? "\n" : '');
346  $ret .= 'var g_history_no_history_available_text = \''.str_replace('>', '&gt;', str_replace('<', '&lt;', $this->my_localized_strings['comdef_server_admin_strings']['history_no_history_available_text'])).'\';'.(defined('__DEBUG_MODE__') ? "\n" : '');
347  $ret .= 'var g_service_body_name_default_prompt_text = \''.self::js_html($this->my_localized_strings['comdef_server_admin_strings']['service_body_name_default_prompt_text']).'\';'.(defined('__DEBUG_MODE__') ? "\n" : '');
348  $ret .= 'var g_service_body_description_default_prompt_text = \''.self::js_html($this->my_localized_strings['comdef_server_admin_strings']['service_body_description_default_prompt_text']).'\';'.(defined('__DEBUG_MODE__') ? "\n" : '');
349  $ret .= 'var g_service_body_email_default_prompt_text = \''.self::js_html($this->my_localized_strings['comdef_server_admin_strings']['service_body_email_default_prompt_text']).'\';'.(defined('__DEBUG_MODE__') ? "\n" : '');
350  $ret .= 'var g_service_body_uri_default_prompt_text = \''.self::js_html($this->my_localized_strings['comdef_server_admin_strings']['service_body_uri_default_prompt_text']).'\';'.(defined('__DEBUG_MODE__') ? "\n" : '');
351  $ret .= 'var g_service_body_world_cc_default_prompt_text = \''.self::js_html($this->my_localized_strings['comdef_server_admin_strings']['service_body_editor_screen_world_cc_prompt']).'\';'.(defined('__DEBUG_MODE__') ? "\n" : '');
352  $ret .= 'var g_service_body_helpline_default_prompt_text = \''.self::js_html($this->my_localized_strings['comdef_server_admin_strings']['service_body_editor_screen_helpline_prompt']).'\';'.(defined('__DEBUG_MODE__') ? "\n" : '');
353  $ret .= 'var g_service_body_dirty_confirm_text = \''.self::js_html($this->my_localized_strings['comdef_server_admin_strings']['service_body_dirty_confirm_text']).'\';'.(defined('__DEBUG_MODE__') ? "\n" : '');
354  $ret .= 'var g_service_body_delete_button_confirm = \''.self::js_html($this->my_localized_strings['comdef_server_admin_strings']['service_body_delete_button_confirm']).'\';'.(defined('__DEBUG_MODE__') ? "\n" : '');
355  $ret .= 'var g_service_body_delete_button_confirm_perm = \''.self::js_html($this->my_localized_strings['comdef_server_admin_strings']['service_body_delete_button_confirm_perm']).'\';'.(defined('__DEBUG_MODE__') ? "\n" : '');
356  $ret .= 'var g_service_body_save_button = \''.self::js_html($this->my_localized_strings['comdef_server_admin_strings']['service_body_save_button']).'\';'.(defined('__DEBUG_MODE__') ? "\n" : '');
357  $ret .= 'var g_service_body_create_button = \''.self::js_html($this->my_localized_strings['comdef_server_admin_strings']['service_body_create_button']).'\';'.(defined('__DEBUG_MODE__') ? "\n" : '');
358  $ret .= 'var g_user_save_button = \''.self::js_html($this->my_localized_strings['comdef_server_admin_strings']['user_save_button']).'\';'.(defined('__DEBUG_MODE__') ? "\n" : '');
359  $ret .= 'var g_user_create_button = \''.self::js_html($this->my_localized_strings['comdef_server_admin_strings']['user_create_button']).'\';'.(defined('__DEBUG_MODE__') ? "\n" : '');
360  $ret .= 'var g_user_password_default_text = \''.self::js_html($this->my_localized_strings['comdef_server_admin_strings']['user_password_default_text']).'\';'.(defined('__DEBUG_MODE__') ? "\n" : '');
361  $ret .= 'var g_user_new_password_default_text = \''.self::js_html($this->my_localized_strings['comdef_server_admin_strings']['user_new_password_default_text']).'\';'.(defined('__DEBUG_MODE__') ? "\n" : '');
362  $ret .= 'var g_user_password_label = \''.self::js_html($this->my_localized_strings['comdef_server_admin_strings']['user_password_label']).'\';'.(defined('__DEBUG_MODE__') ? "\n" : '');
363  $ret .= 'var g_user_new_password_label = \''.self::js_html($this->my_localized_strings['comdef_server_admin_strings']['user_new_password_label']).'\';'.(defined('__DEBUG_MODE__') ? "\n" : '');
364  $ret .= 'var g_user_dirty_confirm_text = \''.self::js_html($this->my_localized_strings['comdef_server_admin_strings']['user_dirty_confirm_text']).'\';'.(defined('__DEBUG_MODE__') ? "\n" : '');
365  $ret .= 'var g_user_delete_button_confirm = \''.self::js_html($this->my_localized_strings['comdef_server_admin_strings']['user_delete_button_confirm']).'\';'.(defined('__DEBUG_MODE__') ? "\n" : '');
366  $ret .= 'var g_user_delete_button_confirm_perm = \''.self::js_html($this->my_localized_strings['comdef_server_admin_strings']['user_delete_button_confirm_perm']).'\';'.(defined('__DEBUG_MODE__') ? "\n" : '');
367  $ret .= 'var g_user_create_password_alert_text = \''.self::js_html($this->my_localized_strings['comdef_server_admin_strings']['user_create_password_alert_text']).'\';'.(defined('__DEBUG_MODE__') ? "\n" : '');
368  $ret .= 'var g_format_editor_name_default_text = \''.self::js_html($this->my_localized_strings['comdef_server_admin_strings']['format_editor_name_default_text']).'\';'.(defined('__DEBUG_MODE__') ? "\n" : '');
369  $ret .= 'var g_format_editor_description_default_text = \''.self::js_html($this->my_localized_strings['comdef_server_admin_strings']['format_editor_description_default_text']).'\';'.(defined('__DEBUG_MODE__') ? "\n" : '');
370  $ret .= 'var g_format_editor_create_format_button_text = \''.self::js_html($this->my_localized_strings['comdef_server_admin_strings']['format_editor_create_format_button_text']).'\';'.(defined('__DEBUG_MODE__') ? "\n" : '');
371  $ret .= 'var g_format_editor_cancel_create_format_button_text = \''.self::js_html($this->my_localized_strings['comdef_server_admin_strings']['format_editor_cancel_create_format_button_text']).'\';'.(defined('__DEBUG_MODE__') ? "\n" : '');
372  $ret .= 'var g_format_editor_create_this_format_button_text = \''.self::js_html($this->my_localized_strings['comdef_server_admin_strings']['format_editor_create_this_format_button_text']).'\';'.(defined('__DEBUG_MODE__') ? "\n" : '');
373  $ret .= 'var g_format_editor_change_format_button_text = \''.self::js_html($this->my_localized_strings['comdef_server_admin_strings']['format_editor_change_format_button_text']).'\';'.(defined('__DEBUG_MODE__') ? "\n" : '');
374  $ret .= 'var g_format_editor_delete_format_button_text = \''.self::js_html($this->my_localized_strings['comdef_server_admin_strings']['format_editor_delete_format_button_text']).'\';'.(defined('__DEBUG_MODE__') ? "\n" : '');
375  $ret .= 'var g_format_editor_reset_format_button_text = \''.self::js_html($this->my_localized_strings['comdef_server_admin_strings']['format_editor_reset_format_button_text']).'\';'.(defined('__DEBUG_MODE__') ? "\n" : '');
376  $ret .= 'var g_need_refresh_message_alert_text = \''.self::js_html($this->my_localized_strings['comdef_server_admin_strings']['need_refresh_message_alert_text']).'\';'.(defined('__DEBUG_MODE__') ? "\n" : '');
377  $ret .= 'var g_format_editor_delete_button_confirm = \''.self::js_html($this->my_localized_strings['comdef_server_admin_strings']['format_editor_delete_button_confirm']).'\';'.(defined('__DEBUG_MODE__') ? "\n" : '');
378  $ret .= 'var g_format_editor_delete_button_confirm_perm = \''.self::js_html($this->my_localized_strings['comdef_server_admin_strings']['format_editor_delete_button_confirm_perm']).'\';'.(defined('__DEBUG_MODE__') ? "\n" : '');
379  $ret .= 'var g_throbber_image_loc = \'local_server/server_admin/style/images/ajax-throbber-white.gif\';'.(defined('__DEBUG_MODE__') ? "\n" : '');
380  $ret .= 'var g_min_pw_len = '.$this->my_localized_strings['min_pw_len'].';'.(defined('__DEBUG_MODE__') ? "\n" : '');
381  $ret .= 'var g_google_api_key = \''.self::js_html($this->my_localized_strings['google_api_key']).'\';'.(defined('__DEBUG_MODE__') ? "\n" : '');
382  $ret .= 'var g_min_password_length_string = \''.self::js_html($this->my_localized_strings['comdef_server_admin_strings']['min_password_length_string']).'\';'.(defined('__DEBUG_MODE__') ? "\n" : '');
383  $ret .= 'var g_num_meetings_updated_text = \''.self::js_html($this->my_localized_strings['comdef_server_admin_strings']['server_admin_ui_num_meetings_updated']).'\';'.(defined('__DEBUG_MODE__') ? "\n" : '');
384  $ret .= 'var g_num_meetings_not_updated_text = \''.self::js_html($this->my_localized_strings['comdef_server_admin_strings']['server_admin_ui_num_meetings_not_updated']).'\';'.(defined('__DEBUG_MODE__') ? "\n" : '');
385  $ret .= 'var g_warning_text = \''.self::js_html($this->my_localized_strings['comdef_server_admin_strings']['server_admin_ui_warning']).'\';'.(defined('__DEBUG_MODE__') ? "\n" : '');
386  $ret .= 'var g_errors_text = \''.self::js_html($this->my_localized_strings['comdef_server_admin_strings']['server_admin_ui_errors']).'\';'.(defined('__DEBUG_MODE__') ? "\n" : '');
387  $ret .= 'var g_meetings_not_found_text = \''.self::js_html($this->my_localized_strings['comdef_server_admin_strings']['server_admin_ui_meetings_not_found']).'\';'.(defined('__DEBUG_MODE__') ? "\n" : '');
388  $ret .= 'var g_service_bodies_created_text = \''.self::js_html($this->my_localized_strings['comdef_server_admin_strings']['server_admin_ui_service_bodies_created']).'\';'.(defined('__DEBUG_MODE__') ? "\n" : '');
389  $ret .= 'var g_meetings_created_text = \''.self::js_html($this->my_localized_strings['comdef_server_admin_strings']['server_admin_ui_meetings_created']).'\';'.(defined('__DEBUG_MODE__') ? "\n" : '');
390  $ret .= 'var g_users_created_text = \''.self::js_html($this->my_localized_strings['comdef_server_admin_strings']['server_admin_ui_users_created']).'\';'.(defined('__DEBUG_MODE__') ? "\n" : '');
391  $ret .= 'var g_server_admin_ui_refresh_ui_text = \''.self::js_html($this->my_localized_strings['comdef_server_admin_strings']['server_admin_ui_refresh_ui_text']).'\';'.(defined('__DEBUG_MODE__') ? "\n" : '');
392  $ret .= 'var g_time_values = [';
393  $ret .= '\''.self::js_html($this->my_localized_strings['comdef_server_admin_strings']['meeting_editor_screen_meeting_am_label']).'\',';
394  $ret .= '\''.self::js_html($this->my_localized_strings['comdef_server_admin_strings']['meeting_editor_screen_meeting_pm_label']).'\',';
395  $ret .= '\''.self::js_html($this->my_localized_strings['comdef_server_admin_strings']['meeting_editor_screen_meeting_noon_label']).'\',';
396  $ret .= '\''.self::js_html($this->my_localized_strings['comdef_server_admin_strings']['meeting_editor_screen_meeting_midnight_label']).'\'';
397  $ret .= '];'.(defined('__DEBUG_MODE__') ? "\n" : '');
398  $ret .= 'var g_naws_popup_prompt = \''.self::js_html($this->my_localized_strings['comdef_server_admin_strings']['world_format_codes_prompt']).'\';'.(defined('__DEBUG_MODE__') ? "\n" : '');
399  $ret .= "var g_naws_values = [";
400  $n_first = true;
401  // This sorts the NAWS codes in the format server admin. The drop-down menu is sorted by value and the key is the drop-down menu value.
402  // The first field key is empty and value is 'None', if we sort by key value this field will no longer be the top element.
403  // So we shift it off the array...
404  $top_elm = array_shift($this->my_localized_strings['comdef_server_admin_strings']['world_format_codes']);
405  // Then we can sort
406  asort($this->my_localized_strings['comdef_server_admin_strings']['world_format_codes']);
407  // and now we unshift it to put it back as the top element.
408  array_unshift($this->my_localized_strings['comdef_server_admin_strings']['world_format_codes'], $top_elm);
409  foreach ($this->my_localized_strings['comdef_server_admin_strings']['world_format_codes'] as $key => $value) {
410  if (!$n_first) {
411  $ret .= ','.(defined('__DEBUG_MODE__') ? "\n" : '');
412  } else {
413  $n_first = false;
414  $ret .= (defined('__DEBUG_MODE__') ? "\n" : '');
415  }
416  $ret .= '{"key":"'.self::js_html(str_replace("\n", ' ', $key)).'","value":"'.self::js_html(str_replace("\n", ' ', $value)).'"}';
417  }
418  $ret .= (defined('__DEBUG_MODE__') ? "\n" : '').'];';
419  /***
420  * Begin Format_type_enum
421  */
422  $ret .= 'var g_formatType_popup_prompt = \''.self::js_html($this->my_localized_strings['comdef_server_admin_strings']['format_type_prompt']).'\';'.(defined('__DEBUG_MODE__') ? "\n" : '');
423  $ret .= "var g_formatType_values = [";
424  $n_first = true;
425  foreach ($this->my_localized_strings['comdef_server_admin_strings']['format_type_codes'] as $key => $value) {
426  if (!$n_first) {
427  $ret .= ','.(defined('__DEBUG_MODE__') ? "\n" : '');
428  } else {
429  $n_first = false;
430  $ret .= (defined('__DEBUG_MODE__') ? "\n" : '');
431  }
432  $ret .= '{"key":"'.self::js_html(str_replace("\n", ' ', $key)).'","value":"'.self::js_html(str_replace("\n", ' ', $value)).'"}';
433  }
434  $ret .= (defined('__DEBUG_MODE__') ? "\n" : '').'];';
435 
436  /****
437  * End format_type_enum
438  */
439  $ret .= '</script>'.(defined('__DEBUG_MODE__') ? "\n" : '');
440  $ret .= '<script type="text/javascript" src="'.(((dirname($_SERVER['PHP_SELF']) != '/') && (dirname($_SERVER['PHP_SELF']) != '\\')) ? dirname($_SERVER['PHP_SELF']) : '').'/local_server/server_admin/json2.js"></script>'.(defined('__DEBUG_MODE__') ? "\n" : '');
441  $ret .= '<script type="text/javascript" src="'.(((dirname($_SERVER['PHP_SELF']) != '/') && (dirname($_SERVER['PHP_SELF']) != '\\')) ? dirname($_SERVER['PHP_SELF']) : '').'/local_server/server_admin/server_admin_javascript.js?v='. time() .'"></script>'.(defined('__DEBUG_MODE__') ? "\n" : '');
442  $ret .= '<script type="text/javascript" src="'.(((dirname($_SERVER['PHP_SELF']) != '/') && (dirname($_SERVER['PHP_SELF']) != '\\')) ? dirname($_SERVER['PHP_SELF']) : '').'/local_server/server_admin/jquery.slim.min.js"></script>';
443  $ret .= '<noscript class="main_noscript">'.self::js_html($this->my_localized_strings['comdef_server_admin_strings']['noscript']).'</noscript>'.(defined('__DEBUG_MODE__') ? "\n" : '');
444  // Belt and suspenders. Just make sure the user is legit.
445  if (($this->my_user instanceof c_comdef_user) && ($this->my_user->GetUserLevel() != _USER_LEVEL_DISABLED)) {
446  // Figure out which output will be sent, according to the user level.
447  switch ($this->my_user->GetUserLevel()) {
448  case _USER_LEVEL_SERVER_ADMIN:
449  $ret .= $this->return_format_editor_panel();
450  // Intentional fallthrough
451  case _USER_LEVEL_SERVICE_BODY_ADMIN:
452  $ret .= $this->return_server_admin_panel();
453  $ret .= $this->return_user_admin_panel();
454  if ((count($this->my_editable_service_bodies) > 0) || ($this->my_user->GetUserLevel() == _USER_LEVEL_SERVER_ADMIN)) {
455  $ret .= $this->return_service_body_admin_panel();
456  }
457  // Intentional fallthrough
458  case _USER_LEVEL_EDITOR:
459  $ret .= $this->return_meeting_editor_panel();
460  // Intentional fallthrough
461  case _USER_LEVEL_OBSERVER:
462  $ret .= '<div class="bmlt_admin_observer_link_div"><a target="_blank" href="client_interface/html/" class="bmlt_admin_observer_link_a">'.self::js_html($this->my_localized_strings['comdef_server_admin_strings']['Observer_Link_Text']).'</a></div>';
463  $ret .= $this->return_user_account_settings_panel();
464  break;
465 
466  default:
467  die('USER NOT AUTHORIZED');
468  break;
469  }
470  }
471 
472  $ret .= '</div>'.(defined('__DEBUG_MODE__') ? "\n" : '');
473  if (isset($_GET['edit_meeting']) && intval($_GET['edit_meeting'])) {
474  $ret .= '<script type="text/javascript">admin_handler_object.openMeetingForEditing('.intval($_GET['edit_meeting']).');</script>'.(defined('__DEBUG_MODE__') ? "\n" : '');
475  }
476 
477  return $ret;
478  }
479 
480  /********************************************************************************************************//**
481  \brief Does an HTML sub, and also "slashes" apostrophes.
482  \returns "Cleaned" text
483  ************************************************************************************************************/
484  // phpcs:disable PSR1.Methods.CamelCapsMethodName.NotCamelCaps
485  public static function js_html($in_raw_html)
486  {
487  // phpcs:enable PSR1.Methods.CamelCapsMethodName.NotCamelCaps
488  $flags = (defined('ENT_SUBSTITUTE') && defined('ENT_NOQUOTES')) ? intval(ENT_SUBSTITUTE | ENT_NOQUOTES) : null;
489  return preg_replace("|[\n\r]|", " ", str_replace("'", "\'", htmlspecialchars($in_raw_html), $flags));
490  }
491 
492  /********************************************************************************************************//**
493  \brief This constructs the User editor panel. Only Server Admins get this one.
494  \returns The HTML and JavaScript for the "Edit Users" section.
495  ************************************************************************************************************/
496  // phpcs:disable PSR1.Methods.CamelCapsMethodName.NotCamelCaps
497  public function return_format_editor_panel()
498  {
499  // phpcs:enable PSR1.Methods.CamelCapsMethodName.NotCamelCaps
500  $ret = 'NOT AUTHORIZED TO EDIT USERS';
501 
502  if ($this->my_user->GetUserLevel() == _USER_LEVEL_SERVER_ADMIN) {
503  $ret = '<div id="bmlt_admin_format_editor_disclosure_div" class="bmlt_admin_format_editor_disclosure_div bmlt_admin_format_editor_disclosure_div_closed">'.(defined('__DEBUG_MODE__') ? "\n" : '');
504  $ret .= '<a class="bmlt_admin_format_editor_disclosure_a" href="javascript:admin_handler_object.toggleFormatEditor();">';
505  $ret .= htmlspecialchars($this->my_localized_strings['comdef_server_admin_strings']['format_editor_disclosure']);
506  $ret .= '</a>'.(defined('__DEBUG_MODE__') ? "\n" : '');
507  $ret .= '</div>'.(defined('__DEBUG_MODE__') ? "\n" : '');
508  $ret .= '<div id="bmlt_admin_format_editor_wrapper_div" class="bmlt_admin_format_editor_wrapper_div bmlt_admin_format_editor_wrapper_div_hidden">';
509  $ret .= '<div class="bmlt_admin_format_editor_banner_div">';
510  $ret .= '<div class="bmlt_admin_meeting_editor_banner_container_div">';
511  $ret .= '<div class="bmlt_admin_fader_div item_hidden" id="bmlt_admin_fader_format_editor_success_div">';
512  $ret .= '<span class="success_text_span">'.htmlspecialchars($this->my_localized_strings['comdef_server_admin_strings']['format_change_fader_change_success_text']).'</span>';
513  $ret .= '</div>'.(defined('__DEBUG_MODE__') ? "\n" : '');
514  $ret .= '<div class="bmlt_admin_fader_div item_hidden" id="bmlt_admin_fader_format_editor_fail_div">';
515  $ret .= '<span class="failure_text_span">'.htmlspecialchars($this->my_localized_strings['comdef_server_admin_strings']['format_change_fader_change_fail_text']).'</span>';
516  $ret .= '</div>'.(defined('__DEBUG_MODE__') ? "\n" : '');
517  $ret .= '<div class="bmlt_admin_fader_div item_hidden" id="bmlt_admin_fader_format_create_success_div">';
518  $ret .= '<span class="success_text_span">'.htmlspecialchars($this->my_localized_strings['comdef_server_admin_strings']['format_change_fader_create_success_text']).'</span>';
519  $ret .= '</div>'.(defined('__DEBUG_MODE__') ? "\n" : '');
520  $ret .= '<div class="bmlt_admin_fader_div item_hidden" id="bmlt_admin_fader_format_create_fail_div">';
521  $ret .= '<span class="failure_text_span">'.htmlspecialchars($this->my_localized_strings['comdef_server_admin_strings']['format_change_fader_create_fail_text']).'</span>';
522  $ret .= '</div>'.(defined('__DEBUG_MODE__') ? "\n" : '');
523  $ret .= '<div class="bmlt_admin_fader_div item_hidden" id="bmlt_admin_fader_format_editor_delete_success_div">';
524  $ret .= '<span class="success_text_span">'.htmlspecialchars($this->my_localized_strings['comdef_server_admin_strings']['format_change_fader_delete_success_text']).'</span>';
525  $ret .= '</div>'.(defined('__DEBUG_MODE__') ? "\n" : '');
526  $ret .= '<div class="bmlt_admin_fader_div item_hidden" id="bmlt_admin_fader_format_editor_delete_fail_div">';
527  $ret .= '<span class="failure_text_span">'.htmlspecialchars($this->my_localized_strings['comdef_server_admin_strings']['format_change_fader_delete_fail_text']).'</span>';
528  $ret .= '</div>'.(defined('__DEBUG_MODE__') ? "\n" : '');
529  $ret .= '</div>'.(defined('__DEBUG_MODE__') ? "\n" : '');
530  $ret .= '</div>'.(defined('__DEBUG_MODE__') ? "\n" : '');
531  $ret .= '<div id="bmlt_admin_format_editor_inner_div" class="bmlt_admin_format_editor_inner_div"><table class="format_editor_table" id="bmlt_admin_format_editor_table" cellpadding="0" cellspacing="0" border="0"></table></div>'.(defined('__DEBUG_MODE__') ? "\n" : '');
532  $ret .= '</div>'.(defined('__DEBUG_MODE__') ? "\n" : '');
533  $ret .= '<script type="text/javascript">admin_handler_object.populateFormatEditor()</script>'.(defined('__DEBUG_MODE__') ? "\n" : '');
534  }
535 
536  return $ret;
537  }
538 
539  /********************************************************************************************************//**
540  \brief This constructs the User editor panel. Only Server Admins get this one.
541  \returns The HTML and JavaScript for the "Edit Users" section.
542  ************************************************************************************************************/
543  // phpcs:disable PSR1.Methods.CamelCapsMethodName.NotCamelCaps
544  public function return_user_admin_panel()
545  {
546  // phpcs:enable PSR1.Methods.CamelCapsMethodName.NotCamelCaps
547  $ret = 'NOT AUTHORIZED TO EDIT USERS';
548 
549  $userLevel = $this->my_user->GetUserLevel();
550 
551  // If service body admin, filter users down to only those owned by this user
552  if (count($this->my_users) && $userLevel == _USER_LEVEL_SERVICE_BODY_ADMIN) {
553  $users = array();
554  for ($index = 0; $index < count($this->my_users); $index++) {
555  $user = $this->my_users[$index];
556  if ($user->GetID() == $this->my_user->GetID()) {
557  continue;
558  }
559  if ($user->GetOwnerID() != $this->my_user->GetID()) {
560  continue;
561  }
562  array_push($users, $user);
563  }
564  } else {
565  $users = $this->my_users;
566  }
567 
568  if ($userLevel == _USER_LEVEL_SERVER_ADMIN || $userLevel == _USER_LEVEL_SERVICE_BODY_ADMIN) {
569  if (count($users)) {
570  $ret = '<div id="bmlt_admin_user_editor_disclosure_div" class="bmlt_admin_user_editor_disclosure_div bmlt_admin_user_editor_disclosure_div_closed">'.(defined('__DEBUG_MODE__') ? "\n" : '');
571  $ret .= '<a class="bmlt_admin_user_editor_disclosure_a" href="javascript:admin_handler_object.toggleUserEditor();">';
572  $ret .= htmlspecialchars($this->my_localized_strings['comdef_server_admin_strings']['user_editor_disclosure']);
573  $ret .= '</a>'.(defined('__DEBUG_MODE__') ? "\n" : '');
574  $ret .= '</div>'.(defined('__DEBUG_MODE__') ? "\n" : '');
575  $ret .= '<div id="bmlt_admin_user_editor_wrapper_div" class="bmlt_admin_user_editor_wrapper_div bmlt_admin_user_editor_wrapper_div_hidden">';
576  $ret .= '<div class="bmlt_admin_user_editor_banner_div">';
577  $ret .= '<div class="bmlt_admin_meeting_editor_banner_container_div">';
578  $ret .= '<div class="bmlt_admin_fader_div item_hidden" id="bmlt_admin_fader_user_editor_success_div">';
579  $ret .= '<span class="success_text_span">'.htmlspecialchars($this->my_localized_strings['comdef_server_admin_strings']['user_change_fader_success_text']).'</span>';
580  $ret .= '</div>'.(defined('__DEBUG_MODE__') ? "\n" : '');
581  $ret .= '<div class="bmlt_admin_fader_div item_hidden" id="bmlt_admin_fader_user_editor_fail_div">';
582  $ret .= '<span class="failure_text_span">'.htmlspecialchars($this->my_localized_strings['comdef_server_admin_strings']['user_change_fader_fail_text']).'</span>';
583  $ret .= '</div>'.(defined('__DEBUG_MODE__') ? "\n" : '');
584  $ret .= '<div class="bmlt_admin_fader_div item_hidden" id="bmlt_admin_fader_user_create_success_div">';
585  $ret .= '<span class="success_text_span">'.htmlspecialchars($this->my_localized_strings['comdef_server_admin_strings']['user_change_fader_create_success_text']).'</span>';
586  $ret .= '</div>'.(defined('__DEBUG_MODE__') ? "\n" : '');
587  $ret .= '<div class="bmlt_admin_fader_div item_hidden" id="bmlt_admin_fader_user_create_fail_div">';
588  $ret .= '<span class="failure_text_span">'.htmlspecialchars($this->my_localized_strings['comdef_server_admin_strings']['user_change_fader_create_fail_text']).'</span>';
589  $ret .= '</div>'.(defined('__DEBUG_MODE__') ? "\n" : '');
590  $ret .= '<div class="bmlt_admin_fader_div item_hidden" id="bmlt_admin_fader_user_editor_delete_success_div">';
591  $ret .= '<span class="success_text_span">'.htmlspecialchars($this->my_localized_strings['comdef_server_admin_strings']['user_change_fader_delete_success_text']).'</span>';
592  $ret .= '</div>'.(defined('__DEBUG_MODE__') ? "\n" : '');
593  $ret .= '<div class="bmlt_admin_fader_div item_hidden" id="bmlt_admin_fader_user_editor_delete_fail_div">';
594  $ret .= '<span class="failure_text_span">'.htmlspecialchars($this->my_localized_strings['comdef_server_admin_strings']['user_change_fader_delete_fail_text']).'</span>';
595  $ret .= '</div>'.(defined('__DEBUG_MODE__') ? "\n" : '');
596  $ret .= '</div>'.(defined('__DEBUG_MODE__') ? "\n" : '');
597  $ret .= '</div>'.(defined('__DEBUG_MODE__') ? "\n" : '');
598 
599  $ret .= $this->return_single_user_editor_panel($users);
600  $ret .= '</div>'.(defined('__DEBUG_MODE__') ? "\n" : '');
601  $ret .= '<script type="text/javascript">admin_handler_object.populateUserEditor()</script>'.(defined('__DEBUG_MODE__') ? "\n" : '');
602  } elseif ($userLevel == _USER_LEVEL_SERVICE_BODY_ADMIN) {
603  $ret = '';
604  }
605  }
606 
607  return $ret;
608  }
609 
610  /********************************************************************************************************//**
611  \brief This constructs a window for the User administrator.
612  \returns The HTML and JavaScript for the "User Administration" section.
613  ************************************************************************************************************/
614  // phpcs:disable PSR1.Methods.CamelCapsMethodName.NotCamelCaps
615  public function return_single_user_editor_panel($users)
616  {
617  // phpcs:enable PSR1.Methods.CamelCapsMethodName.NotCamelCaps
618  $ret = '<div id="bmlt_admin_single_user_editor_div" class="bmlt_admin_single_user_editor_div">'.(defined('__DEBUG_MODE__') ? "\n" : '');
619  $ret .= '<fieldset id="bmlt_admin_single_user_editor_fieldset" class="bmlt_admin_single_user_editor_fieldset">'.(defined('__DEBUG_MODE__') ? "\n" : '');
620  $ret .= '<legend id="bmlt_admin_single_user_editor_fieldset_legend" class="bmlt_admin_single_user_editor_fieldset_legend">'.(defined('__DEBUG_MODE__') ? "\n" : '');
621  $ret .= $this->create_user_popup($users);
622  $ret .= '</legend>'.(defined('__DEBUG_MODE__') ? "\n" : '');
623  $ret .= '<div class="bmlt_admin_one_line_in_a_form clear_both">';
624  $ret .= '<span class="bmlt_admin_med_label_right">'.htmlspecialchars($this->my_localized_strings['comdef_server_admin_strings']['user_editor_screen_sb_id_label']).'</span>';
625  $ret .= '<span class="bmlt_admin_value_left light_italic_display" id="user_editor_id_display"></span>';
626  $ret .= '<div class="clear_both"></div>';
627  $ret .= '</div>';
628  $ret .= '<div class="bmlt_admin_one_line_in_a_form clear_both">';
629  $ret .= '<span class="bmlt_admin_med_label_right">'.htmlspecialchars($this->my_localized_strings['comdef_server_admin_strings']['user_editor_account_type_label']).'</span>';
630  $ret .= '<span class="bmlt_admin_value_left" id="user_editor_single_non_service_body_admin_display">';
631  $ret .= $this->create_user_level_popup();
632  $ret .= '</span>';
633  $ret .= '<span id="user_editor_single_service_body_admin_display" class="item_hidden">'.htmlspecialchars($this->my_localized_strings['comdef_server_admin_strings']['user_editor_account_type_1']).'</span>';
634  $ret .= '<div class="clear_both"></div>';
635  $ret .= '</div>';
636  $ret .= '<div class="bmlt_admin_one_line_in_a_form clear_both">';
637  $ret .= '<span class="bmlt_admin_med_label_right">'.htmlspecialchars($this->my_localized_strings['comdef_server_admin_strings']['user_editor_user_owner_label']).'</span>';
638  $ret .= '<span class="bmlt_admin_value_left" id="user_editor_single_non_service_body_admin_display">';
639  $ret .= $this->create_user_owner_popup($this->my_users);
640  $ret .= '</span>';
641  $ret .= '<div class="clear_both"></div>';
642  $ret .= '</div>';
643  $ret .= '<div class="bmlt_admin_one_line_in_a_form clear_both">';
644  $ret .= '<span class="bmlt_admin_med_label_right">'.htmlspecialchars($this->my_localized_strings['comdef_server_admin_strings']['user_editor_account_login_label']).'</span>';
645  $ret .= '<span class="bmlt_admin_value_left"><input name="bmlt_admin_user_editor_login_input" id="bmlt_admin_user_editor_login_input" type="text" value="" onkeyup="admin_handler_object.handleTextInputChange(this);admin_handler_object.readUserEditorState();" onchange="admin_handler_object.handleTextInputChange(this);admin_handler_object.readUserEditorState();" onpaste="setTimeout(function() { admin_handler_object.handleTextInputChange(this);admin_handler_object.readUserEditorState(); }, 0);" oncut="setTimeout(function() { admin_handler_object.handleTextInputChange(this);admin_handler_object.readUserEditorState(); }, 0);" onfocus="admin_handler_object.handleTextInputFocus(this);" onblur="admin_handler_object.handleTextInputBlur(this);" /></span>';
646  $ret .= '<script type="text/javascript">admin_handler_object.handleTextInputLoad(document.getElementById(\'bmlt_admin_user_editor_login_input\'),\''.htmlspecialchars($this->my_localized_strings['comdef_server_admin_strings']['user_editor_login_default_text']).'\', true);</script>';
647  $ret .= '<div class="clear_both"></div>';
648  $ret .= '</div>';
649  $ret .= '<div class="bmlt_admin_one_line_in_a_form clear_both">';
650  $ret .= '<span class="bmlt_admin_med_label_right">'.htmlspecialchars($this->my_localized_strings['comdef_server_admin_strings']['user_editor_account_name_label']).'</span>';
651  $ret .= '<span class="bmlt_admin_value_left"><input name="bmlt_admin_user_editor_name_input" id="bmlt_admin_user_editor_name_input" type="text" value="" onkeyup="admin_handler_object.handleTextInputChange(this);admin_handler_object.readUserEditorState();" onchange="admin_handler_object.handleTextInputChange(this);admin_handler_object.readUserEditorState();" onpaste="setTimeout(function() { admin_handler_object.handleTextInputChange(this);admin_handler_object.readUserEditorState(); }, 0);" oncut="setTimeout(function() { admin_handler_object.handleTextInputChange(this);admin_handler_object.readUserEditorState(); }, 0);" onfocus="admin_handler_object.handleTextInputFocus(this);" onblur="admin_handler_object.handleTextInputBlur(this);" /></span>';
652  $ret .= '<script type="text/javascript">admin_handler_object.handleTextInputLoad(document.getElementById(\'bmlt_admin_user_editor_name_input\'),\''.htmlspecialchars($this->my_localized_strings['comdef_server_admin_strings']['user_editor_name_default_text']).'\');</script>';
653  $ret .= '<div class="clear_both"></div>';
654  $ret .= '</div>';
655  $ret .= '<div class="bmlt_admin_one_line_in_a_form clear_both">';
656  $ret .= '<span class="bmlt_admin_med_label_right">'.htmlspecialchars($this->my_localized_strings['comdef_server_admin_strings']['user_editor_account_description_label']).'</span>';
657  $ret .= '<span class="bmlt_admin_value_left"><textarea cols="40" rows="10" name="bmlt_admin_user_editor_description_textarea" id="bmlt_admin_user_editor_description_textarea" onkeyup="admin_handler_object.handleTextInputChange(this);admin_handler_object.readUserEditorState();" onchange="admin_handler_object.handleTextInputChange(this);admin_handler_object.readUserEditorState();" onpaste="setTimeout(function() { admin_handler_object.handleTextInputChange(this);admin_handler_object.readUserEditorState(); }, 0);" oncut="setTimeout(function() { admin_handler_object.handleTextInputChange(this);admin_handler_object.readUserEditorState(); }, 0);" onfocus="admin_handler_object.handleTextInputFocus(this);" onblur="admin_handler_object.handleTextInputBlur(this);"></textarea></span>';
658  $ret .= '<script type="text/javascript">admin_handler_object.handleTextInputLoad(document.getElementById(\'bmlt_admin_user_editor_description_textarea\'),\''.htmlspecialchars($this->my_localized_strings['comdef_server_admin_strings']['user_editor_description_default_text']).'\');</script>';
659  $ret .= '<div class="clear_both"></div>';
660  $ret .= '</div>';
661  $ret .= '<div class="bmlt_admin_one_line_in_a_form clear_both">';
662  $ret .= '<span class="bmlt_admin_med_label_right">'.htmlspecialchars($this->my_localized_strings['comdef_server_admin_strings']['user_editor_account_email_label']).'</span>';
663  $ret .= '<span class="bmlt_admin_value_left"><input name="bmlt_admin_user_editor_email_input" id="bmlt_admin_user_editor_email_input" type="text" value="" onkeyup="admin_handler_object.handleTextInputChange(this);admin_handler_object.readUserEditorState();" onchange="admin_handler_object.handleTextInputChange(this);admin_handler_object.readUserEditorState();" onpaste="setTimeout(function() { admin_handler_object.handleTextInputChange(this);admin_handler_object.readUserEditorState(); }, 0);" oncut="setTimeout(function() { admin_handler_object.handleTextInputChange(this);admin_handler_object.readUserEditorState(); }, 0);" onfocus="admin_handler_object.handleTextInputFocus(this);" onblur="admin_handler_object.handleTextInputBlur(this);" /></span>';
664  $ret .= '<script type="text/javascript">admin_handler_object.handleTextInputLoad(document.getElementById(\'bmlt_admin_user_editor_email_input\'),\''.htmlspecialchars($this->my_localized_strings['comdef_server_admin_strings']['user_editor_email_default_text']).'\');</script>';
665  $ret .= '<div class="clear_both"></div>';
666  $ret .= '</div>';
667  $ret .= '<div class="bmlt_admin_one_line_in_a_form clear_both">';
668  $ret .= '<span id="bmlt_admin_user_editor_password_label" class="bmlt_admin_med_label_right"></span>';
669  $ret .= '<span class="bmlt_admin_value_left"><input name="bmlt_admin_user_editor_password_input" id="bmlt_admin_user_editor_password_input" type="text" value="" onkeyup="admin_handler_object.handleTextInputChange(this);admin_handler_object.readUserEditorState();" onchange="admin_handler_object.handleTextInputChange(this);admin_handler_object.readUserEditorState();" onpaste="setTimeout(function() { admin_handler_object.handleTextInputChange(this);admin_handler_object.readUserEditorState(); }, 0);" oncut="setTimeout(function() { admin_handler_object.handleTextInputChange(this);admin_handler_object.readUserEditorState(); }, 0);" onfocus="admin_handler_object.handleTextInputFocus(this);" onblur="admin_handler_object.handleTextInputBlur(this);" /></span>';
670  $ret .= '<div class="clear_both"></div>';
671  $ret .= '</div>'.(defined('__DEBUG_MODE__') ? "\n" : '');
672  $ret .= $this->return_user_editor_button_panel();
673  $ret .= '</fieldset>'.(defined('__DEBUG_MODE__') ? "\n" : '');
674  $ret .= '</div>'.(defined('__DEBUG_MODE__') ? "\n" : '');
675  $ret .= '<script type="text/javascript">admin_handler_object.populateUserEditor()</script>'.(defined('__DEBUG_MODE__') ? "\n" : '');
676 
677  return $ret;
678  }
679 
680  /********************************************************************************************************//**
681  \brief This creates the HTML for a user selection popup menu.
682  \returns The HTML and JavaScript for the popup menu (select element).
683  ************************************************************************************************************/
684  // phpcs:disable PSR1.Methods.CamelCapsMethodName.NotCamelCaps
685  public function create_user_popup($users)
686  {
687  // phpcs:enable PSR1.Methods.CamelCapsMethodName.NotCamelCaps
688  $ret = '<select id="bmlt_admin_single_user_editor_user_select" class="bmlt_admin_single_user_editor_user_select" onchange="admin_handler_object.populateUserEditor();">';
689  $first = true;
690  for ($index = 0; $index < count($users); $index++) {
691  $user = $users[$index];
692  if ($user->GetID() != $this->my_user->GetID()) {
693  $ret .= '<option value="'.$user->GetID().'"';
694  $ret .= '>'.htmlspecialchars($user->GetLocalName()).'</option>'.(defined('__DEBUG_MODE__') ? "\n" : '');
695  }
696  }
697 
698  if ($this->my_user->GetUserLevel() == _USER_LEVEL_SERVER_ADMIN) {
699  if (count($users)) {
700  $ret .= '<option value="" disabled="disabled"></option>';
701  }
702  $ret .= '<option value="0" selected="selected">'.htmlspecialchars($this->my_localized_strings['comdef_server_admin_strings']['user_editor_create_new_user_option']).'</option>';
703  }
704  $ret .= '</select>'.(defined('__DEBUG_MODE__') ? "\n" : '');
705 
706  return $ret;
707  }
708 
709  /********************************************************************************************************//**
710  \brief This creates the HTML for a user level popup menu.
711  \returns The HTML and JavaScript for the popup menu (select element).
712  ************************************************************************************************************/
713  // phpcs:disable PSR1.Methods.CamelCapsMethodName.NotCamelCaps
714  public function create_user_level_popup()
715  {
716  // phpcs:enable PSR1.Methods.CamelCapsMethodName.NotCamelCaps
717  $disabled = $this->my_user->GetUserLevel() == _USER_LEVEL_SERVER_ADMIN ? '' : ' disabled';
718  $ret = '<select id="bmlt_admin_single_user_editor_level_select" class="bmlt_admin_single_user_editor_level_select" onchange="admin_handler_object.readUserEditorState();"'.$disabled.'>';
719  $first = true;
720  $ret .= '<option value="2">'.htmlspecialchars($this->my_localized_strings['comdef_server_admin_strings']['user_editor_account_type_2']).'</option>';
721  $ret .= '<option value="5">'.htmlspecialchars($this->my_localized_strings['comdef_server_admin_strings']['user_editor_account_type_5']).'</option>';
722  $ret .= '<option value="" disabled="disabled"></option>';
723  $ret .= '<option value="4">'.htmlspecialchars($this->my_localized_strings['comdef_server_admin_strings']['user_editor_account_type_4']).'</option>';
724  $ret .= '</select>';
725 
726  return $ret;
727  }
728 
729  /********************************************************************************************************//**
730  \brief This creates the HTML for a user owner selection popup menu.
731  \returns The HTML and JavaScript for the popup menu (select element).
732  ************************************************************************************************************/
733  // phpcs:disable PSR1.Methods.CamelCapsMethodName.NotCamelCaps
734  public function create_user_owner_popup($users)
735  {
736  // phpcs:enable PSR1.Methods.CamelCapsMethodName.NotCamelCaps
737  $disabled = $this->my_user->GetUserLevel() == _USER_LEVEL_SERVER_ADMIN ? '' : ' disabled';
738  $ret = '<select id="bmlt_admin_single_user_editor_user_owner_select" class="bmlt_admin_single_user_editor_user_select" onchange="admin_handler_object.readUserEditorState();"'.$disabled.'>';
739 
740  for ($index = 0; $index < count($users); $index++) {
741  $user = $users[$index];
742  $ret .= '<option value="'.$user->GetID().'"';
743  $ret .= '>'.htmlspecialchars($user->GetLocalName()).'</option>'.(defined('__DEBUG_MODE__') ? "\n" : '');
744  }
745 
746  $ret .= '</select>'.(defined('__DEBUG_MODE__') ? "\n" : '');
747 
748  return $ret;
749  }
750 
751  /********************************************************************************************************//**
752  \brief This constructs the User editor buttons as a div.
753  \returns The HTML and JavaScript for the button panel.
754  ************************************************************************************************************/
755  // phpcs:disable PSR1.Methods.CamelCapsMethodName.NotCamelCaps
756  public function return_user_editor_button_panel()
757  {
758  // phpcs:enable PSR1.Methods.CamelCapsMethodName.NotCamelCaps
759  $ret = '<div class="bmlt_admin_user_editor_button_div">';
760  $ret .= '<span class="bmlt_admin_meeting_editor_form_meeting_button_left_span">';
761  $ret .= '<a id="bmlt_admin_user_editor_form_user_save_button" href="javascript:admin_handler_object.saveUser();" class="bmlt_admin_ajax_button button_disabled">'.htmlspecialchars($this->my_localized_strings['comdef_server_admin_strings']['user_save_button']).'</a>';
762  $ret .= '<span id="bmlt_admin_user_save_ajax_button_throbber_span" class="bmlt_admin_ajax_button_throbber_span item_hidden"><img src="local_server/server_admin/style/images/ajax-throbber-white.gif" alt="AJAX Throbber" /></span>';
763  $ret .= '</span>';
764  $ret .= '<span class="bmlt_admin_meeting_editor_form_middle_button_single_span bmlt_admin_delete_button_span hide_in_new_user_admin">';
765  $delete_button_href = $this->my_user->GetUserLevel() == _USER_LEVEL_SERVER_ADMIN ? 'javascript:admin_handler_object.deleteUser();' : 'javascript:void(0);';
766  $ret .= '<a id="bmlt_admin_meeting_editor_form_user_delete_button" href="'.$delete_button_href.'" class="bmlt_admin_ajax_button button">'.htmlspecialchars($this->my_localized_strings['comdef_server_admin_strings']['user_delete_button']).'</a>';
767  $ret .= '<span id="bmlt_admin_user_delete_ajax_button_throbber_span" class="bmlt_admin_ajax_button_throbber_span item_hidden"><img src="local_server/server_admin/style/images/ajax-throbber-white.gif" alt="AJAX Throbber" /></span>';
768  $ret .= '<span class="perm_checkbox_span">';
769  $delete_perm_checkbox_disabled = $this->my_user->GetUserLevel() == _USER_LEVEL_SERVER_ADMIN ? '' : 'disabled ';
770  $ret .= '<input type="checkbox" id="bmlt_admin_user_delete_perm_checkbox" '.$delete_perm_checkbox_disabled.'/>';
771  $ret .= '<label for="bmlt_admin_user_delete_perm_checkbox">'.htmlspecialchars($this->my_localized_strings['comdef_server_admin_strings']['user_delete_perm_checkbox']).'</label>';
772  $ret .= '</span>';
773  $ret .= '</span>';
774  $ret .= '<span class="bmlt_admin_meeting_editor_form_meeting_button_right_span">';
775  $ret .= '<a id="bmlt_admin_user_editor_form_user_editor_cancel_button" href="javascript:admin_handler_object.cancelUserEdit();" class="bmlt_admin_ajax_button button_disabled">'.htmlspecialchars($this->my_localized_strings['comdef_server_admin_strings']['user_cancel_button']).'</a>';
776  $ret .= '</span>';
777  $ret .= '<div class="clear_both"></div>';
778  $ret .= '</div>';
779 
780  return $ret;
781  }
782 
783  /********************************************************************************************************//**
784  \brief This constructs the Service body editor panel. Only Server Admins and Service Body Admins get this one.
785  \returns The HTML and JavaScript for the "Service Body Administration" section.
786  ************************************************************************************************************/
787  // phpcs:disable PSR1.Methods.CamelCapsMethodName.NotCamelCaps
788  public function return_service_body_admin_panel()
789  {
790  // phpcs:enable PSR1.Methods.CamelCapsMethodName.NotCamelCaps
791  $ret = '';
792  $full_editors = $this->get_full_editor_users();
793 
794  if (count($full_editors)) { // Have to have at least one Service body admin
795  $ret = '<div id="bmlt_admin_service_body_editor_disclosure_div" class="bmlt_admin_service_body_editor_disclosure_div bmlt_admin_service_body_editor_disclosure_div_closed">'.(defined('__DEBUG_MODE__') ? "\n" : '');
796  $ret .= '<a class="bmlt_admin_service_body_editor_disclosure_a" href="javascript:admin_handler_object.toggleServiceBodyEditor();">';
797  $ret .= htmlspecialchars($this->my_localized_strings['comdef_server_admin_strings']['service_body_editor_disclosure']);
798  $ret .= '</a>'.(defined('__DEBUG_MODE__') ? "\n" : '');
799  $ret .= '</div>'.(defined('__DEBUG_MODE__') ? "\n" : '');
800  $ret .= '<div id="bmlt_admin_service_body_editor_wrapper_div" class="bmlt_admin_service_body_editor_wrapper_div bmlt_admin_service_body_editor_wrapper_div_hidden">';
801  $ret .= '<div class="bmlt_admin_service_body_editor_banner_div">';
802  $ret .= '<div class="bmlt_admin_meeting_editor_banner_container_div">';
803  $ret .= '<div class="bmlt_admin_fader_div item_hidden" id="bmlt_admin_fader_service_body_editor_warn_div">';
804  $ret .= '<span class="warn_text_span">'.htmlspecialchars($this->my_localized_strings['comdef_server_admin_strings']['need_refresh_message_fader_text']).'</span>';
805  $ret .= '</div>'.(defined('__DEBUG_MODE__') ? "\n" : '');
806  $ret .= '<div class="bmlt_admin_fader_div item_hidden" id="bmlt_admin_fader_service_body_editor_success_div">';
807  $ret .= '<span class="success_text_span">'.htmlspecialchars($this->my_localized_strings['comdef_server_admin_strings']['service_body_change_fader_success_text']).'</span>';
808  $ret .= '</div>'.(defined('__DEBUG_MODE__') ? "\n" : '');
809  $ret .= '<div class="bmlt_admin_fader_div item_hidden" id="bmlt_admin_fader_service_body_editor_fail_div">';
810  $ret .= '<span class="failure_text_span">'.htmlspecialchars($this->my_localized_strings['comdef_server_admin_strings']['service_body_change_fader_fail_text']).'</span>';
811  $ret .= '</div>'.(defined('__DEBUG_MODE__') ? "\n" : '');
812  $ret .= '<div class="bmlt_admin_fader_div item_hidden" id="bmlt_admin_fader_service_body_create_success_div">';
813  $ret .= '<span class="success_text_span">'.htmlspecialchars($this->my_localized_strings['comdef_server_admin_strings']['service_body_change_fader_create_success_text']).'</span>';
814  $ret .= '</div>'.(defined('__DEBUG_MODE__') ? "\n" : '');
815  $ret .= '<div class="bmlt_admin_fader_div item_hidden" id="bmlt_admin_fader_service_body_create_fail_div">';
816  $ret .= '<span class="failure_text_span">'.htmlspecialchars($this->my_localized_strings['comdef_server_admin_strings']['service_body_change_fader_create_fail_text']).'</span>';
817  $ret .= '</div>'.(defined('__DEBUG_MODE__') ? "\n" : '');
818  $ret .= '<div class="bmlt_admin_fader_div item_hidden" id="bmlt_admin_fader_service_body_editor_delete_success_div">';
819  $ret .= '<span class="success_text_span">'.htmlspecialchars($this->my_localized_strings['comdef_server_admin_strings']['service_body_change_fader_delete_success_text']).'</span>';
820  $ret .= '</div>'.(defined('__DEBUG_MODE__') ? "\n" : '');
821  $ret .= '<div class="bmlt_admin_fader_div item_hidden" id="bmlt_admin_fader_service_body_editor_delete_fail_div">';
822  $ret .= '<span class="failure_text_span">'.htmlspecialchars($this->my_localized_strings['comdef_server_admin_strings']['service_body_change_fader_delete_fail_text']).'</span>';
823  $ret .= '</div>'.(defined('__DEBUG_MODE__') ? "\n" : '');
824  $ret .= '</div>';
825  $ret .= '</div>';
826 
827  $ret .= $this->return_single_service_body_editor_panel();
828  $ret .= '</div>';
829  $ret .= '<script type="text/javascript">admin_handler_object.populateServiceBodyEditor()</script>';
830  }
831 
832  return $ret;
833  }
834 
835  /********************************************************************************************************//**
836  \brief This constructs a window for the Service Body administrator.
837  \returns The HTML and JavaScript for the "Service Body Administration" section.
838  ************************************************************************************************************/
839  // phpcs:disable PSR1.Methods.CamelCapsMethodName.NotCamelCaps
840  public function return_single_service_body_editor_panel()
841  {
842  // phpcs:enable PSR1.Methods.CamelCapsMethodName.NotCamelCaps
843  $ret = '<div id="bmlt_admin_single_service_body_editor_div" class="bmlt_admin_single_service_body_editor_div">'.(defined('__DEBUG_MODE__') ? "\n" : '');
844  $ret .= '<fieldset id="bmlt_admin_single_service_body_editor_fieldset" class="bmlt_admin_single_service_body_editor_fieldset">'.(defined('__DEBUG_MODE__') ? "\n" : '');
845  $ret .= '<legend id="bmlt_admin_single_service_body_editor_fieldset_legend" class="bmlt_admin_single_service_body_editor_fieldset_legend">'.(defined('__DEBUG_MODE__') ? "\n" : '');
846 
847  if (!($this->my_user->GetUserLevel() == _USER_LEVEL_SERVER_ADMIN) && count($this->my_editable_service_bodies) == 1) {
848  $ret .= '<span class="service_body_title_span">'.htmlspecialchars($this->my_editable_service_bodies[0]->GetLocalName()).'</span>';
849  } else {
850  $ret .= $this->create_service_body_popup();
851  }
852 
853  $ret .= '</legend>'.(defined('__DEBUG_MODE__') ? "\n" : '');
854  $ret .= '<div class="naws_link_div" id="service_body_editor_naws_link_div">';
855  $ret .= '<a id="service_body_editor_naws_link_a" href="">'.htmlspecialchars($this->my_localized_strings['comdef_server_admin_strings']['service_body_editor_uri_naws_format_text']).'</a>';
856  $ret .= '</div>';
857  $ret .= '<div class="bmlt_admin_one_line_in_a_form clear_both">';
858  $ret .= '<span class="bmlt_admin_med_label_right">'.htmlspecialchars($this->my_localized_strings['comdef_server_admin_strings']['service_body_editor_screen_sb_id_label']).'</span>';
859  $ret .= '<span class="bmlt_admin_value_left light_italic_display" id="service_body_admin_id_display"></span>';
860  $ret .= '<div class="clear_both"></div>';
861  $ret .= '</div>';
862  $ret .= '<div class="bmlt_admin_one_line_in_a_form clear_both">';
863  $ret .= '<span class="bmlt_admin_med_label_right">'.htmlspecialchars($this->my_localized_strings['comdef_server_admin_strings']['service_body_editor_screen_sb_admin_user_label']).'</span>';
864 
865  if ($this->my_user->GetUserLevel() == _USER_LEVEL_SERVER_ADMIN) {
866  $ret .= '<span class="bmlt_admin_value_left">';
867  $ret .= $this->create_service_body_user_popup();
868  $ret .= '</span>';
869  } else {
870  $ret .= '<span id="single_user_service_body_admin_span" class="bmlt_admin_value_left light_italic_display"></span>';
871  }
872  $ret .= '<div class="clear_both"></div>';
873  $ret .= '</div>';
874  if ($this->my_user->GetUserLevel() == _USER_LEVEL_SERVER_ADMIN) {
875  $ret .= '<div class="bmlt_admin_one_line_in_a_form clear_both">';
876  $ret .= '<span class="bmlt_admin_med_label_right">'.htmlspecialchars($this->my_localized_strings['comdef_server_admin_strings']['service_body_editor_type_label']).'</span>';
877  $ret .= '<span class="bmlt_admin_value_left">';
878  $ret .= $this->create_service_body_type_popup();
879  $ret .= '</span>';
880  $ret .= '<div class="clear_both"></div>';
881  $ret .= '</div>';
882  $ret .= '<div class="bmlt_admin_one_line_in_a_form clear_both">';
883  $ret .= '<span class="bmlt_admin_med_label_right">'.htmlspecialchars($this->my_localized_strings['comdef_server_admin_strings']['service_body_parent_popup_label']).'</span>';
884  $ret .= '<span class="bmlt_admin_value_left">';
885  $ret .= $this->create_service_body_parent_popup();
886  $ret .= '</span>';
887  $ret .= '<div class="clear_both"></div>';
888  $ret .= '</div>';
889 
890  // This is the part of the form that allows us to import a list of IDs from NAWS, and replace them in our database.
891  if (defined('__NAWS_IMPORT__')) {
892  $ret .= '<div class="bmlt_admin_one_line_in_a_form clear_both">';
893  $ret .= '</div>';
894  }
895  }
896  $ret .= '<div class="bmlt_admin_one_line_in_a_form clear_both">';
897  $ret .= '<span class="bmlt_admin_med_label_right">'.htmlspecialchars($this->my_localized_strings['comdef_server_admin_strings']['service_body_editor_screen_sb_name_label']).'</span>';
898  $ret .= '<span class="bmlt_admin_value_left"><input id="bmlt_admin_service_body_editor_sb_name_text_input" type="text" value="" onkeyup="admin_handler_object.handleTextInputServiceBodyChange(this, 2);" onchange="admin_handler_object.handleTextInputServiceBodyChange(this, 2);" onpaste="setTimeout(function() { admin_handler_object.handleTextInputServiceBodyChange(this, 2); }, 0);" oncut="setTimeout(function() { admin_handler_object.handleTextInputServiceBodyChange(this, 2); }, 0);" onfocus="admin_handler_object.handleTextInputFocus(this);" onblur="admin_handler_object.handleTextInputBlur(this);" /></span>';
899  $ret .= '<div class="clear_both"></div>';
900  $ret .= '</div>';
901  $ret .= '<div class="bmlt_admin_one_line_in_a_form clear_both">';
902  $ret .= '<span class="bmlt_admin_med_label_right">'.htmlspecialchars($this->my_localized_strings['comdef_server_admin_strings']['service_body_editor_screen_sb_admin_description_label']).'</span>';
903  $ret .= '<span class="bmlt_admin_value_left"><textarea cols="40" rows="10" name="bmlt_admin_sb_description_textarea" id="bmlt_admin_sb_description_textarea" class="bmlt_text_item" onkeyup="admin_handler_object.handleTextInputServiceBodyChange(this, 3);" onchange="admin_handler_object.handleTextInputServiceBodyChange(this, 3);" onpaste="setTimeout(function() { admin_handler_object.handleTextInputServiceBodyChange(this, 3); }, 0);" oncut="setTimeout(function() { admin_handler_object.handleTextInputServiceBodyChange(this, 3); }, 0);" onfocus="admin_handler_object.handleTextInputFocus(this);" onblur="admin_handler_object.handleTextInputBlur(this);"></textarea></span>';
904  $ret .= '<div class="clear_both"></div>';
905  $ret .= '</div>';
906  $ret .= '<div class="bmlt_admin_one_line_in_a_form clear_both">';
907  $ret .= '<span class="bmlt_admin_med_label_right">'.htmlspecialchars($this->my_localized_strings['comdef_server_admin_strings']['service_body_editor_screen_sb_admin_email_label']).'</span>';
908  $ret .= '<span class="bmlt_admin_value_left"><input id="bmlt_admin_service_body_editor_sb_email_text_input" type="text" value="" onkeyup="admin_handler_object.handleTextInputServiceBodyChange(this, 6);" onchange="admin_handler_object.handleTextInputServiceBodyChange(this, 6);" onpaste="setTimeout(function() { admin_handler_object.handleTextInputServiceBodyChange(this, 6); }, 0);" oncut="setTimeout(function() { admin_handler_object.handleTextInputServiceBodyChange(this, 6); }, 0);" onfocus="admin_handler_object.handleTextInputFocus(this);" onblur="admin_handler_object.handleTextInputBlur(this);" /></span>';
909  $ret .= '<div class="clear_both"></div>';
910  $ret .= '</div>';
911  $ret .= '<div class="bmlt_admin_one_line_in_a_form clear_both">';
912  $ret .= '<span class="bmlt_admin_med_label_right">'.htmlspecialchars($this->my_localized_strings['comdef_server_admin_strings']['service_body_editor_screen_sb_admin_uri_label']).'</span>';
913  $ret .= '<span class="bmlt_admin_value_left"><input id="bmlt_admin_service_body_editor_sb_uri_text_input" type="text" value="" onkeyup="admin_handler_object.handleTextInputServiceBodyChange(this, 7);" onchange="admin_handler_object.handleTextInputServiceBodyChange(this, 7);" onpaste="setTimeout(function() { admin_handler_object.handleTextInputServiceBodyChange(this, 7); }, 0);" oncut="setTimeout(function() { admin_handler_object.handleTextInputServiceBodyChange(this, 7); }, 0);" onfocus="admin_handler_object.handleTextInputFocus(this);" onblur="admin_handler_object.handleTextInputBlur(this);" /></span>';
914  $ret .= '<div class="clear_both"></div>';
915  $ret .= '</div>';
916  $ret .= '<div class="bmlt_admin_one_line_in_a_form clear_both">';
917  $ret .= '<span class="bmlt_admin_med_label_right">'.htmlspecialchars($this->my_localized_strings['comdef_server_admin_strings']['service_body_editor_screen_world_cc_label']).'</span>';
918  $ret .= '<span class="bmlt_admin_value_left"><input id="bmlt_admin_single_service_body_editor_world_cc_text_input" type="text" value="" onkeyup="admin_handler_object.handleTextInputServiceBodyChange(this, 12);" onchange="admin_handler_object.handleTextInputServiceBodyChange(this, 12);" onpaste="setTimeout(function() { admin_handler_object.handleTextInputServiceBodyChange(this, 12); }, 0);" oncut="setTimeout(function() { admin_handler_object.handleTextInputServiceBodyChange(this, 12); }, 0);" onfocus="admin_handler_object.handleTextInputFocus(this);" onblur="admin_handler_object.handleTextInputBlur(this);" /></span>';
919  $ret .= '<div class="clear_both"></div>';
920  $ret .= '</div>';
921  $ret .= '<div class="bmlt_admin_one_line_in_a_form clear_both">';
922  $ret .= '<span class="bmlt_admin_med_label_right">'.htmlspecialchars($this->my_localized_strings['comdef_server_admin_strings']['service_body_editor_screen_helpline_label']).'</span>';
923  $ret .= '<span class="bmlt_admin_value_left"><input id="bmlt_admin_single_service_body_editor_helpline_text_input" type="text" value="" onkeyup="admin_handler_object.handleTextInputServiceBodyChange(this, 8);" onchange="admin_handler_object.handleTextInputServiceBodyChange(this, 8);" onpaste="setTimeout(function() { admin_handler_object.handleTextInputServiceBodyChange(this, 8); }, 0);" oncut="setTimeout(function() { admin_handler_object.handleTextInputServiceBodyChange(this, 8); }, 0);" onfocus="admin_handler_object.handleTextInputFocus(this);" onblur="admin_handler_object.handleTextInputBlur(this);" /></span>';
924  $ret .= '<div class="clear_both"></div>';
925  $ret .= '</div>';
926 
927  $full_editors = $this->get_full_editor_users();
928  $basic_editors = $this->get_basic_editor_users();
929  $observers = $this->get_observer_users();
930 
931  if (count($full_editors)) {
932  $ret .= '<div id="service_body_admin_full_editor_list_div" class="bmlt_admin_one_line_in_a_form clear_both">';
933  $ret .= '<span class="bmlt_admin_med_label_right">'.htmlspecialchars($this->my_localized_strings['comdef_server_admin_strings']['service_body_editor_screen_sb_admin_full_editor_label']).'</span>';
934  $ret .= '<span class="bmlt_admin_value_left light_italic_display">'.htmlspecialchars($this->my_localized_strings['comdef_server_admin_strings']['service_body_editor_screen_sb_admin_full_editor_desc']).'</span>';
935  $ret .= '<div class="clear_both"></div>';
936 
937  foreach ($full_editors as $user) {
938  $ret .= '<span class="bmlt_admin_med_label_right"><input type="checkbox" id="service_body_admin_editor_user_'.$user->GetID().'_checkbox" onchange="admin_handler_object.serviceBodyUserChecboxHandler('.$user->GetID().',this);" onclick="admin_handler_object.serviceBodyUserChecboxHandler('.$user->GetID().',this);" /></span>';
939  $ret .= '<label class="bmlt_admin_med_label_left" for="service_body_admin_editor_user_'.$user->GetID().'_checkbox">'.htmlspecialchars($user->GetLocalName()).'</label>';
940  $ret .= '<div class="clear_both"></div>';
941  }
942 
943  $ret .= '</div>';
944  $ret .= '<div class="clear_both"></div>';
945  }
946 
947  if (count($observers)) {
948  $ret .= '<div id="service_body_admin_observer_list_div" class="bmlt_admin_one_line_in_a_form clear_both">';
949  $ret .= '<span class="bmlt_admin_med_label_right">'.htmlspecialchars($this->my_localized_strings['comdef_server_admin_strings']['service_body_editor_screen_sb_admin_observer_label']).'</span>';
950  $ret .= '<span class="bmlt_admin_value_left light_italic_display">'.htmlspecialchars($this->my_localized_strings['comdef_server_admin_strings']['service_body_editor_screen_sb_admin_observer_desc']).'</span>';
951  $ret .= '<div class="clear_both"></div>';
952 
953  foreach ($observers as $user) {
954  $ret .= '<span class="bmlt_admin_med_label_right"><input type="checkbox" id="service_body_admin_editor_user_'.$user->GetID().'_checkbox" onchange="admin_handler_object.serviceBodyUserChecboxHandler('.$user->GetID().',this);" onclick="admin_handler_object.serviceBodyUserChecboxHandler('.$user->GetID().',this);" /></span>';
955  $ret .= '<label class="bmlt_admin_med_label_left" for="service_body_admin_editor_user_'.$user->GetID().'_checkbox">'.htmlspecialchars($user->GetLocalName()).'</label>';
956  $ret .= '<div class="clear_both"></div>';
957  }
958  $ret .= '</div>';
959  $ret .= '<div class="clear_both"></div>';
960  }
961 
962  $ret .= '<div class="clear_both"></div>';
963  $ret .= $this->return_service_body_editor_button_panel();
964  $ret .= '</fieldset>'.(defined('__DEBUG_MODE__') ? "\n" : '');
965  $ret .= '</div>'.(defined('__DEBUG_MODE__') ? "\n" : '');
966 
967  return $ret;
968  }
969 
970  /********************************************************************************************************//**
971  \brief This gets just the Service Body Admin Users, and returns their objects in an array.
972  \returns An array with the user objects (instances of c_comdef_user)
973  ************************************************************************************************************/
974  // phpcs:disable PSR1.Methods.CamelCapsMethodName.NotCamelCaps
975  public function get_full_editor_users()
976  {
977  // phpcs:enable PSR1.Methods.CamelCapsMethodName.NotCamelCaps
978  $ret = array ();
979 
980  for ($c = 0; $c < count($this->my_users); $c++) {
981  $user = $this->my_users[$c];
982  if ($user->GetUserLevel() == _USER_LEVEL_SERVICE_BODY_ADMIN) {
983  array_push($ret, $user);
984  }
985  }
986 
987  return $ret;
988  }
989 
990  /********************************************************************************************************//**
991  \brief This gets just the Service Body Editor (Trainee) Users, and returns their objects in an array.
992  \returns An array with the user objects (instances of c_comdef_user)
993  ************************************************************************************************************/
994  // phpcs:disable PSR1.Methods.CamelCapsMethodName.NotCamelCaps
995  public function get_basic_editor_users()
996  {
997  // phpcs:enable PSR1.Methods.CamelCapsMethodName.NotCamelCaps
998  $ret = array ();
999 
1000  for ($c = 0; $c < count($this->my_users); $c++) {
1001  $user = $this->my_users[$c];
1002  if ($user->GetUserLevel() == _USER_LEVEL_EDITOR) {
1003  array_push($ret, $user);
1004  }
1005  }
1006 
1007  return $ret;
1008  }
1009 
1010  /********************************************************************************************************//**
1011  \brief This gets just the Observer Users, and returns their objects in an array.
1012  \returns An array with the user objects (instances of c_comdef_user)
1013  ************************************************************************************************************/
1014  // phpcs:disable PSR1.Methods.CamelCapsMethodName.NotCamelCaps
1015  public function get_observer_users()
1016  {
1017  // phpcs:enable PSR1.Methods.CamelCapsMethodName.NotCamelCaps
1018  $ret = array ();
1019 
1020  for ($c = 0; $c < count($this->my_users); $c++) {
1021  $user = $this->my_users[$c];
1022  if ($user->GetUserLevel() == _USER_LEVEL_OBSERVER) {
1023  array_push($ret, $user);
1024  }
1025  }
1026 
1027  return $ret;
1028  }
1029 
1030  /********************************************************************************************************//**
1031  \brief This creates the HTML for a Service body parent selection popup menu.
1032  \returns The HTML and JavaScript for the popup menu (select element).
1033  ************************************************************************************************************/
1034  // phpcs:disable PSR1.Methods.CamelCapsMethodName.NotCamelCaps
1035  public function create_service_body_parent_popup()
1036  {
1037  // phpcs:enable PSR1.Methods.CamelCapsMethodName.NotCamelCaps
1038  $ret = '<select id="bmlt_admin_single_service_body_editor_parent_select" class="bmlt_admin_single_service_body_editor_parent_select" onchange="admin_handler_object.recalculateServiceBody();">'.(defined('__DEBUG_MODE__') ? "\n" : '');
1039 
1040  $ret .= '<option id="parent_popup_option_0" selected="selected" value="0">'.htmlspecialchars($this->my_localized_strings['comdef_server_admin_strings']['service_body_parent_popup_no_parent_option']).'</option>'.(defined('__DEBUG_MODE__') ? "\n" : '');
1041 
1042  for ($index = 0; $index < count($this->my_editable_service_bodies); $index++) {
1043  $service_body = $this->my_editable_service_bodies[$index];
1044  $ret .= '<option id="parent_popup_option_'.$service_body->GetID().'" value="'.$service_body->GetID().'">'.htmlspecialchars($service_body->GetLocalName()).'</option>'.(defined('__DEBUG_MODE__') ? "\n" : '');
1045  }
1046  $ret .= '</select>'.(defined('__DEBUG_MODE__') ? "\n" : '');
1047 
1048  return $ret;
1049  }
1050 
1051  /********************************************************************************************************//**
1052  \brief This creates the HTML for a Service body selection popup menu.
1053  \returns The HTML and JavaScript for the popup menu (select element).
1054  ************************************************************************************************************/
1055  // phpcs:disable PSR1.Methods.CamelCapsMethodName.NotCamelCaps
1056  public function create_service_body_popup()
1057  {
1058  // phpcs:enable PSR1.Methods.CamelCapsMethodName.NotCamelCaps
1059  $ret = '<select id="bmlt_admin_single_service_body_editor_sb_select" class="bmlt_admin_single_service_body_editor_sb_select" onchange="admin_handler_object.populateServiceBodyEditor();">'.(defined('__DEBUG_MODE__') ? "\n" : '');
1060  $first = true;
1061 
1062  for ($index = 0; $index < count($this->my_editable_service_bodies); $index++) {
1063  $service_body = $this->my_editable_service_bodies[$index];
1064  $ret .= '<option value="'.$service_body->GetID().'"';
1065  if ($first) {
1066  $ret .= ' selected="selected"';
1067  $first = false;
1068  }
1069  $ret .= '>'.htmlspecialchars($service_body->GetLocalName()).'</option>'.(defined('__DEBUG_MODE__') ? "\n" : '');
1070  }
1071 
1072  // Service body admin adds a special one at the end for creating a new one.
1073  if ($this->my_user->GetUserLevel() == _USER_LEVEL_SERVER_ADMIN) {
1074  if (!$first) {
1075  $ret .= '<option value="" disabled="disabled"></option>';
1076  }
1077 
1078  $ret .= '<option value="0"';
1079 
1080  if ($first) {
1081  $ret .= ' selected="selected"';
1082  }
1083 
1084  $ret .= '>'.htmlspecialchars($this->my_localized_strings['comdef_server_admin_strings']['service_body_editor_create_new_sb_option']).'</option>'.(defined('__DEBUG_MODE__') ? "\n" : '');
1085  }
1086  $ret .= '</select>'.(defined('__DEBUG_MODE__') ? "\n" : '');
1087 
1088  return $ret;
1089  }
1090 
1091  /********************************************************************************************************//**
1092  \brief This creates the HTML for a Service body selection popup menu.
1093  \returns The HTML and JavaScript for the popup menu (select element).
1094  ************************************************************************************************************/
1095  // phpcs:disable PSR1.Methods.CamelCapsMethodName.NotCamelCaps
1096  public function create_service_body_type_popup()
1097  {
1098  // phpcs:enable PSR1.Methods.CamelCapsMethodName.NotCamelCaps
1099  $ret = '<select id="bmlt_admin_single_service_body_editor_type_select" class="bmlt_admin_single_service_body_editor_type_select" onchange="admin_handler_object.recalculateServiceBody();">';
1100  $ret .= '<option value="GR">';
1101  $ret .= htmlspecialchars($this->my_localized_strings['comdef_server_admin_strings']['service_body_editor_type_c_comdef_service_body__GRP__']);
1102  $ret .= '</option>';
1103  $ret .= '<option value="CO">';
1104  $ret .= htmlspecialchars($this->my_localized_strings['comdef_server_admin_strings']['service_body_editor_type_c_comdef_service_body__COP__']);
1105  $ret .= '</option>';
1106  $ret .= '<option value="GS">';
1107  $ret .= htmlspecialchars($this->my_localized_strings['comdef_server_admin_strings']['service_body_editor_type_c_comdef_service_body__GSU__']);
1108  $ret .= '</option>';
1109  $ret .= '<option value="LS">';
1110  $ret .= htmlspecialchars($this->my_localized_strings['comdef_server_admin_strings']['service_body_editor_type_c_comdef_service_body__LSU__']);
1111  $ret .= '</option>';
1112  $ret .= '<option value="AS">';
1113  $ret .= htmlspecialchars($this->my_localized_strings['comdef_server_admin_strings']['service_body_editor_type_c_comdef_service_body__ASC__']);
1114  $ret .= '</option>';
1115  $ret .= '<option value="MA">';
1116  $ret .= htmlspecialchars($this->my_localized_strings['comdef_server_admin_strings']['service_body_editor_type_c_comdef_service_body__MAS__']);
1117  $ret .= '</option>';
1118  $ret .= '<option value="RS">';
1119  $ret .= htmlspecialchars($this->my_localized_strings['comdef_server_admin_strings']['service_body_editor_type_c_comdef_service_body__RSC__']);
1120  $ret .= '</option>';
1121  $ret .= '<option value="ZF">';
1122  $ret .= htmlspecialchars($this->my_localized_strings['comdef_server_admin_strings']['service_body_editor_type_c_comdef_service_body__ZFM__']);
1123  $ret .= '</option>';
1124  $ret .= '<option value="WS">';
1125  $ret .= htmlspecialchars($this->my_localized_strings['comdef_server_admin_strings']['service_body_editor_type_c_comdef_service_body__WSC__']);
1126  $ret .= '</option>';
1127  $ret .= '</select>';
1128 
1129  return $ret;
1130  }
1131 
1132  /********************************************************************************************************//**
1133  \brief This returns the user name for a given user ID.
1134  \returns a string, containing the name.
1135  ************************************************************************************************************/
1136  // phpcs:disable PSR1.Methods.CamelCapsMethodName.NotCamelCaps
1137  public function get_user_name_from_id($in_user_id ///< The ID to look up.
1138  )
1139  {
1140  // phpcs:enable PSR1.Methods.CamelCapsMethodName.NotCamelCaps
1141  $ret = null;
1142 
1143  for ($index = 0; $index < count($this->my_users); $index++) {
1144  $user = $this->my_users[$index];
1145  if ($user->GetID() == $in_user_id) {
1146  $ret = $user->GetLocalName();
1147  break;
1148  }
1149  }
1150 
1151  return $ret;
1152  }
1153 
1154  /********************************************************************************************************//**
1155  \brief This creates the HTML for a Service body selection popup menu.
1156  \returns The HTML and JavaScript for the popup menu (select element).
1157  ************************************************************************************************************/
1158  // phpcs:disable PSR1.Methods.CamelCapsMethodName.NotCamelCaps
1159  public function create_service_body_user_popup()
1160  {
1161  // phpcs:enable PSR1.Methods.CamelCapsMethodName.NotCamelCaps
1162  $ret = '<select id="bmlt_admin_single_service_body_editor_principal_user_select" class="bmlt_admin_single_service_body_editor_principal_user_select" onchange="admin_handler_object.recalculateServiceBody();">';
1163 
1164  for ($index = 0; $index < count($this->my_users); $index++) {
1165  $user = $this->my_users[$index];
1166  if ($user->GetUserLevel() == _USER_LEVEL_SERVICE_BODY_ADMIN) {
1167  $ret .= '<option value="'.$user->GetID().'">'.htmlspecialchars($user->GetLocalName()).'</option>'.(defined('__DEBUG_MODE__') ? "\n" : '');
1168  }
1169  }
1170  $ret .= '</select>';
1171 
1172  return $ret;
1173  }
1174 
1175  /********************************************************************************************************//**
1176  \brief This constructs the Service body editor buttons as a div.
1177  \returns The HTML and JavaScript for the button panel.
1178  ************************************************************************************************************/
1179  // phpcs:disable PSR1.Methods.CamelCapsMethodName.NotCamelCaps
1180  public function return_service_body_editor_button_panel()
1181  {
1182  // phpcs:enable PSR1.Methods.CamelCapsMethodName.NotCamelCaps
1183  $ret = '<div class="bmlt_admin_service_body_editor_button_div">';
1184  $ret .= '<span class="bmlt_admin_meeting_editor_form_meeting_button_left_span">';
1185  $ret .= '<a id="bmlt_admin_service_body_editor_form_service_body_save_button" href="javascript:admin_handler_object.saveServiceBody();" class="bmlt_admin_ajax_button button_disabled">'.htmlspecialchars($this->my_localized_strings['comdef_server_admin_strings']['service_body_save_button']).'</a>';
1186  $ret .= '<span id="bmlt_admin_service_body_save_ajax_button_throbber_span" class="bmlt_admin_ajax_button_throbber_span item_hidden"><img src="local_server/server_admin/style/images/ajax-throbber-white.gif" alt="AJAX Throbber" /></span>';
1187  $ret .= '</span>';
1188  if ($this->my_user->GetUserLevel() == _USER_LEVEL_SERVER_ADMIN) {
1189  $ret .= '<span id="service_body_editor_delete_span" class="bmlt_admin_meeting_editor_form_middle_button_single_span bmlt_admin_delete_button_span hide_in_new_service_body_admin">';
1190  $ret .= '<a id="bmlt_admin_meeting_editor_form_service_body_delete_button" href="javascript:admin_handler_object.deleteServiceBody();" class="bmlt_admin_ajax_button button">'.htmlspecialchars($this->my_localized_strings['comdef_server_admin_strings']['service_body_delete_button']).'</a>';
1191  $ret .= '<span id="bmlt_admin_service_body_delete_ajax_button_throbber_span" class="bmlt_admin_ajax_button_throbber_span item_hidden"><img src="local_server/server_admin/style/images/ajax-throbber-white.gif" alt="AJAX Throbber" /></span>';
1192  $ret .= '<span class="perm_checkbox_span">';
1193  $ret .= '<input type="checkbox" id="bmlt_admin_service_body_delete_perm_checkbox" />';
1194  $ret .= '<label for="bmlt_admin_service_body_delete_perm_checkbox">'.htmlspecialchars($this->my_localized_strings['comdef_server_admin_strings']['service_body_delete_perm_checkbox']).'</label>';
1195  $ret .= '</span>';
1196  $ret .= '</span>';
1197  }
1198  $ret .= '<span class="bmlt_admin_meeting_editor_form_meeting_button_right_span"><a id="bmlt_admin_service_body_editor_form_meeting_template_cancel_button" href="javascript:admin_handler_object.cancelServiceBodyEdit();" class="bmlt_admin_ajax_button button_disabled">'.htmlspecialchars($this->my_localized_strings['comdef_server_admin_strings']['service_body_cancel_button']).'</a></span>';
1199  $ret .= '<div class="clear_both"></div>';
1200  $ret .= '</div>';
1201 
1202  return $ret;
1203  }
1204 
1205  /********************************************************************************************************//**
1206  \brief This constructs the meeting editor section of the console. Most user levels (not observers) have it.
1207  \returns The HTML and JavaScript for the "Edit Meetings" section.
1208  ************************************************************************************************************/
1209  // phpcs:disable PSR1.Methods.CamelCapsMethodName.NotCamelCaps
1210  public function return_meeting_editor_panel()
1211  {
1212  // phpcs:enable PSR1.Methods.CamelCapsMethodName.NotCamelCaps
1213  $ret = '';
1214 
1215  $can_edit = false;
1216 
1217  for ($c = 0; $c < count($this->my_service_bodies); $c++) {
1218  if ($this->my_service_bodies[$c]->UserCanEditMeetings()) {
1219  $can_edit = true;
1220  }
1221  }
1222 
1223  if ($can_edit) {
1224  $ret = '<div id="bmlt_admin_meeting_editor_disclosure_div" class="bmlt_admin_meeting_editor_disclosure_div bmlt_admin_meeting_editor_disclosure_div_closed">';
1225  $ret .= '<a class="bmlt_admin_meeting_editor_disclosure_a" href="javascript:admin_handler_object.toggleMeetingEditor();">';
1226  $ret .= htmlspecialchars($this->my_localized_strings['comdef_server_admin_strings']['meeting_editor_disclosure']);
1227  $ret .= '</a>';
1228  $ret .= '</div>';
1229  $ret .= '<div id="bmlt_admin_meeting_editor_wrapper_div" class="bmlt_admin_meeting_editor_wrapper_div bmlt_admin_meeting_editor_wrapper_div_hidden">';
1230  $ret .= '<div class="bmlt_admin_meeting_editor_banner_div">';
1231  $ret .= '<div class="bmlt_admin_meeting_editor_banner_container_div">';
1232  $ret .= '<div class="bmlt_admin_fader_div item_hidden" id="bmlt_admin_fader_meeting_editor_warn_div">';
1233  $ret .= '<span class="warn_text_span">'.htmlspecialchars($this->my_localized_strings['comdef_server_admin_strings']['need_refresh_message_fader_text']).'</span>';
1234  $ret .= '</div>'.(defined('__DEBUG_MODE__') ? "\n" : '');
1235  $ret .= '<div class="bmlt_admin_fader_div item_hidden" id="bmlt_admin_fader_meeting_editor_success_div">';
1236  $ret .= '<span class="success_text_span">'.htmlspecialchars($this->my_localized_strings['comdef_server_admin_strings']['meeting_change_fader_success_text']).'</span>';
1237  $ret .= '</div>';
1238  $ret .= '<div class="bmlt_admin_fader_div item_hidden" id="bmlt_admin_fader_meeting_editor_delete_success_div">';
1239  $ret .= '<span class="success_text_span">'.htmlspecialchars($this->my_localized_strings['comdef_server_admin_strings']['meeting_change_fader_success_delete_text']).'</span>';
1240  $ret .= '</div>';
1241  $ret .= '<div class="bmlt_admin_fader_div item_hidden" id="bmlt_admin_fader_meeting_editor_add_success_div">';
1242  $ret .= '<span class="success_text_span">'.htmlspecialchars($this->my_localized_strings['comdef_server_admin_strings']['meeting_change_fader_success_add_text']).'</span>';
1243  $ret .= '</div>';
1244  $ret .= '<div class="bmlt_admin_fader_div item_hidden" id="bmlt_admin_fader_meeting_editor_delete_fail_div">';
1245  $ret .= '<span class="failure_text_span">'.htmlspecialchars($this->my_localized_strings['comdef_server_admin_strings']['meeting_change_fader_fail_delete_text']).'</span>';
1246  $ret .= '</div>';
1247  $ret .= '<div class="bmlt_admin_fader_div item_hidden" id="bmlt_admin_fader_meeting_editor_fail_div">';
1248  $ret .= '<span class="failure_text_span">'.htmlspecialchars($this->my_localized_strings['comdef_server_admin_strings']['meeting_change_fader_failure_text']).'</span>';
1249  $ret .= '</div>';
1250  $ret .= '<div class="bmlt_admin_fader_div item_hidden" id="bmlt_admin_fader_meeting_editor_add_fail_div">';
1251  $ret .= '<span class="failure_text_span">'.htmlspecialchars($this->my_localized_strings['comdef_server_admin_strings']['meeting_change_fader_fail_add_text']).'</span>';
1252  $ret .= '</div>';
1253  $ret .= '</div>';
1254  $ret .= '</div>';
1255  $ret .='<div class="bmlt_admin_meeting_editor_tab_div">';
1256  $ret .= $this->return_meeting_editor_tab_div();
1257  $ret .= '</div>';
1258  $ret .='<div class="bmlt_admin_meeting_editor_inner_div">';
1259  $ret .= $this->return_meeting_specification_panel();
1260  $ret .= $this->return_meeting_editor_meetings_panel();
1261  $ret .= '</div>';
1262  $ret .= '<div class="clear_both"></div>';
1263  $ret .= '</div>';
1264  }
1265 
1266  return $ret;
1267  }
1268 
1269  /********************************************************************************************************//**
1270  \brief This constructs the tab div that allows the user to select between a search and results.
1271  \returns The HTML and JavaScript for the Meeting Editor Tabs
1272  ************************************************************************************************************/
1273  // phpcs:disable PSR1.Methods.CamelCapsMethodName.NotCamelCaps
1274  public function return_meeting_editor_tab_div()
1275  {
1276  // phpcs:enable PSR1.Methods.CamelCapsMethodName.NotCamelCaps
1277  $ret ='<div id="bmlt_admin_meeting_editor_tab_specifier_div" class="bmlt_admin_tab_div_left bmlt_admin_tab_div_selected">'; // The link for the search specifier.
1278  $ret .= '<a id="bmlt_admin_meeting_editor_tab_specifier_a">';
1279  $ret .= htmlspecialchars($this->my_localized_strings['comdef_server_admin_strings']['meeting_editor_tab_specifier_text']);
1280  $ret .= '</a>';
1281  $ret .= '</div>';
1282  $ret .='<div id="bmlt_admin_meeting_editor_tab_results_div" class="bmlt_admin_tab_div_right bmlt_admin_tab_div_not_selected">'; // The link for the results/editor.
1283  $ret .= '<a id="bmlt_admin_meeting_editor_tab_results_a" href="javascript:admin_handler_object.selectMeetingEditorTab();">';
1284  $ret .= htmlspecialchars($this->my_localized_strings['comdef_server_admin_strings']['meeting_editor_tab_editor_text']);
1285  $ret .= '</a>';
1286  $ret .= '</div>';
1287  $ret .= '<div class="clear_both"></div>';
1288  return $ret;
1289  }
1290 
1291  /********************************************************************************************************//**
1292  \brief This constructs the meeting search specification panel of the meeting editor.
1293  \returns The HTML and JavaScript for the Edit Meetings Search Specifier section.
1294  ************************************************************************************************************/
1295  // phpcs:disable PSR1.Methods.CamelCapsMethodName.NotCamelCaps
1296  public function return_meeting_specification_panel()
1297  {
1298  // phpcs:enable PSR1.Methods.CamelCapsMethodName.NotCamelCaps
1299  $ret = '<div id="bmlt_admin_meeting_editor_form_specifier_div" class="bmlt_admin_meeting_editor_form_specifier_div">';
1300  $ret .= '<div class="bmlt_admin_one_line_in_a_form clear_both">';
1301  $ret .= '<span class="bmlt_admin_med_label_right">'.htmlspecialchars($this->my_localized_strings['comdef_server_admin_strings']['meeting_text_input_label']).'</span>';
1302  $ret .= '<span class="bmlt_admin_value_left"><input name="bmlt_admin_text_specifier_input" id="bmlt_admin_text_specifier_input" type="text" value="'.htmlspecialchars($this->my_localized_strings['comdef_server_admin_strings']['meeting_text_input_default_text']).'" onkeyup="admin_handler_object.handleTextInputChange(this);" onchange="admin_handler_object.handleTextInputChange(this);" onfocus="admin_handler_object.handleTextInputFocus(this);" onblur="admin_handler_object.handleTextInputBlur(this);" /></span>';
1303  $ret .= '<script type="text/javascript">';
1304  $ret .= 'document.getElementById (\'bmlt_admin_text_specifier_input\').onkeypress = BMLT_Admin_keyDown;';
1305  $ret .= 'admin_handler_object.handleTextInputLoad(document.getElementById(\'bmlt_admin_text_specifier_input\'),\''.htmlspecialchars($this->my_localized_strings['comdef_server_admin_strings']['meeting_text_input_default_text']).'\');';
1306  $ret .= '</script>';
1307  $ret .= '<div class="clear_both"></div>';
1308  $ret .= '</div>';
1309  $ret .= '<div class="bmlt_admin_one_line_in_a_form_no_margin">';
1310  $ret .= '<span class="bmlt_admin_med_label_right"><input type="checkbox" id="bmlt_admin_meeting_search_text_is_a_location_checkbox" /></span>';
1311  $ret .= '<label class="bmlt_admin_med_label_left" for="bmlt_admin_meeting_search_text_is_a_location_checkbox">'.htmlspecialchars($this->my_localized_strings['comdef_server_admin_strings']['meeting_text_location_label']).'</label>';
1312  $ret .= '<div class="clear_both"></div>';
1313  $ret .= '</div>';
1314  $ret .= '<div class="bmlt_admin_one_line_in_a_form clear_both">';
1315  $ret .= '<span class="bmlt_admin_med_label_right">'.htmlspecialchars($this->my_localized_strings['comdef_server_admin_strings']['meeting_search_weekdays_label']).'</span>';
1316  $ret .= '<div class="bmlt_admin_value_left_div">';
1317  for ($c = 0; $c < 8; $c++) {
1318  $ret .= '<span class="single_checkbox_span weekday_checkbox_span">';
1319  $ret .= '<input checked="checked" type="checkbox" id="bmlt_admin_meeting_search_weekday_checkbox_'.$c.'" onclick="admin_handler_object.handleWeekdayCheckBoxChanges('.$c.');" onchange="admin_handler_object.handleWeekdayCheckBoxChanges('.$c.');" />'.(defined('__DEBUG_MODE__') ? "\n" : '');
1320  $ret .= '<label class="bmlt_admin_med_checkbox_label_left" for="bmlt_admin_meeting_search_weekday_checkbox_'.$c.'">'.htmlspecialchars($this->my_localized_strings['comdef_server_admin_strings']['meeting_search_weekdays_names'][$c]).'</label>'.(defined('__DEBUG_MODE__') ? "\n" : '');
1321  $ret .= '</span>';
1322  }
1323  $ret .= '</div>';
1324  $ret .= '<div class="clear_both"></div>';
1325  $ret .= '</div>';
1326  $ret .= $this->return_meeting_start_time_selection_panel();
1327  if (count($this->my_service_bodies) > 1) {
1328  $ret .= $this->return_meeting_service_body_selection_panel();
1329  }
1330  $ret .= '<div class="bmlt_admin_one_line_in_a_form clear_both">';
1331  $ret .= '<span class="bmlt_admin_med_label_right">'.htmlspecialchars($this->my_localized_strings['comdef_server_admin_strings']['meeting_editor_screen_meeting_publish_search_prompt']).'</span>';
1332  $ret .= '<div class="bmlt_admin_value_left_div">';
1333  $ret .= '<select id="bmlt_admin_single_meeting_editor_template_meeting_publish_search_select">';
1334  $ret .= '<option value ="-1">'.htmlspecialchars($this->my_localized_strings['comdef_server_admin_strings']['meeting_editor_screen_meeting_publish_search_unpub']).'</option>';
1335  $ret .= '<option value ="0" selected="selected">'.htmlspecialchars($this->my_localized_strings['comdef_server_admin_strings']['meeting_editor_screen_meeting_publish_search_all']).'</option>';
1336  $ret .= '<option value ="1">'.htmlspecialchars($this->my_localized_strings['comdef_server_admin_strings']['meeting_editor_screen_meeting_publish_search_pub']).'</option>';
1337  $ret .= '</select>';
1338  $ret .= '</div>';
1339  $ret .= '<div class="clear_both"></div>';
1340  $ret .= '</div>';
1341  $ret .= '<div class="bmlt_admin_one_line_in_a_form clear_both">';
1342  $ret .= '<span class="bmlt_admin_med_label_right">&nbsp;</span>';
1343  $ret .= '<span id="bmlt_admin_meeting_search_ajax_button_span" class="bmlt_admin_value_left">';
1344  $ret .= '<a id="bmlt_admin_meeting_search_ajax_button_a" href="javascript:admin_handler_object.searchForMeetings();" class="bmlt_admin_ajax_button button">'.htmlspecialchars($this->my_localized_strings['comdef_server_admin_strings']['meeting_editor_tab_specifier_text']).'</a>';
1345  $ret .= '</span>';
1346  $ret .= '<span id="bmlt_admin_meeting_search_ajax_button_throbber_span" class="bmlt_admin_value_left item_hidden"><img src="local_server/server_admin/style/images/ajax-throbber-white.gif" alt="AJAX Throbber" /></span>';
1347  $ret .= '<div class="clear_both"></div>';
1348  $ret .= '</div>';
1349  $ret .= '<div class="clear_both"></div>';
1350  $ret .= '</div>';
1351 
1352  return $ret;
1353  }
1354 
1355  /********************************************************************************************************//**
1356  \brief This constructs a panel that displays a choice of Service bodies for the user to choose.
1357  \returns The HTML and JavaScript for the Edit Meetings Search Specifier section.
1358  ************************************************************************************************************/
1359  // phpcs:disable PSR1.Methods.CamelCapsMethodName.NotCamelCaps
1360  public function return_meeting_start_time_selection_panel()
1361  {
1362  // phpcs:enable PSR1.Methods.CamelCapsMethodName.NotCamelCaps
1363  $ret = '<div class="bmlt_admin_one_line_in_a_form clear_both">';
1364  $ret .= '<span class="bmlt_admin_med_label_right">'.htmlspecialchars($this->my_localized_strings['comdef_server_admin_strings']['meeting_search_start_time_label']).'</span>';
1365  $ret .= '<div class="bmlt_admin_value_left_div">';
1366  $ret .= '<span class="single_checkbox_span">';
1367  $ret .= '<input type="radio" name="bmlt_admin_meeting_search_start_time_radiogroup" checked="checked" id="bmlt_admin_meeting_search_start_time_all_checkbox" />';
1368  $ret .= '<label class="bmlt_admin_med_checkbox_label_left" for="bmlt_admin_meeting_search_start_time_all_checkbox">'.htmlspecialchars($this->my_localized_strings['comdef_server_admin_strings']['meeting_search_start_time_all_label']).'</label>';
1369  $ret .= '</span>';
1370  $ret .= '<span class="single_checkbox_span">';
1371  $ret .= '<input type="radio" name="bmlt_admin_meeting_search_start_time_radiogroup" id="bmlt_admin_meeting_search_start_time_morn_checkbox" />';
1372  $ret .= '<label class="bmlt_admin_med_checkbox_label_left" for="bmlt_admin_meeting_search_start_time_morn_checkbox">'.htmlspecialchars($this->my_localized_strings['comdef_server_admin_strings']['meeting_search_start_time_morn_label']).'</label>';
1373  $ret .= '</span>';
1374  $ret .= '<span class="single_checkbox_span">';
1375  $ret .= '<input type="radio" name="bmlt_admin_meeting_search_start_time_radiogroup" id="bmlt_admin_meeting_search_start_time_aft_checkbox" />';
1376  $ret .= '<label class="bmlt_admin_med_checkbox_label_left" for="bmlt_admin_meeting_search_start_time_aft_checkbox">'.htmlspecialchars($this->my_localized_strings['comdef_server_admin_strings']['meeting_search_start_time_aft_label']).'</label>';
1377  $ret .= '</span>';
1378  $ret .= '<span class="single_checkbox_span">';
1379  $ret .= '<input type="radio" name="bmlt_admin_meeting_search_start_time_radiogroup" id="bmlt_admin_meeting_search_start_time_eve_checkbox" />';
1380  $ret .= '<label class="bmlt_admin_med_checkbox_label_left" for="bmlt_admin_meeting_search_start_time_eve_checkbox">'.htmlspecialchars($this->my_localized_strings['comdef_server_admin_strings']['meeting_search_start_time_eve_label']).'</label>';
1381  $ret .= '</span>';
1382  $ret .= '</div>';
1383  $ret .= '<div class="clear_both"></div>';
1384  $ret .= '</div>';
1385 
1386  return $ret;
1387  }
1388 
1389  /********************************************************************************************************//**
1390  \brief This constructs a panel that displays a choice of Service bodies for the user to choose.
1391  \returns The HTML and JavaScript for the Edit Meetings Search Specifier section.
1392  ************************************************************************************************************/
1393  // phpcs:disable PSR1.Methods.CamelCapsMethodName.NotCamelCaps
1394  public function return_meeting_service_body_selection_panel()
1395  {
1396  // phpcs:enable PSR1.Methods.CamelCapsMethodName.NotCamelCaps
1397  $ret = 'NOT AUTHORIZED';
1398 
1399  if (count($this->my_service_bodies)) {
1400  $ret = '<div class="bmlt_admin_one_line_in_a_form clear_both">';
1401  $ret .= '<span class="bmlt_admin_med_label_right">'.htmlspecialchars($this->my_localized_strings['comdef_server_admin_strings']['meeting_search_service_bodies_label']).'</span>';
1402  $ret .= '<div id="bmlt_admin_meeting_editor_service_div" class="bmlt_admin_meeting_editor_service_div">';
1403  $ret .= '<div id="bmlt_admin_meeting_editor_service_check_all_div" class="bmlt_admin_meeting_editor_service_check_all_div">';
1404  $ret .= '<button onclick="admin_handler_object.checkAllServiceBodies(this);">Uncheck All</button>';
1405  $ret .= '</div>';
1406  $ret .= $this->populate_service_bodies(0);
1407  $ret .= '</div>';
1408  $ret .= '<div class="clear_both"></div>';
1409  $ret .= '</div>';
1410  }
1411 
1412  return $ret;
1413  }
1414 
1415  /************************************************************************************//**
1416  \brief Build the content for the Advanced Service Bodies section.
1417  ****************************************************************************************/
1418  // phpcs:disable PSR1.Methods.CamelCapsMethodName.NotCamelCaps
1419  public function populate_service_bodies( $in_id ///< The ID of the Service body.
1420  )
1421  {
1422  // phpcs:enable PSR1.Methods.CamelCapsMethodName.NotCamelCaps
1423  $service_body_content = '';
1424  $child_content = '';
1425 
1426  foreach ($this->my_all_service_bodies as $service_body) {
1427  if ($in_id == $service_body->GetID()) {
1428  if ($service_body->UserCanEditMeetings()) {
1429  $service_body_content = '<span class="single_checkbox_span">';
1430  $service_body_content .= '<input type="checkbox" checked="checked" id="bmlt_admin_meeting_search_service_body_checkbox_'.$in_id.'" onclick="admin_handler_object.handleServiceCheckBoxChanges('.$in_id.');" onchange="admin_handler_object.handleServiceCheckBoxChanges('.$in_id.');" />';
1431  $service_body_content .= '<label class="bmlt_admin_med_checkbox_label_left" for="bmlt_admin_meeting_search_service_body_checkbox_'.$in_id.'">'.htmlspecialchars($service_body->GetLocalName()).'</label>';
1432  $service_body_content .= '</span>';
1433  }
1434  } elseif ($in_id == $service_body->GetOwnerID()) {
1435  $child_content .= $this->populate_service_bodies($service_body->GetID());
1436  }
1437  }
1438 
1439  // At this point, we have the main Service body, as well as any child content.
1440 
1441  if ($service_body_content) {
1442  $service_body_content = '<dt class="service_body_dt'.($child_content != '' ? ' service_body_parent_dt' : '').'">'.$service_body_content.'</dt>'.(defined('__DEBUG_MODE__') ? "\n" : '');
1443  }
1444 
1445  if ($child_content) {
1446  $child_content = '<dd class="bmlt_admin_service_body'.($service_body_content != '' ? '_child' : '').'_dd">'.$child_content.'</dd>'.(defined('__DEBUG_MODE__') ? "\n" : '');
1447  }
1448 
1449  $ret = '';
1450 
1451  if ($service_body_content || $child_content) {
1452  $ret = '<dl class="service_body_dl">'.(defined('__DEBUG_MODE__') ? "\n" : '').$service_body_content.(defined('__DEBUG_MODE__') ? "\n" : '').$child_content.'</dl>'.(defined('__DEBUG_MODE__') ? "\n" : '');
1453  }
1454 
1455  return $ret;
1456  }
1457 
1458  /********************************************************************************************************//**
1459  \brief This constructs the combined new meetings/search results panel.
1460  \returns The HTML and JavaScript for the Edit Meetings Search Results section.
1461  ************************************************************************************************************/
1462  // phpcs:disable PSR1.Methods.CamelCapsMethodName.NotCamelCaps
1463  public function return_meeting_editor_meetings_panel()
1464  {
1465  // phpcs:enable PSR1.Methods.CamelCapsMethodName.NotCamelCaps
1466  if (($this->my_user->GetUserLevel() == _USER_LEVEL_EDITOR) || ($this->my_user->GetUserLevel() == _USER_LEVEL_SERVICE_BODY_ADMIN) || ($this->my_user->GetUserLevel() == _USER_LEVEL_SERVER_ADMIN)) {
1467  $ret = '<div id="bmlt_admin_meeting_editor_form_div" class="bmlt_admin_meeting_editor_form_div item_hidden">';
1468  $ret .= '<div class="bmlt_admin_meeting_editor_form_inner_div">';
1469  $ret .= $this->return_single_meeting_editor_template();
1470  $ret .= $this->return_new_meeting_panel();
1471  $ret .= $this->return_meeting_results_panel();
1472  $ret .= '</div>';
1473  $ret .= '</div>';
1474  } else {
1475  die('THIS USER NOT AUTHORIZED TO EDIT MEETINGS');
1476  }
1477 
1478  return $ret;
1479  }
1480 
1481  /********************************************************************************************************//**
1482  \brief This constructs a panel for creating new meetings that goes above the results.
1483  \returns The HTML and JavaScript for the New Meetings section.
1484  ************************************************************************************************************/
1485  // phpcs:disable PSR1.Methods.CamelCapsMethodName.NotCamelCaps
1486  public function return_new_meeting_panel()
1487  {
1488  // phpcs:enable PSR1.Methods.CamelCapsMethodName.NotCamelCaps
1489  $ret = '<div id="bmlt_admin_meeting_editor_form_new_meetings_div" class="bmlt_admin_meeting_editor_form_new_meetings_div">';
1490  $ret .= '<div class="bmlt_admin_meeting_editor_form_meetings_inner_div">';
1491  $ret .= '<div class="bmlt_admin_meeting_editor_form_meeting_button_div">';
1492  $ret .= '<span id="bmlt_admin_meeting_ajax_button_span" class="bmlt_admin_meeting_editor_form_meeting_button_single_span"><a id="bmlt_admin_meeting_editor_form_meeting_0_button" href="javascript:admin_handler_object.createANewMeetingButtonHit(this);" class="bmlt_admin_ajax_button button">'.htmlspecialchars($this->my_localized_strings['comdef_server_admin_strings']['meeting_editor_screen_meeting_create_button']).'</a></span>';
1493  $ret .= '<div class="clear_both"></div>';
1494  $ret .= '<div id="bmlt_admin_meeting_editor_new_meeting_0_editor_display" class="bmlt_admin_meeting_editor_meeting_editor_display item_hidden"></div>';
1495  $ret .= '<div class="clear_both"></div>';
1496  $ret .= '</div>';
1497  $ret .= '</div>';
1498  $ret .= '</div>';
1499 
1500  return $ret;
1501  }
1502 
1503  /********************************************************************************************************//**
1504  \brief This constructs the meeting search results panel of the meeting editor.
1505  \returns The HTML and JavaScript for the Search Results section.
1506  ************************************************************************************************************/
1507  // phpcs:disable PSR1.Methods.CamelCapsMethodName.NotCamelCaps
1508  public function return_meeting_results_panel()
1509  {
1510  // phpcs:enable PSR1.Methods.CamelCapsMethodName.NotCamelCaps
1511  $ret = '<div id="bmlt_admin_meeting_editor_form_results_div" class="bmlt_admin_meeting_editor_form_results_div item_hidden">';
1512  $ret .= '<div id="bmlt_admin_meeting_editor_form_results_banner_div" class="bmlt_admin_meeting_editor_form_results_banner_div"><div class="bmlt_admin_meeting_editor_banner_container_div"></div></div>';
1513  $ret .= '<div id="bmlt_admin_meeting_editor_form_results_inner_div" class="bmlt_admin_meeting_editor_form_results_inner_div">';
1514  $ret .= '</div>';
1515  $ret .= '</div>';
1516 
1517  return $ret;
1518  }
1519 
1520  /********************************************************************************************************//**
1521  \brief This constructs a template to be filled in for a single meeting that will be edited.
1522  \returns The HTML and JavaScript for the "Edit Meetings" section.
1523  ************************************************************************************************************/
1524  // phpcs:disable PSR1.Methods.CamelCapsMethodName.NotCamelCaps
1525  public function return_single_meeting_editor_template()
1526  {
1527  // phpcs:enable PSR1.Methods.CamelCapsMethodName.NotCamelCaps
1528  $ret = '<div id="bmlt_admin_single_meeting_editor_template_div" class="bmlt_admin_single_meeting_editor_div item_hidden">';
1529  $ret .= '<div class="bmlt_admin_single_meeting_outer_div">';
1530  $ret .= '<div id="bmlt_admin_meeting_editor_template_meeting_header" class="bmlt_admin_meeting_editor_meeting_header"></div>';
1531  $ret .= '<div class="bmlt_admin_meeting_inner_div">';
1532  $ret .= '<div class="bmlt_admin_meeting_editor_tab_bar">';
1533  $ret .= '<a href="javascript:admin_handler_object.selectAnEditorTab(0,template);" id="bmlt_admin_meeting_editor_template_tab_item_basic_a" class="bmlt_admin_meeting_editor_tab_item_a_selected">';
1534  $ret .= htmlspecialchars($this->my_localized_strings['comdef_server_admin_strings']['meeting_editor_tab_bar_basic_tab_text']);
1535  $ret .= '</a>';
1536  $ret .= '<a href="javascript:admin_handler_object.selectAnEditorTab(1,template);" id="bmlt_admin_meeting_editor_template_tab_item_location_a" class="bmlt_admin_meeting_editor_tab_item_a_unselected">';
1537  $ret .= htmlspecialchars($this->my_localized_strings['comdef_server_admin_strings']['meeting_editor_tab_bar_location_tab_text']);
1538  $ret .= '</a>';
1539  $ret .= '<a href="javascript:admin_handler_object.selectAnEditorTab(2,template);" id="bmlt_admin_meeting_editor_template_tab_item_format_a" class="bmlt_admin_meeting_editor_tab_item_a_unselected">';
1540  $ret .= htmlspecialchars($this->my_localized_strings['comdef_server_admin_strings']['meeting_editor_tab_bar_format_tab_text']);
1541  $ret .= '</a>';
1542  $ret .= '<a href="javascript:admin_handler_object.selectAnEditorTab(3,template);" id="bmlt_admin_meeting_editor_template_tab_item_other_a" class="bmlt_admin_meeting_editor_tab_item_a_unselected">';
1543  $ret .= htmlspecialchars($this->my_localized_strings['comdef_server_admin_strings']['meeting_editor_tab_bar_other_tab_text']);
1544  $ret .= '</a>';
1545  $ret .= '<a href="javascript:admin_handler_object.selectAnEditorTab(4,template);" id="bmlt_admin_meeting_editor_template_tab_item_history_a" class="bmlt_admin_meeting_editor_tab_item_a_unselected hide_in_new_meeting">';
1546  $ret .= htmlspecialchars($this->my_localized_strings['comdef_server_admin_strings']['meeting_editor_tab_bar_history_tab_text']);
1547  $ret .= '</a>';
1548  $ret .= '</div>';
1549  $ret .= '<div class="clear_both"></div>';
1550  $ret .= $this->return_single_meeting_basic_template();
1551  $ret .= $this->return_single_meeting_location_template();
1552  $ret .= $this->return_single_meeting_format_template();
1553  $ret .= $this->return_single_meeting_other_template();
1554  $ret .= $this->return_single_meeting_history_template();
1555  $ret .= '</div>';
1556  $ret .= $this->return_meeting_editor_button_panel();
1557  $ret .= '</div>';
1558  $ret .= '</div>';
1559 
1560  return $ret;
1561  }
1562 
1563  /********************************************************************************************************//**
1564  \brief This constructs the meeting editor buttons as a div.
1565  \returns The HTML and JavaScript for the button panel.
1566  ************************************************************************************************************/
1567  // phpcs:disable PSR1.Methods.CamelCapsMethodName.NotCamelCaps
1568  public function return_meeting_editor_button_panel()
1569  {
1570  // phpcs:enable PSR1.Methods.CamelCapsMethodName.NotCamelCaps
1571  $ret = '<div class="bmlt_admin_meeting_editor_form_meeting_button_div">';
1572  $ret .= '<span class="bmlt_admin_meeting_editor_form_meeting_button_left_span">';
1573  $ret .= '<a id="bmlt_admin_meeting_editor_form_meeting_template_save_button" href="javascript:admin_handler_object.saveMeeting(template);" class="bmlt_admin_ajax_button button_disabled">'.htmlspecialchars($this->my_localized_strings['comdef_server_admin_strings']['meeting_save_buttonName']).'</a>';
1574  $ret .= '<span id="bmlt_admin_template_save_ajax_button_throbber_span" class="bmlt_admin_ajax_button_throbber_span item_hidden"><img src="local_server/server_admin/style/images/ajax-throbber-white.gif" alt="AJAX Throbber" /></span>';
1575  $ret .= '<span class="duplicate_checkbox_span hide_in_new_meeting">';
1576  $ret .= '<input type="checkbox" id="bmlt_admin_meeting_template_duplicate_checkbox" />';
1577  $ret .= '<label for="bmlt_admin_meeting_template_duplicate_checkbox">'.htmlspecialchars($this->my_localized_strings['comdef_server_admin_strings']['meeting_saved_as_a_copy']).'</label>';
1578  $ret .= '</span>';
1579  $ret .= '</span>';
1580  $ret .= '<span class="bmlt_admin_meeting_editor_form_middle_button_single_span bmlt_admin_delete_button_span hide_in_new_meeting">';
1581  $ret .= '<a id="bmlt_admin_meeting_editor_form_meeting_template_delete_button" href="javascript:admin_handler_object.deleteMeeting(template);" class="bmlt_admin_ajax_button button">'.htmlspecialchars($this->my_localized_strings['comdef_server_admin_strings']['meeting_editor_screen_delete_button']).'</a>';
1582  $ret .= '<span id="bmlt_admin_template_delete_ajax_button_throbber_span" class="bmlt_admin_ajax_button_throbber_span item_hidden"><img src="local_server/server_admin/style/images/ajax-throbber-white.gif" alt="AJAX Throbber" /></span>';
1583  $ret .= '</span>';
1584  $ret .= '<span class="bmlt_admin_meeting_editor_form_meeting_button_right_span"><a id="bmlt_admin_meeting_editor_form_meeting_template_cancel_button" href="javascript:admin_handler_object.cancelMeetingEdit(template);" class="bmlt_admin_ajax_button button">'.htmlspecialchars($this->my_localized_strings['comdef_server_admin_strings']['meeting_editor_screen_cancel_button']).'</a></span>';
1585  $ret .= '<div class="clear_both"></div>';
1586  $ret .= '</div>';
1587 
1588  return $ret;
1589  }
1590 
1591  /********************************************************************************************************//**
1592  \brief This constructs a template to be filled in for the basic options tab.
1593  \returns The HTML and JavaScript for the option sheet.
1594  ************************************************************************************************************/
1595  // phpcs:disable PSR1.Methods.CamelCapsMethodName.NotCamelCaps
1596  public function return_single_meeting_basic_template()
1597  {
1598  // phpcs:enable PSR1.Methods.CamelCapsMethodName.NotCamelCaps
1599  if (($this->my_user->GetUserLevel() == _USER_LEVEL_EDITOR) || ($this->my_user->GetUserLevel() == _USER_LEVEL_SERVICE_BODY_ADMIN) || ($this->my_user->GetUserLevel() == _USER_LEVEL_SERVER_ADMIN)) {
1600  $ret = '<div id="bmlt_admin_meeting_template_basic_sheet_div" class="bmlt_admin_meeting_option_sheet_div">';
1601 
1602  if ($this->my_user->GetUserLevel() != _USER_LEVEL_EDITOR) {
1603  $ret .= '<div class="bmlt_admin_one_line_in_a_form clear_both">';
1604  $ret .= '<span class="bmlt_admin_med_label_right"><input type="checkbox" id="bmlt_admin_meeting_template_published_checkbox" /></span>';
1605  $ret .= '<label class="bmlt_admin_med_label_left" for="bmlt_admin_meeting_template_published_checkbox">'.htmlspecialchars($this->my_localized_strings['comdef_server_admin_strings']['meeting_is_published']).'</label>';
1606  $ret .= '<div class="clear_both"></div>';
1607  $ret .= '</div>';
1608 
1609  $ret .= '<div class="bmlt_admin_one_line_in_a_form clear_both" id="bmlt_admin_meeting_template_unpublished_note_div">';
1610  $ret .= '<span class="bmlt_admin_med_label_right">&nbsp;</span>';
1611  $ret .= '<span class="bmlt_admin_value_left bmlt_admin_unpublished_note_span">'.htmlspecialchars($this->my_localized_strings['comdef_server_admin_strings']['meeting_unpublished_note']).'</span>';
1612  $ret .= '<div class="clear_both"></div>';
1613  $ret .= '</div>';
1614  }
1615  $ret .= '<div class="bmlt_admin_one_line_in_a_form clear_both hide_in_new_meeting">';
1616  $ret .= '<span class="bmlt_admin_med_label_right">'.htmlspecialchars($this->my_localized_strings['comdef_server_admin_strings']['meeting_id_label']).'</span>';
1617  $ret .= '<span class="bmlt_admin_value_left light_italic_display" id="bmlt_admin_meeting_id_template_display"></span>';
1618  $ret .= '<div class="clear_both"></div>';
1619  $ret .= '</div>';
1620  $ret .= '<div class="bmlt_admin_one_line_in_a_form clear_both">';
1621  $ret .= '<span class="bmlt_admin_med_label_right">'.htmlspecialchars($this->my_localized_strings['comdef_server_admin_strings']['meeting_editor_screen_meeting_name_label']).'</span>';
1622  $ret .= '<span class="bmlt_admin_value_left"><input id="bmlt_admin_single_meeting_editor_template_meeting_name_text_input" type="text" maxlength="255" /><div class="helper_text">' . htmlspecialchars($this->my_localized_strings['comdef_server_admin_strings']['meeting_editor_screen_meeting_name_prompt']) . '</div></span>';
1623  $ret .= '<div class="clear_both"></div>';
1624  $ret .= '</div>';
1625  $ret .= '<div class="bmlt_admin_one_line_in_a_form clear_both">';
1626  $ret .= '<span class="bmlt_admin_med_label_right">'.htmlspecialchars($this->my_localized_strings['comdef_server_admin_strings']['meeting_editor_screen_meeting_weekday_label']).'</span>';
1627  $ret .= '<span class="bmlt_admin_value_left">';
1628  $ret .= '<select id="bmlt_admin_single_meeting_editor_template_meeting_weekday_select">';
1629  for ($m = 1; $m < 8; $m++) {
1630  $ret .= '<option value="'.$m.'">'.htmlspecialchars($this->my_localized_strings['comdef_server_admin_strings']['meeting_search_weekdays_names'][$m]).'</option>';
1631  }
1632  $ret .= '</select>';
1633  $ret .= '</span>';
1634  $ret .= '<div class="clear_both"></div>';
1635  $ret .= '</div>';
1636  $ret .= '<div class="bmlt_admin_one_line_in_a_form clear_both">';
1637  $ret .= '<span class="bmlt_admin_med_label_right">'.htmlspecialchars($this->my_localized_strings['comdef_server_admin_strings']['meeting_editor_screen_meeting_start_label']).'</span>';
1638  $ret .= '<span class="bmlt_admin_value_left bmlt_admin_time_selector">';
1639  $ret .= '<select id="bmlt_admin_single_meeting_editor_template_meeting_start_hour_select" onchange="admin_handler_object.reactToTimeSelect(template)">';
1640  $ret .= '<option value ="1">1</option>';
1641  $ret .= '<option value ="2">2</option>';
1642  $ret .= '<option value ="3">3</option>';
1643  $ret .= '<option value ="4">4</option>';
1644  $ret .= '<option value ="5">5</option>';
1645  $ret .= '<option value ="6">6</option>';
1646  $ret .= '<option value ="7">7</option>';
1647  $ret .= '<option value ="8">8</option>';
1648  $ret .= '<option value ="9">9</option>';
1649  $ret .= '<option value ="10">10</option>';
1650  $ret .= '<option value ="11">11</option>';
1651  $ret .= '<option value ="12">12</option>';
1652  $ret .= '<option value ="13">'.htmlspecialchars($this->my_localized_strings['comdef_server_admin_strings']['meeting_editor_screen_meeting_noon_label']).'</option>';
1653  $ret .= '<option value ="0">'.htmlspecialchars($this->my_localized_strings['comdef_server_admin_strings']['meeting_editor_screen_meeting_midnight_label']).'</option>';
1654  $ret .= '</select>';
1655  $ret .= '<span id="bmlt_admin_template_time_span" class="bmlt_admin_time_span">:';
1656  $ret .= '<select id="bmlt_admin_single_meeting_editor_template_meeting_start_minute_select" onchange="admin_handler_object.reactToTimeSelect(template)">';
1657  for ($m = 0; $m < 60; $m += $this->my_localized_strings['default_minute_interval']) {
1658  $ret .= '<option value="'.$m.'">'.sprintf("%02d", $m).'</option>';
1659  }
1660  $ret .= '</select>';
1661  $ret .= '<span class="bmlt_admin_am_pm_radiogroup">';
1662  $ret .= '<input type="radio" name="bmlt_admin_template_time_ampm_radio" id="bmlt_admin_template_time_am_radio" /><label for="bmlt_admin_template_time_am_radio">'.htmlspecialchars($this->my_localized_strings['comdef_server_admin_strings']['meeting_editor_screen_meeting_am_label']).'</label>';
1663  $ret .= '<input type="radio" name="bmlt_admin_template_time_ampm_radio" id="bmlt_admin_template_time_pm_radio" /><label for="bmlt_admin_template_time_pm_radio">'.htmlspecialchars($this->my_localized_strings['comdef_server_admin_strings']['meeting_editor_screen_meeting_pm_label']).'</label>';
1664  $ret .= '</span>';
1665  $ret .= '</span>';
1666  $ret .= '</span>';
1667  $ret .= '<div class="clear_both"></div>';
1668  $ret .= '</div>';
1669  $ret .= '<div class="bmlt_admin_one_line_in_a_form clear_both">';
1670  $ret .= '<span class="bmlt_admin_med_label_right">'.htmlspecialchars($this->my_localized_strings['comdef_server_admin_strings']['meeting_editor_screen_meeting_duration_label']).'</span>';
1671  $ret .= '<span class="bmlt_admin_value_left bmlt_admin_time_selector">';
1672  $ret .= '<select id="bmlt_admin_single_meeting_editor_template_meeting_duration_hour_select" onchange="admin_handler_object.reactToDurationSelect(template)">';
1673  for ($m = 0; $m < 24; $m++) {
1674  $ret .= '<option value="'.$m.'">'.$m.'</option>';
1675  }
1676  $ret .= '<option value ="24">'.htmlspecialchars($this->my_localized_strings['comdef_server_admin_strings']['meeting_editor_screen_meeting_oe_label']).'</option>';
1677  $ret .= '</select>';
1678  $ret .= '<span id="bmlt_admin_template_duration_span" class="bmlt_admin_time_span">:';
1679  $ret .= '<select id="bmlt_admin_single_meeting_editor_template_meeting_duration_minute_select" onchange="admin_handler_object.reactToDurationSelect(template)">';
1680  for ($m = 0; $m < 60; $m += $this->my_localized_strings['default_minute_interval']) {
1681  $ret .= '<option value="'.$m.'">'.sprintf("%02d", $m).'</option>';
1682  }
1683  $ret .= '</select>';
1684  $ret .= '</span>';
1685  $ret .= '</span>';
1686  $ret .= '<div class="clear_both"></div>';
1687  $ret .= '</div>';
1688 
1689  if ($this->my_localized_strings['meeting_time_zones_enabled']) {
1690  $ret .= '<div class="bmlt_admin_one_line_in_a_form clear_both">';
1691  $ret .= '<span class="bmlt_admin_med_label_right">'.htmlspecialchars($this->my_localized_strings['comdef_server_admin_strings']['meeting_editor_screen_meeting_time_zone_label']).'</span>';
1692  $ret .= '<span class="bmlt_admin_value_left">';
1693  $ret .= '<select id="bmlt_admin_single_meeting_editor_template_meeting_time_zone_select">';
1694  $ret .= '<option value=""></option>';
1695  foreach ($this->my_localized_strings['time_zone_strings'] as $tzname => $tzvalue) {
1696  $ret .= '<option value="' . htmlspecialchars($tzvalue) . '">' . htmlspecialchars($tzname) . '</option>';
1697  }
1698  $ret .= '</select>';
1699  $ret .= '</span>';
1700  $ret .= '<div class="clear_both"></div>';
1701  $ret .= '</div>';
1702  }
1703 
1704  $ret .= '<div class="bmlt_admin_one_line_in_a_form clear_both">';
1705  $ret .= '<span class="bmlt_admin_med_label_right">'.htmlspecialchars($this->my_localized_strings['comdef_server_admin_strings']['meeting_editor_screen_meeting_cc_label']).'</span>';
1706  $ret .= '<span class="bmlt_admin_value_left"><input id="bmlt_admin_single_meeting_editor_template_meeting_cc_text_input" type="text" maxlength="255" /><div class="helper_text">' . '</div></span>';
1707  $ret .= '<span class="bmlt_admin_advice_span">'.htmlspecialchars($this->my_localized_strings['comdef_server_admin_strings']['meeting_editor_screen_meeting_cc_advice']).'</span>';
1708  $ret .= '<div class="clear_both"></div>';
1709  $ret .= '</div>';
1710 
1711  if (count($this->my_service_bodies) > 1) {
1712  $ret .= '<div class="bmlt_admin_one_line_in_a_form clear_both">';
1713  $ret .= '<span class="bmlt_admin_med_label_right">'.htmlspecialchars($this->my_localized_strings['comdef_server_admin_strings']['meeting_editor_screen_meeting_sb_label']).'</span>';
1714  $ret .= '<span class="bmlt_admin_value_left">';
1715  $ret .= '<select id="bmlt_admin_single_meeting_editor_template_meeting_sb_select">';
1716  for ($m = 0; $m < count($this->my_service_bodies); $m++) {
1717  $ret .= '<option value="'.$this->my_service_bodies[$m]->GetID().'">'.htmlspecialchars($this->my_service_bodies[$m]->GetLocalName()).'</option>';
1718  }
1719  $ret .= '</select>';
1720  $ret .= '</span>';
1721  $ret .= '<div class="clear_both"></div>';
1722  $ret .= '</div>';
1723  }
1724  $ret .= '<div class="bmlt_admin_one_line_in_a_form clear_both">';
1725  $ret .= '<span class="bmlt_admin_med_label_right">'.htmlspecialchars($this->my_localized_strings['comdef_server_admin_strings']['meeting_editor_screen_meeting_contact_label']).'</span>';
1726  $ret .= '<span class="bmlt_admin_value_left"><input id="bmlt_admin_single_meeting_editor_template_meeting_contact_text_input" type="text" maxlength="255" /><div class="helper_text">' . htmlspecialchars($this->my_localized_strings['comdef_server_admin_strings']['meeting_editor_screen_meeting_contact_prompt']) . '</div></span>';
1727  $ret .= '<span class="bmlt_admin_advice_span">'.htmlspecialchars($this->my_localized_strings['comdef_server_admin_strings']['meeting_editor_screen_meeting_visibility_advice']).'</span>';
1728  $ret .= '<div class="clear_both"></div>';
1729  $ret .= '</div>';
1730  $ret .= '</div>';
1731  }
1732 
1733  return $ret;
1734  }
1735 
1736  /********************************************************************************************************//**
1737  \brief This constructs a template to be filled in for the location options tab.
1738  \returns The HTML and JavaScript for the option sheet.
1739  ************************************************************************************************************/
1740  // phpcs:disable PSR1.Methods.CamelCapsMethodName.NotCamelCaps
1741  public function return_single_meeting_location_template()
1742  {
1743  // phpcs:enable PSR1.Methods.CamelCapsMethodName.NotCamelCaps
1744  $ret = '<div id="bmlt_admin_meeting_template_location_sheet_div" class="bmlt_admin_meeting_option_sheet_div item_hidden">';
1745  $ret .= '<div id="bmlt_admin_single_meeting_editor_template_map_disclosure_div" class="bmlt_admin_single_meeting_disclosure_map_div_closed">';
1746  $ret .= '<a class="bmlt_admin_single_meeting_editor_map_disclosure_a" id="bmlt_admin_single_meeting_editor_template_map_disclosure_a">'.htmlspecialchars($this->my_localized_strings['comdef_server_admin_strings']['meeting_editor_location_map_link']).'</a>';
1747  $ret .= '</div>';
1748  $ret .= '<div id="bmlt_admin_single_meeting_editor_template_map_div" class="bmlt_admin_single_meeting_map_div item_hidden">';
1749  $ret .= '<div id="bmlt_admin_single_meeting_editor_template_inner_map_div" class="bmlt_admin_single_meeting_editor_inner_map_div"></div>';
1750  $ret .= '<div class="bmlt_admin_single_meeting_editor_map_bottom_bar_div">';
1751  $ret .= '</div>';
1752  $ret .= '</div>';
1753 
1754  $ret .= '<div class="bmlt_admin_one_line_in_a_form clear_both">';
1755  $ret .= '<span class="bmlt_admin_med_label_right">'.htmlspecialchars($this->my_localized_strings['comdef_server_admin_strings']['meeting_editor_screen_meeting_venue_type']).'</span>';
1756  $ret .= '<span class="bmlt_admin_value_left">';
1757  $ret .= '<span id="bmlt_admin_single_meeting_editor_template_meeting_venue_type">';
1758  $ret .= '<div><input id="bmlt_admin_single_meeting_editor_template_meeting_venue_type_inperson" type="radio" name="venue_type" value="inperson" onclick="admin_handler_object.venueTypeClick(this, template)" /><label for="bmlt_admin_single_meeting_editor_template_meeting_venue_inperson">' . htmlspecialchars($this->my_localized_strings['comdef_server_admin_strings']['meeting_editor_screen_meeting_venue_type_inperson']) . '</label></div>';
1759  $ret .= '<div><input id="bmlt_admin_single_meeting_editor_template_meeting_venue_type_virtual" type="radio" name="venue_type" value="virtual" onclick="admin_handler_object.venueTypeClick(this, template)" /><label for="bmlt_admin_single_meeting_editor_template_meeting_venue_virtual">' . htmlspecialchars($this->my_localized_strings['comdef_server_admin_strings']['meeting_editor_screen_meeting_venue_type_virtual']) . '</label></div>';
1760  $ret .= '<div><input id="bmlt_admin_single_meeting_editor_template_meeting_venue_type_virtualTC" type="radio" name="venue_type" value="virtualTC" onclick="admin_handler_object.venueTypeClick(this, template)" /><label for="bmlt_admin_single_meeting_editor_template_meeting_venue_virtualTC">' . htmlspecialchars($this->my_localized_strings['comdef_server_admin_strings']['meeting_editor_screen_meeting_venue_type_virtualTC']) . '</label></div>';
1761  $ret .= '<div><input id="bmlt_admin_single_meeting_editor_template_meeting_venue_type_hybrid" type="radio" name="venue_type" value="hybrid" onclick="admin_handler_object.venueTypeClick(this, template)" /><label for="bmlt_admin_single_meeting_editor_template_meeting_venue_hybrid">' . htmlspecialchars($this->my_localized_strings['comdef_server_admin_strings']['meeting_editor_screen_meeting_venue_type_hybrid']) . '</label></div>';
1762  $ret .= '</span>';
1763  $ret .= '<div class="clear_both"></div>';
1764  $ret .= '</div>';
1765 
1766  $ret .= '<div class="clear_both"></div>';
1767  $ret .= '<div id="bmlt_admin_single_location_template_long_lat_div" class="bmlt_admin_single_location_long_lat_div">';
1768  $ret .= '<div class="bmlt_admin_one_line_in_a_form clear_both">';
1769  $ret .= '<span class="bmlt_admin_med_label_right">'.htmlspecialchars($this->my_localized_strings['comdef_server_admin_strings']['meeting_editor_screen_meeting_longitude_label']).'</span>';
1770  $ret .= '<span class="bmlt_admin_value_left"><input id="bmlt_admin_single_meeting_editor_template_meeting_longitude_text_input" type="text" maxlength="25" ' . ($this->my_localized_strings['auto_geocoding_enabled'] ? 'readonly' : '') . '/><div class="helper_text">' . htmlspecialchars($this->my_localized_strings['comdef_server_admin_strings']['meeting_editor_screen_meeting_longitude_prompt']) . '</div></span>';
1771  if ($this->my_localized_strings['auto_geocoding_enabled']) {
1772  $ret .= '<span class="bmlt_admin_advice_span">'.htmlspecialchars($this->my_localized_strings['comdef_server_admin_strings']['automatically_calculated_on_save']).'</span>';
1773  }
1774  $ret .= '<div class="clear_both"></div>';
1775  $ret .= '</div>';
1776  $ret .= '<div class="bmlt_admin_one_line_in_a_form clear_both">';
1777  $ret .= '<span class="bmlt_admin_med_label_right">'.htmlspecialchars($this->my_localized_strings['comdef_server_admin_strings']['meeting_editor_screen_meeting_latitude_label']).'</span>';
1778  $ret .= '<span class="bmlt_admin_value_left"><input id="bmlt_admin_single_meeting_editor_template_meeting_latitude_text_input" type="text" maxlength="25" ' . ($this->my_localized_strings['auto_geocoding_enabled'] ? 'readonly' : '') . ' /><div class="helper_text">' . htmlspecialchars($this->my_localized_strings['comdef_server_admin_strings']['meeting_editor_screen_meeting_latitude_prompt']) . '</div></span>';
1779  if ($this->my_localized_strings['auto_geocoding_enabled']) {
1780  $ret .= '<span class="bmlt_admin_advice_span">'.htmlspecialchars($this->my_localized_strings['comdef_server_admin_strings']['automatically_calculated_on_save']).'</span>';
1781  }
1782  $ret .= '<div class="clear_both"></div>';
1783  $ret .= '</div>';
1784  $ret .= '</div>';
1785  $ret .= '<div class="bmlt_admin_meeting_editor_address_div">';
1786  $ret .= '<div class="bmlt_admin_one_line_in_a_form clear_both">';
1787  $ret .= '<span class="bmlt_admin_med_label_right">'.htmlspecialchars($this->my_localized_strings['comdef_server_admin_strings']['meeting_editor_screen_meeting_location_label']).'</span>';
1788  $ret .= '<span class="bmlt_admin_value_left"><input id="bmlt_admin_single_meeting_editor_template_meeting_location_text_input" type="text" maxlength="255" /><div class="helper_text">' . htmlspecialchars($this->my_localized_strings['comdef_server_admin_strings']['meeting_editor_screen_meeting_location_prompt']) . '</div></span>';
1789  $ret .= '<div class="clear_both"></div>';
1790  $ret .= '</div>';
1791  $ret .= '<div class="bmlt_admin_one_line_in_a_form clear_both">';
1792  $ret .= '<span class="bmlt_admin_med_label_right">'.htmlspecialchars($this->my_localized_strings['comdef_server_admin_strings']['meeting_editor_screen_meeting_info_label']).'</span>';
1793  $ret .= '<span class="bmlt_admin_value_left"><input id="bmlt_admin_single_meeting_editor_template_meeting_info_text_input" type="text" maxlength="255" /><div class="helper_text">' . htmlspecialchars($this->my_localized_strings['comdef_server_admin_strings']['meeting_editor_screen_meeting_info_prompt']) . '</div></span>';
1794  $ret .= '<div class="clear_both"></div>';
1795  $ret .= '</div>';
1796  $ret .= '<div class="bmlt_admin_one_line_in_a_form clear_both">';
1797  $ret .= '<span class="bmlt_admin_med_label_right">'.htmlspecialchars($this->my_localized_strings['comdef_server_admin_strings']['meeting_editor_screen_meeting_street_label']).'</span>';
1798  $ret .= '<span class="bmlt_admin_value_left"><input id="bmlt_admin_single_meeting_editor_template_meeting_street_text_input" type="text" maxlength="255" /><div class="helper_text">' . htmlspecialchars($this->my_localized_strings['comdef_server_admin_strings']['meeting_editor_screen_meeting_street_prompt']) . '</div></span>';
1799  $ret .= '<div class="clear_both"></div>';
1800  $ret .= '</div>';
1801  $ret .= '<div class="bmlt_admin_one_line_in_a_form clear_both">';
1802  $ret .= '<span class="bmlt_admin_med_label_right">'.htmlspecialchars($this->my_localized_strings['comdef_server_admin_strings']['meeting_editor_screen_meeting_neighborhood_label']).'</span>';
1803  $ret .= '<span class="bmlt_admin_value_left"><input id="bmlt_admin_single_meeting_editor_template_meeting_neighborhood_text_input" type="text" maxlength="255" /><div class="helper_text">' . htmlspecialchars($this->my_localized_strings['comdef_server_admin_strings']['meeting_editor_screen_meeting_neighborhood_prompt']) . '</div></span>';
1804  $ret .= '<div class="clear_both"></div>';
1805  $ret .= '</div>';
1806  $ret .= '<div class="bmlt_admin_one_line_in_a_form clear_both">';
1807  $ret .= '<span class="bmlt_admin_med_label_right">'.htmlspecialchars($this->my_localized_strings['comdef_server_admin_strings']['meeting_editor_screen_meeting_borough_label']).'</span>';
1808  $ret .= '<span class="bmlt_admin_value_left"><input id="bmlt_admin_single_meeting_editor_template_meeting_borough_text_input" type="text" maxlength="255" /><div class="helper_text">' . htmlspecialchars($this->my_localized_strings['comdef_server_admin_strings']['meeting_editor_screen_meeting_borough_prompt']). '</div></span>';
1809  $ret .= '<div class="clear_both"></div>';
1810  $ret .= '</div>';
1811  $ret .= '<div class="bmlt_admin_one_line_in_a_form clear_both">';
1812  $ret .= '<span class="bmlt_admin_med_label_right">'.htmlspecialchars($this->my_localized_strings['comdef_server_admin_strings']['meeting_editor_screen_meeting_city_label']).'</span>';
1813  $ret .= '<span class="bmlt_admin_value_left"><input id="bmlt_admin_single_meeting_editor_template_meeting_city_text_input" type="text" maxlength="255" /><div class="helper_text">' . htmlspecialchars($this->my_localized_strings['comdef_server_admin_strings']['meeting_editor_screen_meeting_city_prompt']) . '</div></span>';
1814  $ret .= '<div class="clear_both"></div>';
1815  $ret .= '</div>';
1816  $ret .= '<div class="bmlt_admin_one_line_in_a_form clear_both">';
1817  $ret .= '<span class="bmlt_admin_med_label_right">'.htmlspecialchars($this->my_localized_strings['comdef_server_admin_strings']['meeting_editor_screen_meeting_county_label']).'</span>';
1818  $ret .= '<span class="bmlt_admin_value_left">';
1819  if ((!$this->my_localized_strings['auto_geocoding_enabled'] || !$this->my_localized_strings['county_auto_geocoding_enabled']) && is_array($this->my_localized_strings['meeting_counties_and_sub_provinces']) && count($this->my_localized_strings['meeting_counties_and_sub_provinces'])) {
1820  $ret .= '<select id="bmlt_admin_single_meeting_editor_template_meeting_county_select_input" class="bmlt_admin_single_meeting_editor_template_meeting_county_select_input">';
1821  $ret .= '<option value=""></option>';
1822  foreach ($this->my_localized_strings['meeting_counties_and_sub_provinces'] as $value) {
1823  $ret .= '<option value="'. htmlspecialchars($value) .'">'. htmlspecialchars($value) .'</option>';
1824  }
1825  $ret .= '</select>';
1826  } else {
1827  $ret .= '<input id="bmlt_admin_single_meeting_editor_template_meeting_county_text_input" type="text" maxlength="255" ' . ($this->my_localized_strings['auto_geocoding_enabled'] && $this->my_localized_strings['county_auto_geocoding_enabled'] ? 'readonly' : '') . ' />';
1828  }
1829  $ret .= '<div class="helper_text">' . htmlspecialchars($this->my_localized_strings['comdef_server_admin_strings']['meeting_editor_screen_meeting_county_prompt']) . '</div></span>';
1830  if ($this->my_localized_strings['auto_geocoding_enabled'] && $this->my_localized_strings['county_auto_geocoding_enabled']) {
1831  $ret .= '<span class="bmlt_admin_advice_span">'.htmlspecialchars($this->my_localized_strings['comdef_server_admin_strings']['automatically_calculated_on_save']).'</span>';
1832  }
1833  $ret .= '<div class="clear_both"></div>';
1834  $ret .= '</div>';
1835  $ret .= '<div class="bmlt_admin_one_line_in_a_form clear_both">';
1836  $ret .= '<span class="bmlt_admin_med_label_right">'.htmlspecialchars($this->my_localized_strings['comdef_server_admin_strings']['meeting_editor_screen_meeting_state_label']).'</span>';
1837  $ret .= '<span class="bmlt_admin_value_left">';
1838  if (is_array($this->my_localized_strings['meeting_states_and_provinces']) && count($this->my_localized_strings['meeting_states_and_provinces'])) {
1839  $ret .= '<select id="bmlt_admin_single_meeting_editor_template_meeting_state_select_input" class="bmlt_admin_single_meeting_editor_template_meeting_state_select_input">';
1840  $ret .= '<option value=""></option>';
1841  foreach ($this->my_localized_strings['meeting_states_and_provinces'] as $value) {
1842  $ret .= '<option value="'. htmlspecialchars($value) .'">'. htmlspecialchars($value) .'</option>';
1843  }
1844  $ret .= '</select>';
1845  } else {
1846  $ret .= '<input id="bmlt_admin_single_meeting_editor_template_meeting_state_text_input" type="text" maxlength="255" />';
1847  }
1848  $ret .= '<div class="helper_text">' . htmlspecialchars($this->my_localized_strings['comdef_server_admin_strings']['meeting_editor_screen_meeting_state_prompt']) . '</div></span>';
1849  $ret .= '<div class="clear_both"></div>';
1850  $ret .= '</div>';
1851  $ret .= '<div class="bmlt_admin_one_line_in_a_form clear_both">';
1852  $ret .= '<span class="bmlt_admin_med_label_right">'.htmlspecialchars($this->my_localized_strings['comdef_server_admin_strings']['meeting_editor_screen_meeting_zip_label']).'</span>';
1853  $ret .= '<span class="bmlt_admin_value_left"><input id="bmlt_admin_single_meeting_editor_template_meeting_zip_text_input" type="text" maxlength="255" ' . ($this->my_localized_strings['auto_geocoding_enabled'] && $this->my_localized_strings['zip_auto_geocoding_enabled'] ? 'readonly' : '') . '/><div class="helper_text">' . htmlspecialchars($this->my_localized_strings['comdef_server_admin_strings']['meeting_editor_screen_meeting_zip_prompt']) . '</div></span>';
1854  if ($this->my_localized_strings['auto_geocoding_enabled'] && $this->my_localized_strings['zip_auto_geocoding_enabled']) {
1855  $ret .= '<span class="bmlt_admin_advice_span">'.htmlspecialchars($this->my_localized_strings['comdef_server_admin_strings']['automatically_calculated_on_save']).'</span>';
1856  }
1857  $ret .= '<div class="clear_both"></div>';
1858  $ret .= '</div>';
1859  $ret .= '<div class="bmlt_admin_one_line_in_a_form clear_both">';
1860  $ret .= '<span class="bmlt_admin_med_label_right">'.htmlspecialchars($this->my_localized_strings['comdef_server_admin_strings']['meeting_editor_screen_meeting_nation_label']).'</span>';
1861  $ret .= '<span class="bmlt_admin_value_left"><input id="bmlt_admin_single_meeting_editor_template_meeting_nation_text_input" type="text" maxlength="255" /><div class="helper_text">' . htmlspecialchars($this->my_localized_strings['comdef_server_admin_strings']['meeting_editor_screen_meeting_nation_prompt']).'</div></span>';
1862  $ret .= '<div class="clear_both"></div>';
1863  $ret .= '</div>';
1864 
1865  $ret .= '<div class="bmlt_admin_meeting_inner_div">';
1866  $ret .= '<span id="bmlt_admin_single_meeting_editor_template_meeting_virtual_meta"></span>';
1867  $ret .= '<div class="bmlt_admin_one_line_in_a_form clear_both">';
1868  $ret .= '<span class="bmlt_admin_med_label_right">'.htmlspecialchars($this->my_localized_strings['comdef_server_admin_strings']['meeting_editor_screen_meeting_phone_meeting_number_label']).'</span>';
1869  $ret .= '<span class="bmlt_admin_value_left"><input id="bmlt_admin_single_meeting_editor_template_meeting_phone_meeting_number_text_input" type="text" maxlength="255" /><div class="helper_text">' . htmlspecialchars($this->my_localized_strings['comdef_server_admin_strings']['meeting_editor_screen_meeting_phone_meeting_number_prompt']) . '</div></span>';
1870  $ret .= '<div class="clear_both"></div>';
1871  $ret .= '</div>';
1872  $ret .= '<div class="bmlt_admin_one_line_in_a_form clear_both">';
1873  $ret .= '<span class="bmlt_admin_med_label_right">'.htmlspecialchars($this->my_localized_strings['comdef_server_admin_strings']['meeting_editor_screen_meeting_virtual_meeting_link_label']).'</span>';
1874  $ret .= '<span class="bmlt_admin_value_left"><input id="bmlt_admin_single_meeting_editor_template_meeting_virtual_meeting_link_text_input" type="text" maxlength="255" /><div class="helper_text">' . htmlspecialchars($this->my_localized_strings['comdef_server_admin_strings']['meeting_editor_screen_meeting_virtual_meeting_link_prompt']) . '</div></span>';
1875  $ret .= '<div class="clear_both"></div>';
1876  $ret .= '</div>';
1877  $ret .= '<div class="bmlt_admin_one_line_in_a_form clear_both">';
1878  $ret .= '<span class="bmlt_admin_med_label_right">'.htmlspecialchars($this->my_localized_strings['comdef_server_admin_strings']['meeting_editor_screen_meeting_virtual_meeting_additional_info_label']).'</span>';
1879  $ret .= '<span class="bmlt_admin_value_left"><input id="bmlt_admin_single_meeting_editor_template_meeting_virtual_meeting_additional_info_text_input" type="text" maxlength="255" /><div class="helper_text">' . htmlspecialchars($this->my_localized_strings['comdef_server_admin_strings']['meeting_editor_screen_meeting_virtual_meeting_additional_info_prompt']) . '</div></span>';
1880  $ret .= '<div class="clear_both"></div>';
1881  $ret .= '</div>';
1882  $ret .= '</div>';
1883  $ret .= '</div>';
1884  $ret .= '</div>';
1885 
1886  return $ret;
1887  }
1888 
1889  /********************************************************************************************************//**
1890  \brief
1891  \returns The HTML and JavaScript for the option sheet.
1892  ************************************************************************************************************/
1893  // phpcs:disable PSR1.Methods.CamelCapsMethodName.NotCamelCaps
1894  public function return_single_meeting_format_template()
1895  {
1896  // phpcs:enable PSR1.Methods.CamelCapsMethodName.NotCamelCaps
1897  $ret = '<div id="bmlt_admin_meeting_template_format_sheet_div" class="bmlt_admin_meeting_option_sheet_div item_hidden">';
1898  $ret .= '<div class="format_tab_inner_div">';
1899  $f_array = $this->my_server->GetFormatsArray();
1900  $f_array = $f_array[$this->my_server->GetLocalLang()];
1901  if ($this->my_localized_strings['sort_formats']) {
1902  usort($f_array, function ($a, $b) {
1903  return strnatcasecmp($a->GetKey(), $b->GetKey());
1904  });
1905  }
1906  foreach ($f_array as $format) {
1907  if ($format instanceof c_comdef_format) {
1908  $ret .= '<div class="bmlt_admin_meeting_one_format_div">';
1909  $ret .= '<label class="left_label" for="bmlt_admin_meeting_template_format_'.$format->GetSharedID().'_checkbox">'.htmlspecialchars($format->GetKey()).'</label>';
1910  $ret .= '<span><input type="checkbox" value="'.$format->GetSharedID().'" id="bmlt_admin_meeting_template_format_'.$format->GetSharedID().'_checkbox" onchange="admin_handler_object.reactToFormatCheckbox(this, template);" onclick="admin_handler_object.reactToFormatCheckbox(this, template);" /></span>';
1911  $ret .= '<label class="right_label" for="bmlt_admin_meeting_template_format_'.$format->GetSharedID().'_checkbox">'.htmlspecialchars($format->GetLocalName()).'</label>';
1912  $ret .= '</div>';
1913  }
1914  }
1915  $ret .= '<div class="clear_both"></div>';
1916  $ret .= '</div>';
1917  $ret .= '</div>';
1918 
1919  return $ret;
1920  }
1921 
1922  /********************************************************************************************************//**
1923  \brief
1924  \returns The HTML and JavaScript for the option sheet.
1925  ************************************************************************************************************/
1926  // phpcs:disable PSR1.Methods.CamelCapsMethodName.NotCamelCaps
1927  public function return_single_meeting_other_template()
1928  {
1929  // phpcs:enable PSR1.Methods.CamelCapsMethodName.NotCamelCaps
1930  $ret = '<div id="bmlt_admin_meeting_template_other_sheet_div" class="bmlt_admin_meeting_option_sheet_div item_hidden">';
1931  foreach ($this->my_data_field_templates as $data_field) {
1932  $key = $data_field['key'];
1933  $prompt = $data_field['field_prompt'];
1934  switch ($key) {
1935  case 'id_bigint': // All of these are ignored, as they are taken care of in other option sheets.
1936  case 'worldid_mixed':
1937  case 'shared_group_id_bigint':
1938  case 'service_body_bigint':
1939  case 'weekday_tinyint':
1940  case 'start_time':
1941  case 'formats':
1942  case 'lang_enum':
1943  case 'longitude':
1944  case 'latitude':
1945  case 'email_contact':
1946  case 'meeting_name':
1947  case 'location_text':
1948  case 'location_info':
1949  case 'location_street':
1950  case 'location_neighborhood':
1951  case 'location_city_subsection':
1952  case 'location_municipality':
1953  case 'location_sub_province':
1954  case 'location_province':
1955  case 'location_postal_code_1':
1956  case 'location_nation':
1957  case 'phone_meeting_number':
1958  case 'virtual_meeting_link':
1959  case 'virtual_meeting_additional_info':
1960  break;
1961 
1962  default: // We display these ones.
1963  if (array_key_exists('meeting_editor_screen_meeting_' . $key . '_label', $this->my_localized_strings['comdef_server_admin_strings'])) {
1964  $prompt = $this->my_localized_strings['comdef_server_admin_strings']['meeting_editor_screen_meeting_' . $key . '_label'];
1965  }
1966  $ret .= '<div class="bmlt_admin_one_line_in_a_form clear_both">';
1967  $ret .= '<span class="bmlt_admin_med_label_right">'.htmlspecialchars($prompt).'</span>';
1968  $ret .= '<span class="bmlt_admin_value_left">';
1969  $ret .= '<input id="bmlt_admin_single_meeting_editor_template_meeting_'.htmlspecialchars($key).'_text_input" type="text" onkeyup="admin_handler_object.setItemValue(this, template, \''.htmlspecialchars($key).'\');" onfocus="admin_handler_object.handleTextInputFocus(this);" onblur="admin_handler_object.handleTextInputBlur(this, true);" maxlength="255" />';
1970  $ret .= '</span>';
1971  if ($data_field['visibility'] == _VISIBILITY_NONE_) {
1972  $ret .= '<span class="bmlt_admin_advice_span">'.htmlspecialchars($this->my_localized_strings['comdef_server_admin_strings']['meeting_editor_screen_meeting_visibility_advice']).'</span>';
1973  }
1974  $ret .= '<div class="clear_both"></div>';
1975  $ret .= '</div>';
1976  break;
1977  }
1978  }
1979  $ret .= '</div>';
1980 
1981  return $ret;
1982  }
1983 
1984  /********************************************************************************************************//**
1985  \brief
1986  \returns The HTML and JavaScript for the option sheet.
1987  ************************************************************************************************************/
1988  // phpcs:disable PSR1.Methods.CamelCapsMethodName.NotCamelCaps
1989  public function return_single_meeting_history_template()
1990  {
1991  // phpcs:enable PSR1.Methods.CamelCapsMethodName.NotCamelCaps
1992  $ret = '<div id="bmlt_admin_meeting_template_history_sheet_div" class="bmlt_admin_meeting_option_sheet_div item_hidden">';
1993  $ret .= '<div id="bmlt_admin_history_ajax_button_template_throbber_div" class="bmlt_admin_history_ajax_button_throbber_div"><img src="local_server/server_admin/style/images/ajax-throbber-white.gif" alt="AJAX Throbber" /></div>';
1994  $ret .= '</div>';
1995 
1996  return $ret;
1997  }
1998 
1999  /********************************************************************************************************//**
2000  \brief This constructs the "Server Administration" section of the console. Server Admins and Service Body admins can see this.
2001  \returns The HTML and JavaScript for the "Server Administration" section.
2002  ************************************************************************************************************/
2003  // phpcs:disable PSR1.Methods.CamelCapsMethodName.NotCamelCaps
2004  public function return_server_admin_panel()
2005  {
2006  // phpcs:enable PSR1.Methods.CamelCapsMethodName.NotCamelCaps
2007  $ret = '<div id="bmlt_admin_server_admin_disclosure_div" class="bmlt_admin_server_admin_disclosure_div bmlt_admin_server_admin_disclosure_div_closed">';
2008  $ret .= '<a class="bmlt_admin_server_admin_disclosure_a" href="javascript:admin_handler_object.toggleServerAdmin();">';
2009  $ret .= htmlspecialchars($this->my_localized_strings['comdef_server_admin_strings']['server_admin_disclosure']);
2010  $ret .= '</a>';
2011  $ret .= '</div>';
2012  $ret .= '<div id="bmlt_admin_server_admin_wrapper_div" class="bmlt_admin_server_admin_wrapper_div bmlt_admin_server_admin_wrapper_div_hidden">';
2013  $ret .= '<div class="bmlt_admin_server_admin_banner_div">';
2014  $ret .= '<div class="bmlt_admin_meeting_editor_banner_container_div">';
2015  $ret .= '</div>';
2016  $ret .= '</div>';
2017 
2018 
2019  $ret .= '<div id="bmlt_admin_server_admin_editor_div" class="bmlt_admin_server_admin_editor_div">';
2020  $ret .= '<fieldset id="bmlt_admin_server_admin_editor_fieldset" class="bmlt_admin_server_admin_editor_fieldset">';
2021  $ret .= '<legend id="bmlt_admin_server_admin_editor_fieldset_legend" class="bmlt_admin_server_admin_editor_fieldset_legend">';
2022  // Put the select menu, or "popup", here
2023  if ($this->my_user->GetUserLevel() == _USER_LEVEL_SERVER_ADMIN) {
2024  $ret .= '<select id="bmlt_admin_server_admin_select" class="bmlt_admin_server_admin_select" onchange="admin_handler_object.toggleServerAdminSelect();">';
2025  $ret .= '<option value="update_world_ids" selected>'.htmlspecialchars($this->my_localized_strings['comdef_server_admin_strings']['update_world_ids_from_spreadsheet_dropdown_text']).'</option>';
2026  $ret .= '<option value="naws_import">'.htmlspecialchars($this->my_localized_strings['comdef_server_admin_strings']['import_service_bodies_and_meetings_dropdown_text']).'</option>';
2027  $ret .= '</select>';
2028  } else {
2029  $ret .= '<span class="server_admin_title_span">'.htmlspecialchars($this->my_localized_strings['comdef_server_admin_strings']['update_world_ids_from_spreadsheet_dropdown_text']).'</span>';
2030  }
2031  $ret .= '</legend>';
2032 
2033  // World IDs update
2034  $ret .= '<div id="bmlt_admin_server_admin_update_world_ids_edit_form_inner_div" class="bmlt_admin_server_admin_update_world_ids_edit_form_inner_div">';
2035  $ret .= '<div class="bmlt_admin_server_admin_edit_form_inner_div">';
2036  $ret .= '<div class="bmlt_admin_one_line_in_a_form clear_both">';
2037  $ret .= '<span class="bmlt_admin_med_label_right">'.htmlspecialchars($this->my_localized_strings['comdef_server_admin_strings']['server_admin_naws_spreadsheet_label']).'</span>';
2038  $ret .= '<span class="bmlt_admin_value_left">';
2039  $ret .= '<input name="bmlt_admin_naws_spreadsheet_file_input" id="bmlt_admin_naws_spreadsheet_file_input" onchange="javascript:admin_handler_object.handleWorldIDFileInputChange();" type="file" />';
2040  $ret .= '</span>';
2041  $ret .= '</div>';
2042  $ret .= '<div class="bmlt_admin_one_line_in_a_form clear_both">';
2043  $ret .= '<span class="bmlt_admin_med_label_right">&nbsp;</span>';
2044  $ret .= '<span id="bmlt_admin_update_world_ids_ajax_button_span" class="bmlt_admin_value_left"><a id="bmlt_admin_update_world_ids_ajax_button" href="javascript:admin_handler_object.handleUpdateWorldIDsFromSpreadsheet();" class="bmlt_admin_ajax_button button_disabled">'.htmlspecialchars($this->my_localized_strings['comdef_server_admin_strings']['update_world_ids_button_text']).'</a></span>';
2045  $ret .= '<span id="bmlt_admin_update_world_ids_ajax_button_throbber_span" class="bmlt_admin_value_left item_hidden"><img src="local_server/server_admin/style/images/ajax-throbber-white.gif" alt="AJAX Throbber" /></span>';
2046  $ret .= '<div class="clear_both"></div>';
2047  $ret .= '</div>';
2048  $ret .= '</div>';
2049  $ret .= '</div>';
2050 
2051  // NAWS Import
2052  $ret .= '<div id="bmlt_admin_server_admin_naws_import_edit_form_inner_div" class="bmlt_admin_server_admin_naws_import_edit_form_inner_div item_hidden">';
2053  $ret .= '<div class="bmlt_admin_server_admin_edit_form_inner_div">';
2054  $ret .= '<div class="bmlt_admin_one_line_in_a_form clear_both">';
2055  $ret .= '<span class="bmlt_admin_med_label_right">'.htmlspecialchars($this->my_localized_strings['comdef_server_admin_strings']['server_admin_naws_import_spreadsheet_label']).'</span>';
2056  $ret .= '<span class="bmlt_admin_value_left">';
2057  $ret .= '<input name="bmlt_admin_naws_import_file_input" id="bmlt_admin_naws_import_file_input" onchange="javascript:admin_handler_object.handleNAWSImportFileInputChange();" type="file" />';
2058  $ret .= '</span>';
2059  $ret .= '</div>';
2060  $ret .= '<div class="bmlt_admin_one_line_in_a_form clear_both">';
2061  $ret .= '<span class="bmlt_admin_med_label_right">'.htmlspecialchars($this->my_localized_strings['comdef_server_admin_strings']['server_admin_naws_import_initially_publish']).'</span>';
2062  $ret .= '<span class="bmlt_admin_value_left">';
2063  $ret .= '<input type="checkbox" name="bmlt_admin_naws_import_publish_checkbox" id="bmlt_admin_naws_import_publish_checkbox" checked="checked" onchange="javascript:admin_handler_object.handleNAWSImportFileInputChange();" />';
2064  $ret .= '</span>';
2065  $ret .= '<span class="span.bmlt_admin_unpublished_note_span"> &thinsp;'.htmlspecialchars($this->my_localized_strings['comdef_server_admin_strings']['server_admin_naws_import_explanation']).'</span>';
2066  $ret .= '</div>';
2067  $ret .= '<div class="bmlt_admin_one_line_in_a_form clear_both">';
2068  $ret .= '<span class="bmlt_admin_med_label_right">&nbsp;</span>';
2069  $ret .= '<span id="bmlt_admin_naws_import_ajax_button_span" class="bmlt_admin_value_left"><a id="bmlt_admin_naws_import_ajax_button" href="javascript:admin_handler_object.handleNAWSImport();" class="bmlt_admin_ajax_button button_disabled">'.htmlspecialchars($this->my_localized_strings['comdef_server_admin_strings']['import_service_bodies_and_meetings_button_text']).'</a></span>';
2070  $ret .= '<span id="bmlt_admin_naws_import_ajax_button_throbber_span" class="bmlt_admin_value_left item_hidden"><img src="local_server/server_admin/style/images/ajax-throbber-white.gif" alt="AJAX Throbber" /></span>';
2071  $ret .= '<div class="clear_both"></div>';
2072  $ret .= '</div>';
2073  $ret .= '</div>';
2074  $ret .= '</div>';
2075 
2076 
2077 
2078  $ret .= '</fieldset>';
2079  $ret .= '</div>';
2080 
2081  $ret .= '</div>';
2082 
2083  return $ret;
2084  }
2085 
2086  /********************************************************************************************************//**
2087  \brief This constructs the "My Account" section of the console. All user levels will have this.
2088  \returns The HTML and JavaScript for the "My Account" section.
2089  ************************************************************************************************************/
2090  // phpcs:disable PSR1.Methods.CamelCapsMethodName.NotCamelCaps
2091  public function return_user_account_settings_panel()
2092  {
2093  // phpcs:enable PSR1.Methods.CamelCapsMethodName.NotCamelCaps
2094  $ret = '<div id="bmlt_admin_user_account_disclosure_div" class="bmlt_admin_user_account_disclosure_div bmlt_admin_user_account_disclosure_div_closed">';
2095  $ret .= '<a class="bmlt_admin_user_account_disclosure_a" href="javascript:admin_handler_object.toggleAccountInfo();">';
2096  $ret .= htmlspecialchars($this->my_localized_strings['comdef_server_admin_strings']['account_disclosure']);
2097  $ret .= '</a>';
2098  $ret .= '</div>';
2099  $ret .= '<div id="bmlt_admin_user_account_wrapper_div" class="bmlt_admin_user_account_wrapper_div bmlt_admin_user_account_wrapper_div_hidden">';
2100  $ret .= '<div class="bmlt_admin_user_account_banner_div">';
2101  $ret .= '<div class="bmlt_admin_meeting_editor_banner_container_div">';
2102  $ret .= '<div class="bmlt_admin_fader_div item_hidden" id="bmlt_admin_fader_account_warn_div">';
2103  $ret .= '<span class="warn_text_span">'.htmlspecialchars($this->my_localized_strings['comdef_server_admin_strings']['need_refresh_message_fader_text']).'</span>';
2104  $ret .= '</div>'.(defined('__DEBUG_MODE__') ? "\n" : '');
2105  $ret .= '<div class="bmlt_admin_fader_div item_hidden" id="bmlt_admin_fader_account_success_div">';
2106  $ret .= '<span class="success_text_span">'.htmlspecialchars($this->my_localized_strings['comdef_server_admin_strings']['account_change_fader_success_text']).'</span>';
2107  $ret .= '</div>';
2108  $ret .= '<div class="bmlt_admin_fader_div item_hidden" id="bmlt_admin_fader_account_fail_div">';
2109  $ret .= '<span class="failure_text_span">'.htmlspecialchars($this->my_localized_strings['comdef_server_admin_strings']['account_change_fader_failure_text']).'</span>';
2110  $ret .= '</div>';
2111  $ret .= '</div>';
2112  $ret .= '</div>';
2113  $ret .= '<input type="hidden" id="account_affected_user_id" value="'.htmlspecialchars($this->my_user->GetID()).'" />';
2114  $ret .= '<div class="bmlt_admin_user_account_edit_form_inner_div">';
2115  $ret .= '<div class="bmlt_admin_one_line_in_a_form clear_both">';
2116  $ret .= '<span class="bmlt_admin_med_label_right">'.htmlspecialchars($this->my_localized_strings['comdef_server_admin_strings']['account_name_label']).'</span>';
2117  $ret .= '<span class="bmlt_admin_value_left">';
2118  if ($this->my_user->GetUserLevel() == _USER_LEVEL_SERVER_ADMIN) {
2119  $ret .= '<span class="bmlt_admin_value_left"><input name="bmlt_admin_user_name_input" id="bmlt_admin_user_name_input" type="text" value="'.htmlspecialchars($this->my_user->GetLocalName()).'" onkeyup="admin_handler_object.handleTextInputChange(this);" onchange="admin_handler_object.handleTextInputChange(this);" onfocus="admin_handler_object.handleTextInputFocus(this);" onblur="admin_handler_object.handleTextInputBlur(this);" /></span>';
2120  $ret .= '<script type="text/javascript">admin_handler_object.handleTextInputLoad(document.getElementById(\'bmlt_admin_user_name_input\'),\''.htmlspecialchars($this->my_localized_strings['comdef_server_admin_strings']['user_editor_name_default_text']).'\');</script>';
2121  } else {
2122  $ret .= htmlspecialchars($this->my_user->GetLocalName());
2123  }
2124  $ret .= '</span>';
2125  $ret .= '<div class="clear_both"></div>';
2126  $ret .= '</div>';
2127  $ret .= '<div class="bmlt_admin_one_line_in_a_form clear_both">';
2128  $ret .= '<span class="bmlt_admin_med_label_right">'.htmlspecialchars($this->my_localized_strings['comdef_server_admin_strings']['account_login_label']).'</span>';
2129  $ret .= '<span class="bmlt_admin_value_left">';
2130  if ($this->my_user->GetUserLevel() == _USER_LEVEL_SERVER_ADMIN) {
2131  $ret .= '<span class="bmlt_admin_value_left"><input name="bmlt_admin_user_login_input" id="bmlt_admin_user_login_input" type="text" value="'.htmlspecialchars($this->my_user->GetLogin()).'" onkeyup="admin_handler_object.handleTextInputChange(this);" onchange="admin_handler_object.handleTextInputChange(this);" onfocus="admin_handler_object.handleTextInputFocus(this);" onblur="admin_handler_object.handleTextInputBlur(this);" /></span>';
2132  $ret .= '<script type="text/javascript">admin_handler_object.handleTextInputLoad(document.getElementById(\'bmlt_admin_user_login_input\'),\''.htmlspecialchars($this->my_localized_strings['comdef_server_admin_strings']['user_editor_login_default_text']).'\');</script>';
2133  } else {
2134  $ret .= htmlspecialchars($this->my_user->GetLogin());
2135  }
2136  $ret .= '</span>';
2137  $ret .= '<div class="clear_both"></div>';
2138  $ret .= '</div>';
2139  $ret .= '<div class="bmlt_admin_one_line_in_a_form clear_both">';
2140  $ret .= '<span class="bmlt_admin_med_label_right">'.htmlspecialchars($this->my_localized_strings['comdef_server_admin_strings']['account_type_label']).'</span>';
2141  $ret .= '<span class="bmlt_admin_value_left">'.htmlspecialchars($this->my_localized_strings['comdef_server_admin_strings']['account_type_'.$this->my_user->GetUserLevel()]).'</span>';
2142  $ret .= '<div class="clear_both"></div>';
2143  $ret .= '</div>';
2144  $ret .= '<div class="bmlt_admin_one_line_in_a_form clear_both">';
2145  $ret .= '<span class="bmlt_admin_med_label_right">'.htmlspecialchars($this->my_localized_strings['comdef_server_admin_strings']['access_service_body_label']).'</span>';
2146  $ret .= '<div class="bmlt_admin_value_left">';
2147  for ($c = 0; $c < count($this->my_service_bodies); $c++) {
2148  $ret .= '<p';
2149  if ($this->my_service_bodies[$c]->UserCanEdit()) {
2150  $ret .= ' class="service_body_can_be_edited';
2151  if ($this->my_service_bodies[$c]->GetPrincipalUserID() == $this->my_user->GetID()) {
2152  $ret .= ' principal_user_p';
2153  }
2154  $ret .= '"';
2155  }
2156  $ret .= '>'.htmlspecialchars($this->my_service_bodies[$c]->GetLocalName());
2157 
2158  if ($c < (count($this->my_service_bodies) - 1)) {
2159  $ret .= ',';
2160  }
2161  $ret .= '</p>';
2162  }
2163  $ret .= '</div>';
2164  $ret .= '<div class="clear_both"></div>';
2165  $ret .= '</div>';
2166 
2167  $ret .= '<div class="bmlt_admin_one_line_in_a_form clear_both">';
2168  $ret .= '<span class="bmlt_admin_med_label_right">'.htmlspecialchars($this->my_localized_strings['comdef_server_admin_strings']['account_email_label']).'</span>';
2169  $ret .= '<span class="bmlt_admin_value_left"><input name="bmlt_admin_user_email_input" id="bmlt_admin_user_email_input" type="text" value="'.htmlspecialchars($this->my_user->GetEmailAddress()).'" onkeyup="admin_handler_object.handleTextInputChange(this);" onchange="admin_handler_object.handleTextInputChange(this);" onfocus="admin_handler_object.handleTextInputFocus(this);" onblur="admin_handler_object.handleTextInputBlur(this);" /></span>';
2170  $ret .= '<script type="text/javascript">admin_handler_object.handleTextInputLoad(document.getElementById(\'bmlt_admin_user_email_input\'),\''.htmlspecialchars($this->my_localized_strings['comdef_server_admin_strings']['email_address_default_text']).'\');</script>';
2171  $ret .= '<div class="clear_both"></div>';
2172  $ret .= '</div>';
2173  $ret .= '<div class="bmlt_admin_one_line_in_a_form clear_both">';
2174  $ret .= '<span class="bmlt_admin_med_label_right">'.htmlspecialchars($this->my_localized_strings['comdef_server_admin_strings']['account_description_label']).'</span>';
2175  $ret .= '<span class="bmlt_admin_value_left"><textarea cols="40" rows="10" name="bmlt_admin_user_description_textarea" id="bmlt_admin_user_description_textarea" class="bmlt_text_item" onkeyup="admin_handler_object.handleTextInputChange(this);" onchange="admin_handler_object.handleTextInputChange(this);" onfocus="admin_handler_object.handleTextInputFocus(this);" onblur="admin_handler_object.handleTextInputBlur(this);">'.htmlspecialchars($this->my_user->GetLocalDescription()).'</textarea></span>';
2176  $ret .= '<script type="text/javascript">admin_handler_object.handleTextInputLoad(document.getElementById(\'bmlt_admin_user_description_textarea\'),\''.htmlspecialchars($this->my_localized_strings['comdef_server_admin_strings']['account_description_default_text']).'\');</script>';
2177  $ret .= '<div class="clear_both"></div>';
2178  $ret .= '</div>';
2179  $ret .= '<div class="bmlt_admin_one_line_in_a_form clear_both">';
2180  $ret .= '<span class="bmlt_admin_med_label_right">'.htmlspecialchars($this->my_localized_strings['comdef_server_admin_strings']['change_password_label']).'</span>';
2181  $ret .= '<span class="bmlt_admin_value_left"><input name="bmlt_admin_user_account_password_input" id="bmlt_admin_user_account_password_input" type="text" value="'.htmlspecialchars($this->my_localized_strings['comdef_server_admin_strings']['change_password_default_text']).'" onkeyup="admin_handler_object.handleTextInputChange(this);" onchange="admin_handler_object.handleTextInputChange(this);" onfocus="admin_handler_object.handleTextInputFocus(this);" onblur="admin_handler_object.handleTextInputBlur(this);" /></span>';
2182  $ret .= '<script type="text/javascript">admin_handler_object.handleTextInputLoad(document.getElementById(\'bmlt_admin_user_account_password_input\'));</script>';
2183  $ret .= '<div class="clear_both"></div>';
2184  $ret .= '</div>';
2185  $ret .= '<div class="bmlt_admin_one_line_in_a_form clear_both">';
2186  $ret .= '<span class="bmlt_admin_med_label_right">&nbsp;</span>';
2187  $ret .= '<span id="bmlt_admin_account_change_ajax_button_span" class="bmlt_admin_value_left"><a id="bmlt_admin_account_change_ajax_button" href="javascript:admin_handler_object.handleAccountChange();" class="bmlt_admin_ajax_button button_disabled">'.htmlspecialchars($this->my_localized_strings['comdef_server_admin_strings']['account_change_button_text']).'</a></span>';
2188  $ret .= '<span id="bmlt_admin_account_change_ajax_button_throbber_span" class="bmlt_admin_value_left item_hidden"><img src="local_server/server_admin/style/images/ajax-throbber-white.gif" alt="AJAX Throbber" /></span>';
2189  $ret .= '<div class="clear_both"></div>';
2190  $ret .= '</div>';
2191  $ret .= '</div>';
2192  $ret .= '</div>';
2193 
2194  return $ret;
2195  }
2196 
2197  /************************************************************************************//**
2198  \brief Used to sort users and service body names.
2199  ****************************************************************************************/
2200  // phpcs:disable PSR1.Methods.CamelCapsMethodName.NotCamelCaps
2201  public function compare_names($a, $b)
2202  {
2203  // phpcs:enable PSR1.Methods.CamelCapsMethodName.NotCamelCaps
2204  return strnatcasecmp($a->GetLocalName(), $b->GetLocalName());
2205  }
2206 }
static GetLocalStrings($in_lang_enum=null)
This gets the appropriate language files, and puts all the the strings into an associative array...
$my_localized_strings
This will contain the localized strings and whatnot for display.
compare_names($a, $b)
Used to sort users and service body names.
$my_editable_service_bodies
This will contain all the Service bodies that we can actually directly edit.
if(file_exists($config_file_path)) $url_path
Definition: index.php:64
$my_all_service_bodies
This contains all Service bodies, cleaned for orphans.
$my_service_bodies
This will be an array that contains all the Service bodies this user can edit.
$my_ajax_uri
This will be the URI for AJAX calls.
static GetLongDataTableTemplate($in_lang_enum=null)
Returns an array that provides a template for the long data table values (the optional/additional val...
$ret
Definition: contact.php:226
const __DEBUG_MODE__
Definition: index.php:19
BMLTSemanticResult prototype formats
The selected formats. This is a CSV string of integer IDs.
const _USER_LEVEL_SERVICE_BODY_ADMIN
$my_observable_service_bodies
This contains all observable service bodies.
var admin_handler_object
const _USER_LEVEL_DISABLED
var a
$my_lang_ids
Contains the enumerations for all the server langs.
$my_data_field_templates
This holds the keys for all the possible data fields for this server.
const _USER_LEVEL_SERVER_ADMIN
GetURLToMainServerDirectory($inAllowHTTPS=true)
Returns a URL (HTTP) to the main_server directory (or renamed).
$my_users
This will be an array of all the user objects.
return_main_console_html()
Returns the HTML for the main admin console.
static MakeServer()
This is the factory for the server instantiation. It makes sure that only one instance exists...
$my_formats
The format objects that are available for meetings.
This class is the main server class. It instantiates a PDO database object, and is the starting point...
$my_user
This holds the instance of the logged-in user.
var n
static GetDataTableTemplate()
Returns an array that provides a template for the data table values (the optional/additional values)...
defined('BMLT_EXEC') or define('BMLT_EXEC'
Definition: index.php:3
Controls display of the main BMLT administration console.
$my_http_vars
Contains the HTTP vars sent in.