-
Notifications
You must be signed in to change notification settings - Fork 344
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Replace all direct access to GET and POST in Test component with acco…
…rding DataRequestCollector calls
- Loading branch information
1 parent
0cbb7f3
commit a3bcf0c
Showing
17 changed files
with
224 additions
and
122 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,6 +18,8 @@ | |
|
||
declare(strict_types=1); | ||
|
||
use ILIAS\Test\RequestDataCollector; | ||
|
||
/** | ||
* @author Björn Heyser <[email protected]> | ||
* @version $Id$ | ||
|
@@ -26,15 +28,14 @@ | |
*/ | ||
class ilTestSettingsChangeConfirmationGUI extends ilConfirmationGUI | ||
{ | ||
protected ilObjTest $testOBJ; | ||
private ?string $oldQuestionSetType; | ||
private ?string $newQuestionSetType; | ||
private ?bool $questionLossInfoEnabled; | ||
|
||
public function __construct(ilObjTest $testOBJ) | ||
{ | ||
$this->testOBJ = $testOBJ; | ||
|
||
public function __construct( | ||
private readonly RequestDataCollector $testrequest, | ||
protected readonly ilObjTest $testOBJ | ||
) { | ||
parent::__construct(); | ||
} | ||
|
||
|
@@ -93,15 +94,18 @@ public function build(): void | |
|
||
public function populateParametersFromPost(): void | ||
{ | ||
foreach ($_POST as $key => $value) { | ||
if (strcmp($key, "cmd") != 0) { | ||
foreach ($this->testrequest->getPostKeys() as $key) { | ||
if ($key !== 'cmd') { | ||
$value = $this->testrequest->getArrayOfStringsOrStringFromPost($key); | ||
|
||
if (is_array($value)) { | ||
foreach ($value as $k => $v) { | ||
$this->addHiddenItem("{$key}[{$k}]", $v); | ||
} | ||
} else { | ||
$this->addHiddenItem($key, $value); | ||
continue; | ||
} | ||
|
||
$this->addHiddenItem($key, $value); | ||
} | ||
} | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.