Skip to content

Commit

Permalink
Merge branch 'MDL-79484' of https://github.com/paulholden/moodle
Browse files Browse the repository at this point in the history
  • Loading branch information
junpataleta committed Sep 26, 2023
2 parents 4569711 + 4cbce0b commit 4cb2b3c
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions admin/tool/mfa/classes/local/admin_setting_managemfa.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@

namespace tool_mfa\local;

use tool_mfa\local\factor\object_factor_base;

defined('MOODLE_INTERNAL') || die();

require_once($CFG->libdir.'/ddllib.php');
Expand Down Expand Up @@ -200,14 +202,13 @@ public function define_factor_combinations_table() {
$table->colclasses = ['leftalign', 'centeralign'];
$table->data = [];

$factorstringconnector = get_string('connector', 'tool_mfa');
foreach ($combinations as $combination) {
$string = '';
foreach ($combination['combination'] as $factor) {
$string .= ' ' . get_string('connector', 'tool_mfa') . ' ' . $factor->get_summary_condition()
. ' <sup>' . $factor->get_weight() . '</sup>';
}
$factorstrings = array_map(static function(object_factor_base $factor): string {
return $factor->get_summary_condition() . ' <sup>' . $factor->get_weight() . '</sup>';
}, $combination['combination']);

$string = substr($string, 4);
$string = implode(" {$factorstringconnector} ", $factorstrings);
$table->data[] = new \html_table_row([$string, $combination['totalweight']]);
}

Expand Down

0 comments on commit 4cb2b3c

Please sign in to comment.