ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
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  if( $context == self::CONTEXT_DYN_TEST_PLAYER )
57  {
58  $this->setHeaderText($this->lng->txt('conf_delete_pass_ctm'));
59  }
60  else
61  {
62  $this->setHeaderText($this->lng->txt('conf_delete_pass'));
63  }
64  }
65 }
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.