ILIAS  release_5-1 Revision 5.0.0-5477-g43f3e3fab5f
ilExcCriteriaText Class Reference

Class ilExcCriteriaText. More...

+ Inheritance diagram for ilExcCriteriaText:
+ Collaboration diagram for ilExcCriteriaText:

Public Member Functions

 getType ()
 
 setMinChars ($a_value)
 
 getMinChars ()
 
 initCustomForm (ilPropertyFormGUI $a_form)
 
 exportCustomForm (ilPropertyFormGUI $a_form)
 
 importCustomForm (ilPropertyFormGUI $a_form)
 
 addToPeerReviewForm ($a_value=null)
 
 importFromPeerReviewForm ()
 
 validate ($a_value)
 
 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)
 
 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 ()
 

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 ()
 
- Protected Attributes inherited from ilExcCriteria
 $id
 
 $parent
 
 $title
 
 $desc
 
 $required
 
 $pos
 
 $def
 
 $form
 
 $ass
 
 $giver_id
 
 $peer_id
 

Detailed Description

Member Function Documentation

◆ addToPeerReviewForm()

ilExcCriteriaText::addToPeerReviewForm (   $a_value = null)

Reimplemented from ilExcCriteria.

Definition at line 75 of file class.ilExcCriteriaText.php.

76 {
77 global $lng;
78
79 $info = array();
80 if($this->getDescription())
81 {
82 $info[] = $this->getDescription();
83 }
84 if($this->getMinChars())
85 {
86 $info[] = $lng->txt("exc_peer_review_min_chars").": ".$this->getMinChars();
87 }
88 $info = implode("<br />", $info);
89
90 $input = new ilTextAreaInputGUI($this->getTitle(), "prccc_text_".$this->getId());
91 $input->setRows(10);
92 $input->setInfo($info);
93 $input->setRequired($this->isRequired());
94 $input->setValue($a_value);
95
96 $this->form->addItem($input);
97 }
This class represents a text area property in a property form.
$info
Definition: example_052.php:80
global $lng
Definition: privfeed.php:40

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

+ Here is the call graph for this function:

◆ exportCustomForm()

ilExcCriteriaText::exportCustomForm ( ilPropertyFormGUI  $a_form)

Reimplemented from ilExcCriteria.

Definition at line 52 of file class.ilExcCriteriaText.php.

53 {
54 $min = $this->getMinChars();
55 if($min)
56 {
57 $a_form->getItemByPostVar("peer_char_tgl")->setChecked(true);
58 $a_form->getItemByPostVar("peer_char")->setValue($min);
59 }
60 }
getItemByPostVar($a_post_var)
Get Item by POST variable.

References ilPropertyFormGUI\getItemByPostVar(), and getMinChars().

+ Here is the call graph for this function:

◆ getHTML()

ilExcCriteriaText::getHTML (   $a_value)

Reimplemented from ilExcCriteria.

Definition at line 136 of file class.ilExcCriteriaText.php.

137 {
138 return nl2br($a_value);
139 }

◆ getMinChars()

ilExcCriteriaText::getMinChars ( )

Definition at line 25 of file class.ilExcCriteriaText.php.

26 {
27 $def = $this->getDefinition();
28 if(is_array($def))
29 {
30 return $def["chars"];
31 }
32 }

References ilExcCriteria\$def, and ilExcCriteria\getDefinition().

Referenced by addToPeerReviewForm(), exportCustomForm(), and validate().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getType()

ilExcCriteriaText::getType ( )

Reimplemented from ilExcCriteria.

Definition at line 15 of file class.ilExcCriteriaText.php.

16 {
17 return "text";
18 }

◆ hasValue()

ilExcCriteriaText::hasValue (   $a_value)

Reimplemented from ilExcCriteria.

Definition at line 131 of file class.ilExcCriteriaText.php.

132 {
133 return (bool)strlen($a_value);
134 }

Referenced by validate().

+ Here is the caller graph for this function:

◆ importCustomForm()

ilExcCriteriaText::importCustomForm ( ilPropertyFormGUI  $a_form)

Reimplemented from ilExcCriteria.

Definition at line 62 of file class.ilExcCriteriaText.php.

63 {
64 $this->setDefinition(null);
65
66 if($a_form->getInput("peer_char_tgl"))
67 {
68 $this->setMinChars($a_form->getInput("peer_char"));
69 }
70 }
setDefinition(array $a_value=null)
getInput($a_post_var, $ensureValidation=true)
Returns the value of a HTTP-POST variable, identified by the passed id.

References ilPropertyFormGUI\getInput(), ilExcCriteria\setDefinition(), and setMinChars().

+ Here is the call graph for this function:

◆ importFromPeerReviewForm()

ilExcCriteriaText::importFromPeerReviewForm ( )

Reimplemented from ilExcCriteria.

Definition at line 99 of file class.ilExcCriteriaText.php.

100 {
101 return trim($this->form->getInput("prccc_text_".$this->getId()));
102 }

◆ initCustomForm()

ilExcCriteriaText::initCustomForm ( ilPropertyFormGUI  $a_form)

Reimplemented from ilExcCriteria.

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

39 {
40 global $lng;
41
42 $peer_char_tgl = new ilCheckboxInputGUI($lng->txt("exc_peer_review_min_chars_tgl"), "peer_char_tgl");
43 $a_form->addItem($peer_char_tgl);
44
45 $peer_char = new ilNumberInputGUI($lng->txt("exc_peer_review_min_chars"), "peer_char");
46 $peer_char->setInfo($lng->txt("exc_peer_review_min_chars_info"));
47 $peer_char->setRequired(true);
48 $peer_char->setSize(3);
49 $peer_char_tgl->addSubItem($peer_char);
50 }
This class represents a checkbox property in a property form.
This class represents a number property in a property form.
addItem($a_item)
Add Item (Property, SectionHeader).

References $lng, and ilPropertyFormGUI\addItem().

+ Here is the call graph for this function:

◆ setMinChars()

ilExcCriteriaText::setMinChars (   $a_value)

Definition at line 20 of file class.ilExcCriteriaText.php.

21 {
22 $this->setDefinition(array("chars" => (int)$a_value));
23 }

References ilExcCriteria\setDefinition().

Referenced by importCustomForm().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ validate()

ilExcCriteriaText::validate (   $a_value)

Reimplemented from ilExcCriteria.

Definition at line 104 of file class.ilExcCriteriaText.php.

105 {
106 global $lng;
107
108 if(!$this->hasValue($a_value) &&
109 !$this->isRequired())
110 {
111 return true;
112 }
113
114 $min = $this->getMinChars();
115 if($min)
116 {
117 include_once "Services/Utilities/classes/class.ilStr.php";
118 if(ilStr::strLen($a_value) < $min)
119 {
120 if($this->form)
121 {
122 $mess = sprintf($lng->txt("exc_peer_review_chars_invalid"), $min);
123 $this->form->getItemByPostVar("prccc_text_".$this->getId())->setAlert($mess);
124 }
125 return false;
126 }
127 }
128 return true;
129 }
static strLen($a_string)
Definition: class.ilStr.php:79

References $lng, ilExcCriteria\getId(), getMinChars(), hasValue(), ilExcCriteria\isRequired(), and ilStr\strLen().

+ Here is the call graph for this function:

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