From 84388e68d5933e21e4d45300ca847dfbf4564807 Mon Sep 17 00:00:00 2001 From: Tomasz Wolniewicz <twoln@umk.pl> Date: Wed, 5 Jun 2024 18:46:32 +0200 Subject: [PATCH] unifying the options naming --- lib/API.php | 18 ++++++++++++------ page-logic/status.php | 2 +- templates/status.html | 2 +- 3 files changed, 14 insertions(+), 8 deletions(-) diff --git a/lib/API.php b/lib/API.php index 60c6333..1168829 100644 --- a/lib/API.php +++ b/lib/API.php @@ -91,6 +91,7 @@ class API { 'show_list', 'new_entities', 'only_errors', + 'only_issues', 'url_type', 'mod_time', 'lang', @@ -301,6 +302,11 @@ class API { $optValue = 0; } break; + case 'only_issues': + if ($optValue != 1 && $optValue != 2) { + $optValue = 0; + } + break; case 'details': if ($optValue != 1) { $optValue = 0; @@ -577,11 +583,11 @@ class API { $this->addStdArgument('fed_id'), $this->addStdArgument('reg_auth'), [ - 'arg' => 'only_errors', + 'arg' => 'only_issues', 'required' => FALSE, 'default' => '0', 'values' => '0, 1, 2', - 'description' => '0 - show all; 1 - only federations with feed problems and these with feeds close to expiry; 2 - show only federations with expiry time below the set valid_sec value'], + 'description' => '0 - show all; 1 - only federations with feed issues and these with feeds close to expiry; 2 - show only federations with expiry time below the set valid_sec value'], [ 'arg' => 'valid_sec', 'required' => FALSE, @@ -603,7 +609,7 @@ class API { when no federation code is present an array of code-indexed participating federations with details as described above' ], 'examples' => [ - ['opt' => ['only_errors'=>1,], 'title' => 'only fedrations with problems',], + ['opt' => ['only_issues'=>1,], 'title' => 'only fedrations with issues',], ['opt' => ['fed_id' => 'PIONIER-ID',],'title' => 'show status of PIONIER.Id',], ['opt' => ['fed_id' => 'PIONIER-ID',], 'format' => 'json', 'title' => 'show status of PIONIER.Id in JSON',] ] @@ -613,7 +619,7 @@ class API { } $edugain = new eduGAIN(5, $this->fed_id, true); $edugain->load_federations_state(); - if ($this->opts['only_errors'] > 0) { + if ($this->opts['only_issues'] > 0) { $out = []; if ($this->opts['valid_sec'] > 0) { $sec = $this->opts['valid_sec']; @@ -621,12 +627,12 @@ class API { $sec = VALIDITY_WARNING_THRESHOLD; } foreach ($edugain->FEDS as $fed) { - if ($this->opts['only_errors'] == 2) { + if ($this->opts['only_issues'] == 2) { if ($fed['valid_sec'] < $sec) { $out[$fed['code']] = $fed; } } - if ($this->opts['only_errors'] == 1) { + if ($this->opts['only_issues'] == 1) { if ($fed['valid_sec'] < $sec || $fed['feed_problem'] > 0 ) { $out[$fed['code']] = $fed; } diff --git a/page-logic/status.php b/page-logic/status.php index cc187f6..c4344a4 100644 --- a/page-logic/status.php +++ b/page-logic/status.php @@ -163,7 +163,7 @@ $data = []; $data['participants'] = $participants; $data['votingOnly'] = $votingOnly; $data['candidates'] = $candidates; -if (isset($_GET['problems'])) { +if (isset($_GET['issues'])) { $data['problem_switch'] = 1; } else { $data['problem_switch'] = 0; diff --git a/templates/status.html b/templates/status.html index 973b24d..81bc9da 100644 --- a/templates/status.html +++ b/templates/status.html @@ -20,7 +20,7 @@ </div> <div> <input type="checkbox" id="problem_filter" /> - <label for="include_problems">Limit to current feed problems</label> + <label for="include_issues">Limit to current feed issues</label> </div> </div> -- GitLab