Skip to content

Commit

Permalink
Merge pull request #108 from bmlt-enabled/Fix-to-asm-functionality
Browse files Browse the repository at this point in the history
Fix
  • Loading branch information
otrok7 authored Aug 28, 2019
2 parents f2bd707 + 4855642 commit 0b2ddef
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 22 deletions.
23 changes: 14 additions & 9 deletions bmlt-meeting-list.php
Original file line number Diff line number Diff line change
Expand Up @@ -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];
Expand Down Expand Up @@ -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])) {
Expand Down Expand Up @@ -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;
}
}
/**
Expand Down
2 changes: 1 addition & 1 deletion lang/translate_de.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?php
<?php
$translate = array (
"LANG_NAME" => "German",
"LOCALE" => "de_DE",
Expand Down
2 changes: 1 addition & 1 deletion lang/translate_fa.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?php
<?php
$translate = array (
"LANG_NAME" => "Farsi",
"LOCALE" => "fa_IR",
Expand Down
26 changes: 15 additions & 11 deletions partials/_meetings_setup.php
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,7 @@
<h3 class="hndle">Include Only This Meeting Format<span title='<?php echo $title; ?>' class="top-tooltip"></span></h3>
<div class="inside">
<?php if ($this_connected) { ?>
<?php $used_formats = $this->getUsedFormats(); ?>
<?php $used_formats = $this->getFormatsForSelect(false); ?>
<?php } ?>
<label for="used_format_1">Meeting Format: </label>
<select id="used_format_1" name="used_format_1">
Expand Down Expand Up @@ -302,16 +302,20 @@
<select id="asm_format_key" name="asm_format_key">
<?php if ($this_connected) { ?>
<option value="">Not Used</option>
<?php $countmax = count ( $used_formats ); ?>
<?php for ( $count = 0; $count < $countmax; $count++ ) { ?>
<?php if ( $used_formats[$count]['key_string'] == $this->options['asm_format_key'] ) { ?>
<option selected="selected" value="<?php echo esc_html($used_formats[$count]['key_string']) ?>"><?php echo esc_html($used_formats[$count]['name_string']) ?></option>
<?php } else { ?>
<option value="<?php echo esc_html($used_formats[$count]['key_string']) ?>"><?php echo esc_html($used_formats[$count]['name_string']) ?></option>
<?php } ?>
<?php } ?>
<?php } else { ?>
<option selected="selected" value="<?php echo $this->options['asm_format_key']; ?>"><?php echo 'ASM'; ?></option>
<?php
if ($this_connected) {
$used_formats = $this->getFormatsForSelect(true);
}
$countmax = count ( $used_formats );
for ( $count = 0; $count < $countmax; $count++ ) {
if ( $used_formats[$count]['key_string'] == $this->options['asm_format_key'] ) { ?>
<option selected="selected" value="<?php echo esc_html($used_formats[$count]['key_string']) ?>"><?php echo esc_html($used_formats[$count]['name_string']) ?></option>
<?php } else { ?>
<option value="<?php echo esc_html($used_formats[$count]['key_string']) ?>"><?php echo esc_html($used_formats[$count]['name_string']) ?></option>
<?php }
}
} else { ?>
<option selected="selected" value="<?php echo $this->options['asm_format_key']; ?>"><?php echo 'ASM'; ?></option>
<?php } ?>
</select>
</p><p>
Expand Down

0 comments on commit 0b2ddef

Please sign in to comment.