ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
class.ilTestPassDeletionConfirmationGUI.php
Go to the documentation of this file.
1 <?php
2 /* Copyright (c) 1998-2013 ILIAS open source, Extended GPL, see docs/LICENSE */
3 
4 require_once './Services/Utilities/classes/class.ilConfirmationGUI.php';
5 
13 {
14  const CONTEXT_PASS_OVERVIEW = 'contPassOverview';
15  const CONTEXT_INFO_SCREEN = 'contInfoScreen';
16  const CONTEXT_DYN_TEST_PLAYER = 'contDynTestPlayer';
17 
21  protected $ctrl;
22 
26  protected $lng;
27 
28  public function __construct(ilCtrl $ctrl, ilLanguage $lng, $parentGUI)
29  {
30  $this->ctrl = $ctrl;
31  $this->lng = $lng;
32 
33  $this->setFormAction($this->ctrl->getFormAction($parentGUI));
34  }
35 
36  public function build($activeId, $pass, $context)
37  {
38  $this->addHiddenItem('active_id', $activeId);
39  $this->addHiddenItem('pass', $pass);
40 
41  switch ($context) {
42  case self::CONTEXT_PASS_OVERVIEW:
43  case self::CONTEXT_INFO_SCREEN:
44  case self::CONTEXT_DYN_TEST_PLAYER:
45 
46  $this->addHiddenItem('context', $context);
47  break;
48 
49  default: throw new ilTestException('invalid context given!');
50  }
51 
52  $this->setCancel($this->lng->txt('cancel'), 'cancelDeletePass');
53  $this->setConfirm($this->lng->txt('delete'), 'performDeletePass');
54 
55  if ($context == self::CONTEXT_DYN_TEST_PLAYER) {
56  $this->setHeaderText($this->lng->txt('conf_delete_pass_ctm'));
57  } else {
58  $this->setHeaderText($this->lng->txt('conf_delete_pass'));
59  }
60  }
61 }
This class provides processing control methods.
addHiddenItem($a_post_var, $a_value)
Add hidden item.
setFormAction($a_form_action)
setConfirm($a_txt, $a_cmd, $a_id="")
Set confirmation button command and text.
Base Exception for all Exceptions relating to Modules/Test.
setCancel($a_txt, $a_cmd, $a_id="")
Set cancel button command and text.
setHeaderText($a_headertext)
Set Set header text.
__construct(ilCtrl $ctrl, ilLanguage $lng, $parentGUI)
language handling
Confirmation screen class.