ILIAS  Release_5_0_x_branch Revision 61816
 All Data Structures Namespaces Files Functions Variables Groups Pages
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  {
43  case self::CONTEXT_PASS_OVERVIEW:
44  case self::CONTEXT_INFO_SCREEN:
45  case self::CONTEXT_DYN_TEST_PLAYER:
46 
47  $this->addHiddenItem('context', $context);
48  break;
49 
50  default: throw new ilTestException('invalid context given!');
51  }
52 
53  $this->setCancel($this->lng->txt('cancel'), 'cancelDeletePass');
54  $this->setConfirm($this->lng->txt('delete'), 'performDeletePass');
55 
56  $this->setHeaderText($this->lng->txt('conf_delete_pass'));
57  }
58 }