ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
class.ilAssQuestionAuthoringFormGUI.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/Form/classes/class.ilPropertyFormGUI.php';
12 {
16  protected $lng = null;
17 
21  public function __construct()
22  {
23  global $DIC; /* @var ILIAS\DI\Container $DIC */
24  $this->lng = $DIC['lng'];
25 
26  parent::__construct();
27  }
28 
33  {
34  //if( !$this->object->getSelfAssessmentEditingMode() && !$_GET["calling_test"] )
35  // $this->addCommandButton("saveEdit", $this->lng->txt("save_edit"));
36 
37  if (!$questionOBJ->getSelfAssessmentEditingMode()) {
38  $this->addCommandButton("saveReturn", $this->lng->txt("save_return"));
39  }
40 
41  $this->addCommandButton("save", $this->lng->txt("save"));
42  }
43 
48  public function replaceFormItemByPostVar(ilFormPropertyGUI $replacingItem)
49  {
50  $itemWasReplaced = false;
51 
52  $preparedItems = array();
53 
54  foreach ($this->getItems() as $dodgingItem) {
55  /* @var ilFormPropertyGUI $dodgingItem */
56 
57  if ($dodgingItem->getPostVar() == $replacingItem->getPostVar()) {
58  $preparedItems[] = $replacingItem;
59  $itemWasReplaced = true;
60  continue;
61  }
62 
63  $preparedItems[] = $dodgingItem;
64  }
65 
66  $this->setItems($preparedItems);
67 
68  return $itemWasReplaced;
69  }
70 }
addGenericAssessmentQuestionCommandButtons(assQuestion $questionOBJ)
This class represents a property form user interface.
setItems($a_items)
Set Items.
global $DIC
Definition: saml.php:7
Abstract basic class which is to be extended by the concrete assessment question type classes...
getPostVar()
Get Post Variable.
getSelfAssessmentEditingMode()
Get Self-Assessment Editing Mode.
__construct()
ilAssQuestionAuthoringFormGUI constructor.
replaceFormItemByPostVar(ilFormPropertyGUI $replacingItem)
addCommandButton($a_cmd, $a_text, $a_id="")
Add Command button.
This class represents a property in a property form.