From 48556422863d3db45765835eb79fe4b8d6457da0 Mon Sep 17 00:00:00 2001 From: otrok7 Date: Wed, 28 Aug 2019 14:16:05 +0200 Subject: [PATCH] Fix --- bmlt-meeting-list.php | 23 ++++++++++++++--------- lang/translate_de.php | 2 +- lang/translate_fa.php | 2 +- partials/_meetings_setup.php | 26 +++++++++++++++----------- 4 files changed, 31 insertions(+), 22 deletions(-) diff --git a/bmlt-meeting-list.php b/bmlt-meeting-list.php index 845df67..be4eb31 100644 --- a/bmlt-meeting-list.php +++ b/bmlt-meeting-list.php @@ -432,7 +432,13 @@ function testRootServer($override_root_server = null) { } // This is used from the AdminUI, not to generate the // meeting list. - function getUsedFormats() { + function getFormatsForSelect($all=false) { + if ($all) { + $results = $this->get_configured_root_server_request("client_interface/json/?switcher=GetFormats"); + $results = json_decode(wp_remote_retrieve_body($results), true); + $this->sortBySubkey($results, 'key_string'); + return $results; + } if ( !isset($this->options['recurse_service_bodies']) ) {$this->options['recurse_service_bodies'] = 1;} $area_data = explode(',',$this->options['service_body_1']); $service_body_id = $area_data[1]; @@ -1508,7 +1514,7 @@ function write_custom_section() { $this->mpdf->WriteHTML(utf8_encode(wpautop(stripslashes($this->options['custom_section_content'])))); } function locale_month_replacement($data, $case, $sym) { - $strpos = strpos($data, "[month_$case_"); + $strpos = strpos($data, "[month_$case"."_"); if ( $strpos !== false ) { $locLang = substr($data,$strpos+13,2); if (!isset($this->translate[$locLang])) { @@ -2030,17 +2036,16 @@ function fillUnsetOptions() { $this->fillUnsetStringOption('custom_query',''); $this->fillUnsetOption('cache_time', 0); $this->fillUnsetStringOption('extra_meetings', ''); - if (strlen($this->options[extra_meetings])>0) { + if (strlen($this->options['extra_meetings'])>0) { $this->options['extra_meetings_enabled'] = 1; }else{ $this->options['extra_meetings_enabled'] = 0; } - if ( !isset($this->options['asm_logged_in']) ) { - if (strlen ($this->options['bmlt_login_password']) > 0 && strlen ($this->options['bmlt_login_password']) > 0) { - $this->options['asm_logged_in'] = wp_remote_retrieve_body($this->authenticate_root_server()); - } else { - $this->options['asm_logged_in'] = false; - } + + if (strlen ($this->options['bmlt_login_password']) > 0 && strlen ($this->options['bmlt_login_password']) > 0) { + $this->options['asm_logged_in'] = wp_remote_retrieve_body($this->authenticate_root_server()); + } else { + $this->options['asm_logged_in'] = false; } } /** diff --git a/lang/translate_de.php b/lang/translate_de.php index 70f772c..fd6964c 100644 --- a/lang/translate_de.php +++ b/lang/translate_de.php @@ -1,4 +1,4 @@ - "German", "LOCALE" => "de_DE", diff --git a/lang/translate_fa.php b/lang/translate_fa.php index 02219de..183139d 100644 --- a/lang/translate_fa.php +++ b/lang/translate_fa.php @@ -1,4 +1,4 @@ - "Farsi", "LOCALE" => "fa_IR", diff --git a/partials/_meetings_setup.php b/partials/_meetings_setup.php index 3c45df0..505f4ee 100644 --- a/partials/_meetings_setup.php +++ b/partials/_meetings_setup.php @@ -263,7 +263,7 @@

Include Only This Meeting Format

- getUsedFormats(); ?> + getFormatsForSelect(false); ?> - - - options['asm_format_key'] ) { ?> - - - - - - - + getFormatsForSelect(true); + } + $countmax = count ( $used_formats ); + for ( $count = 0; $count < $countmax; $count++ ) { + if ( $used_formats[$count]['key_string'] == $this->options['asm_format_key'] ) { ?> + + + + +