ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
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  }
__construct(Container $dic, ilPlugin $plugin)
$DIC
Definition: xapitoken.php:46
+ 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 73 of file class.ilExcCriteriaBool.php.

References $lng, and ilExcCriteria\isRequired().

74  {
75  $lng = $this->lng;
76 
77  $caption = null;
78  if ($this->isRequired() && $a_value < 0) {
79  $caption = $lng->txt("no");
80  } elseif ($a_value == 1) {
81  $caption = $lng->txt("yes");
82  }
83  return $caption;
84  }
+ 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.

69  {
70  return (int) $a_value;
71  }

◆ 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: