ILIAS  release_7 Revision v7.30-3-g800a261c036
ilExcCriteriaBool Class Reference

Class ilExcCriteriaBool. More...

+ Inheritance diagram for ilExcCriteriaBool:
+ Collaboration diagram for ilExcCriteriaBool:

Public Member Functions

 __construct ()
 Constructor. More...
 
 getType ()
 
 addToPeerReviewForm ($a_value=null)
 
 importFromPeerReviewForm ()
 
 hasValue ($a_value)
 
 getHTML ($a_value)
 
- Public Member Functions inherited from ilExcCriteria
 getTranslatedType ()
 
 getId ()
 
 getType ()
 
 setParent ($a_value)
 
 getParent ()
 
 setTitle ($a_value)
 
 getTitle ()
 
 setDescription ($a_value)
 
 getDescription ()
 
 setRequired ($a_value)
 
 isRequired ()
 
 setPosition ($a_value)
 
 getPosition ()
 
 importDefinition ($a_def, $a_def_json)
 
 save ()
 
 update ()
 
 delete ()
 
 cloneObject ($a_target_parent_id)
 
 initCustomForm (ilPropertyFormGUI $a_form)
 
 exportCustomForm (ilPropertyFormGUI $a_form)
 
 importCustomForm (ilPropertyFormGUI $a_form)
 
 setPeerReviewContext (ilExAssignment $a_ass, $a_giver_id, $a_peer_id, ilPropertyFormGUI $a_form=null)
 
 addToPeerReviewForm ($a_value=null)
 
 importFromPeerReviewForm ()
 
 updateFromAjax ()
 
 validate ($a_value)
 
 hasValue ($a_value)
 
 getHTML ($a_value)
 
 resetReview ()
 

Protected Attributes

 $lng
 
- Protected Attributes inherited from ilExcCriteria
 $db
 
 $id
 
 $parent
 
 $title
 
 $desc
 
 $required
 
 $pos
 
 $def
 
 $form
 
 $ass
 
 $giver_id
 
 $peer_id
 

Additional Inherited Members

- Static Public Member Functions inherited from ilExcCriteria
static getInstanceById ($a_id)
 
static getInstancesByParentId ($a_parent_id)
 
static getTypesMap ()
 
static getInstanceByType ($a_type)
 
static deleteByParent ($a_parent_id)
 
- Protected Member Functions inherited from ilExcCriteria
 __construct ()
 
 setId ($a_id)
 
 setDefinition (array $a_value=null)
 
 getDefinition ()
 
 importFromDB (array $a_row)
 
 getDBProperties ()
 
 getLastPosition ()
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

ilExcCriteriaBool::__construct ( )

Constructor.

Definition at line 22 of file class.ilExcCriteriaBool.php.

References $DIC, and ILIAS\GlobalScreen\Provider\__construct().

23  {
24  global $DIC;
25 
27  $this->lng = $DIC->language();
28  }
global $DIC
Definition: goto.php:24
__construct(Container $dic, ilPlugin $plugin)
+ Here is the call graph for this function:

Member Function Documentation

◆ addToPeerReviewForm()

ilExcCriteriaBool::addToPeerReviewForm (   $a_value = null)

Definition at line 38 of file class.ilExcCriteriaBool.php.

References $lng, ilExcCriteria\getDescription(), ilExcCriteria\getId(), ilExcCriteria\getTitle(), and ilExcCriteria\isRequired().

39  {
40  $lng = $this->lng;
41 
42  if (!$this->isRequired()) {
43  $input = new ilCheckboxInputGUI($this->getTitle(), "prccc_bool_" . $this->getId());
44  $input->setInfo($this->getDescription());
45  $input->setRequired($this->isRequired());
46  $input->setChecked($a_value > 0);
47  } else {
48  $input = new ilSelectInputGUI($this->getTitle(), "prccc_bool_" . $this->getId());
49  $input->setInfo($this->getDescription());
50  $input->setRequired($this->isRequired());
51  $input->setValue($a_value);
52  $options = array();
53  if (!$a_value) {
54  $options[""] = $lng->txt("please_select");
55  }
56  $options[1] = $lng->txt("yes");
57  $options[-1] = $lng->txt("no");
58  $input->setOptions($options);
59  }
60  $this->form->addItem($input);
61  }
This class represents a checkbox property in a property form.
+ Here is the call graph for this function:

◆ getHTML()

ilExcCriteriaBool::getHTML (   $a_value)

Definition at line 77 of file class.ilExcCriteriaBool.php.

References $lng, and ilExcCriteria\isRequired().

78  {
79  $lng = $this->lng;
80 
81  $caption = null;
82  // see #35694, a non required un-checked checkbox is treated as a "no"
83  if (!$this->isRequired()) {
84  $caption = $lng->txt("no");
85  }
86  if ($this->isRequired() && $a_value < 0) {
87  $caption = $lng->txt("no");
88  } elseif ($a_value == 1) {
89  $caption = $lng->txt("yes");
90  }
91  return $caption;
92  }
+ Here is the call graph for this function:

◆ getType()

ilExcCriteriaBool::getType ( )

Definition at line 30 of file class.ilExcCriteriaBool.php.

31  {
32  return "bool";
33  }

◆ hasValue()

ilExcCriteriaBool::hasValue (   $a_value)

Definition at line 68 of file class.ilExcCriteriaBool.php.

References ilExcCriteria\isRequired().

69  {
70  // see #35695, a non required un-checked checkbox is treated as a value
71  if (!is_null($a_value) && !$this->isRequired()) {
72  return 1;
73  }
74  return (int) $a_value;
75  }
+ Here is the call graph for this function:

◆ importFromPeerReviewForm()

ilExcCriteriaBool::importFromPeerReviewForm ( )

Definition at line 63 of file class.ilExcCriteriaBool.php.

References ilExcCriteria\getId().

64  {
65  return (int) $this->form->getInput("prccc_bool_" . $this->getId());
66  }
+ Here is the call graph for this function:

Field Documentation

◆ $lng

ilExcCriteriaBool::$lng
protected

Definition at line 16 of file class.ilExcCriteriaBool.php.

Referenced by addToPeerReviewForm(), and getHTML().


The documentation for this class was generated from the following file: