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

This class represents a captcha input in a property form. More...

+ Inheritance diagram for ilCaptchaInputGUI:
+ Collaboration diagram for ilCaptchaInputGUI:

Public Member Functions

 __construct ($a_title='', $a_postvar='')
 Constructor. More...
 
 setValue ($a_value)
 Set Value. More...
 
 getValue ()
 Get Value. More...
 
 setImageHeight ($image_height)
 
 getImageHeight ()
 
 setImageWidth ($image_width)
 
 getImageWidth ()
 
 setSize ($size)
 
 getSize ()
 
 checkInput ()
 Check input, strip slashes etc. More...
 
 insert (ilTemplate $a_tpl)
 
 setValueByArray ($a_values)
 Set value by array. More...
 
- Public Member Functions inherited from ilFormPropertyGUI
 __construct ($a_title="", $a_postvar="")
 Constructor. More...
 
executeCommand ()
 Execute command. More...
 
 getType ()
 Get Type. More...
 
 setTitle ($a_title)
 Set Title. More...
 
 getTitle ()
 Get Title. More...
 
 setPostVar ($a_postvar)
 Set Post Variable. More...
 
 getPostVar ()
 Get Post Variable. More...
 
 getFieldId ()
 Get Post Variable. More...
 
 setInfo ($a_info)
 Set Information Text. More...
 
 getInfo ()
 Get Information Text. More...
 
 setAlert ($a_alert)
 Set Alert Text. More...
 
 getAlert ()
 Get Alert Text. More...
 
 setRequired ($a_required)
 Set Required. More...
 
 getRequired ()
 Get Required. More...
 
 setDisabled ($a_disabled)
 Set Disabled. More...
 
 getDisabled ()
 Get Disabled. More...
 
 checkInput ()
 Check input, strip slashes etc. More...
 
 setParentForm ($a_parentform)
 Set Parent Form. More...
 
 getParentForm ()
 Get Parent Form. More...
 
 setParent ($a_val)
 Set Parent GUI object. More...
 
 getParent ()
 Get Parent GUI object. More...
 
 getSubForm ()
 Get sub form html. More...
 
 hideSubForm ()
 Sub form hidden on init? More...
 
 setHiddenTitle ($a_val)
 Set hidden title (for screenreaders) More...
 
 getHiddenTitle ()
 Get hidden title. More...
 
 getItemByPostVar ($a_post_var)
 Get item by post var. More...
 
 serializeData ()
 serialize data More...
 
 unserializeData ($a_data)
 unserialize data More...
 
 writeToSession ()
 Write to session. More...
 
 clearFromSession ()
 Clear session value. More...
 
 readFromSession ()
 Read from session. More...
 
 getHiddenTag ($a_post_var, $a_value)
 Get hidden tag (used for disabled properties) More...
 
 setMulti ($a_multi, $a_sortable=false, $a_addremove=true)
 Set Multi. More...
 
 getMulti ()
 Get Multi. More...
 
 setMultiValues (array $a_values)
 Set multi values. More...
 
 getMultiValues ()
 Get multi values. More...
 
 getContentOutsideFormTag ()
 Get content that has to reside outside of the parent form tag, e.g. More...
 
 removeProhibitedCharacters ($a_text)
 Remove prohibited characters see #19159. More...
 
 stripSlashesAddSpaceFallback ($a_str)
 Strip slashes with add space fallback, see https://www.ilias.de/mantis/view.php?id=19727. More...
 

Protected Attributes

 $value
 
 $size = 20
 
 $image_width = 215
 
 $image_height = 80
 
- Protected Attributes inherited from ilFormPropertyGUI
 $type
 
 $title
 
 $postvar
 
 $info
 
 $alert
 
 $required = false
 
 $parentgui
 
 $parentform
 
 $hidden_title = ""
 
 $multi = false
 
 $multi_sortable = false
 
 $multi_addremove = true
 
 $multi_values
 

Additional Inherited Members

- Protected Member Functions inherited from ilFormPropertyGUI
 setType ($a_type)
 Set Type. More...
 
 getMultiIconsHTML ()
 Get HTML for multiple value icons. More...
 

Detailed Description

This class represents a captcha input in a property form.

Author
Alex Killing alex..nosp@m.kill.nosp@m.ing@g.nosp@m.mx.d.nosp@m.e
Michael Jansen mjans.nosp@m.en@d.nosp@m.ataba.nosp@m.y.de
Version
$Id$

Definition at line 13 of file class.ilCaptchaInputGUI.php.

Constructor & Destructor Documentation

◆ __construct()

ilCaptchaInputGUI::__construct (   $a_title = '',
  $a_postvar = '' 
)

Constructor.

Parameters
string$a_titleTitle
string$a_postvarPost Variable

Reimplemented from ilFormPropertyGUI.

Definition at line 40 of file class.ilCaptchaInputGUI.php.

41 {
42 global $lng;
43
44 parent::__construct($a_title, $a_postvar);
45 $this->setType('captcha');
46 if($lng instanceof ilLanguage)
47 {
48 $lng->loadLanguageModule('cptch');
49 }
50 }
setType($a_type)
Set Type.
language handling
global $lng
Definition: privfeed.php:40

References $lng, and ilFormPropertyGUI\setType().

+ Here is the call graph for this function:

Member Function Documentation

◆ checkInput()

ilCaptchaInputGUI::checkInput ( )

Check input, strip slashes etc.

set alert, if input is not ok.

Returns
boolean Input ok, true/false

Reimplemented from ilFormPropertyGUI.

Definition at line 122 of file class.ilCaptchaInputGUI.php.

123 {
124 global $lng;
125
127 if($this->getRequired() && trim($_POST[$this->getPostVar()]) == '')
128 {
129 if($lng instanceof ilLanguage)
130 {
131 $this->setAlert($lng->txt('msg_input_is_required'));
132 }
133
134 return false;
135 }
136
137 include_once('./Services/Captcha/classes/class.ilSecurImage.php');
138 $si = new ilSecurImage();
139 if(!$si->check($_POST[$this->getPostVar()]))
140 {
141 if($lng instanceof ilLanguage)
142 {
143 $this->setAlert($lng->txt('cptch_wrong_input'));
144 }
145
146 return false;
147 }
148
149 return true;
150 }
getPostVar()
Get Post Variable.
setAlert($a_alert)
Set Alert Text.
SecurImage Wrapper (very simply wrapper, does not abstract other captchas)
static stripSlashes($a_str, $a_strip_html=true, $a_allow="")
strip slashes if magic qoutes is enabled
$_POST['username']
Definition: cron.php:12

References $_POST, $lng, $si, ilFormPropertyGUI\getPostVar(), ilFormPropertyGUI\getRequired(), ilFormPropertyGUI\setAlert(), and ilUtil\stripSlashes().

+ Here is the call graph for this function:

◆ getImageHeight()

ilCaptchaInputGUI::getImageHeight ( )
Returns
int

Definition at line 81 of file class.ilCaptchaInputGUI.php.

References $image_height.

◆ getImageWidth()

ilCaptchaInputGUI::getImageWidth ( )
Returns
int

Definition at line 97 of file class.ilCaptchaInputGUI.php.

References $image_width.

◆ getSize()

ilCaptchaInputGUI::getSize ( )
Returns
int

Definition at line 113 of file class.ilCaptchaInputGUI.php.

114 {
115 return $this->size;
116 }

References $size.

◆ getValue()

ilCaptchaInputGUI::getValue ( )

Get Value.

Returns
string Value

Definition at line 65 of file class.ilCaptchaInputGUI.php.

References $value.

◆ insert()

ilCaptchaInputGUI::insert ( ilTemplate  $a_tpl)
Parameters
ilTemplate$a_tpl

Definition at line 193 of file class.ilCaptchaInputGUI.php.

194 {
195 $html = $this->render();
196
197 $a_tpl->setCurrentBlock('prop_generic');
198 $a_tpl->setVariable('PROP_GENERIC', $html);
199 $a_tpl->parseCurrentBlock();
200 }
setVariable($variable, $value='')
Sets a variable value.
Definition: IT.php:626
parseCurrentBlock($part="DEFAULT")
Überladene Funktion, die auf den aktuelle Block vorher noch ein replace ausführt @access public.
setCurrentBlock($part="DEFAULT")
Überladene Funktion, die sich hier lokal noch den aktuellen Block merkt.
$html
Definition: example_001.php:87

References $html, ilTemplate\parseCurrentBlock(), ilTemplate\setCurrentBlock(), and HTML_Template_IT\setVariable().

+ Here is the call graph for this function:

◆ setImageHeight()

ilCaptchaInputGUI::setImageHeight (   $image_height)
Parameters
int$image_height

Definition at line 73 of file class.ilCaptchaInputGUI.php.

74 {
75 $this->image_height = $image_height;
76 }

References $image_height.

◆ setImageWidth()

ilCaptchaInputGUI::setImageWidth (   $image_width)
Parameters
int$image_width

Definition at line 89 of file class.ilCaptchaInputGUI.php.

90 {
91 $this->image_width = $image_width;
92 }

References $image_width.

◆ setSize()

ilCaptchaInputGUI::setSize (   $size)
Parameters
int$size

Definition at line 105 of file class.ilCaptchaInputGUI.php.

106 {
107 $this->size = $size;
108 }

References $size.

◆ setValue()

ilCaptchaInputGUI::setValue (   $a_value)

Set Value.

Parameters
string$a_valueValue

Definition at line 56 of file class.ilCaptchaInputGUI.php.

57 {
58 $this->value = $a_value;
59 }

Referenced by setValueByArray().

+ Here is the caller graph for this function:

◆ setValueByArray()

ilCaptchaInputGUI::setValueByArray (   $a_values)

Set value by array.

Parameters
array$a_valuesvalue array

Definition at line 206 of file class.ilCaptchaInputGUI.php.

207 {
208 $this->setValue($a_values[$this->getPostVar()]);
209 }
setValue($a_value)
Set Value.

References ilFormPropertyGUI\getPostVar(), and setValue().

+ Here is the call graph for this function:

Field Documentation

◆ $image_height

ilCaptchaInputGUI::$image_height = 80
protected

Definition at line 33 of file class.ilCaptchaInputGUI.php.

Referenced by getImageHeight(), and setImageHeight().

◆ $image_width

ilCaptchaInputGUI::$image_width = 215
protected

Definition at line 28 of file class.ilCaptchaInputGUI.php.

Referenced by getImageWidth(), and setImageWidth().

◆ $size

ilCaptchaInputGUI::$size = 20
protected

Definition at line 23 of file class.ilCaptchaInputGUI.php.

Referenced by getSize(), and setSize().

◆ $value

ilCaptchaInputGUI::$value
protected

Definition at line 18 of file class.ilCaptchaInputGUI.php.

Referenced by getValue().


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