ILIAS  release_4-4 Revision
All Data Structures Namespaces Files Functions Variables Modules Pages
ilEMailInputGUI Class Reference

This class represents a email property in a property form. More...

+ Inheritance diagram for ilEMailInputGUI:
+ Collaboration diagram for ilEMailInputGUI:

Public Member Functions

 __construct ($a_title="", $a_postvar="")
 Constructor. More...
 
 setValue ($a_value)
 Set Value. More...
 
 getValue ()
 Get Value. More...
 
 setValueByArray ($a_values)
 Set value by array. More...
 
 checkInput ()
 Check input, strip slashes etc. More...
 
 insert (ilTemplate $a_tpl)
 
 setRetype ($a_val)
 
 getRetype ()
 
 setRetypeValue ($a_retypevalue)
 
 getRetypeValue ()
 
 setSize ($size)
 
 getSize ()
 
 setMaxLength ($max_length)
 
 getMaxLength ()
 
- 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...
 

Protected Attributes

 $value
 
 $size = 30
 
 $max_length = 80
 
 $retype = false
 
 $retypevalue = ''
 
- 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 email property in a property form.

Author
Alex Killing alex..nosp@m.kill.nosp@m.ing@g.nosp@m.mx.d.nosp@m.e
Version
$Id$

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

Constructor & Destructor Documentation

◆ __construct()

ilEMailInputGUI::__construct (   $a_title = "",
  $a_postvar = "" 
)

Constructor.

Parameters
string$a_titleTitle
string$a_postvarPost Variable

Definition at line 51 of file class.ilEMailInputGUI.php.

References setRetype().

52  {
53  parent::__construct($a_title, $a_postvar);
54  $this->setRetype(false);
55  }
+ Here is the call graph for this function:

Member Function Documentation

◆ checkInput()

ilEMailInputGUI::checkInput ( )

Check input, strip slashes etc.

set alert, if input is not ok.

Returns
boolean Input ok, true/false

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

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

90  {
91  global $lng;
92 
94  $_POST[$this->getPostVar() . '_retype'] = ilUtil::stripSlashes($_POST[$this->getPostVar() . '_retype']);
95  if($this->getRequired() && trim($_POST[$this->getPostVar()]) == "")
96  {
97  $this->setAlert($lng->txt("msg_input_is_required"));
98 
99  return false;
100  }
101  if($this->getRetype() && ($_POST[$this->getPostVar()] != $_POST[$this->getPostVar() . '_retype']))
102  {
103  $this->setAlert($lng->txt('email_not_match'));
104 
105  return false;
106  }
107  if(!ilUtil::is_email($_POST[$this->getPostVar()]) &&
108  trim($_POST[$this->getPostVar()]) != ""
109  )
110  {
111  $this->setAlert($lng->txt("email_not_valid"));
112 
113  return false;
114  }
115 
116 
117  return true;
118  }
$_POST['username']
Definition: cron.php:12
getPostVar()
Get Post Variable.
static is_email($a_email)
This preg-based function checks whether an e-mail address is formally valid.
setAlert($a_alert)
Set Alert Text.
static stripSlashes($a_str, $a_strip_html=true, $a_allow="")
strip slashes if magic qoutes is enabled
global $lng
Definition: privfeed.php:40
+ Here is the call graph for this function:

◆ getMaxLength()

ilEMailInputGUI::getMaxLength ( )
Returns
int

Definition at line 222 of file class.ilEMailInputGUI.php.

References $max_length.

Referenced by insert().

223  {
224  return $this->max_length;
225  }
+ Here is the caller graph for this function:

◆ getRetype()

ilEMailInputGUI::getRetype ( )
Returns
boolean

Definition at line 174 of file class.ilEMailInputGUI.php.

References $retype.

Referenced by checkInput(), and insert().

175  {
176  return $this->retype;
177  }
+ Here is the caller graph for this function:

◆ getRetypeValue()

ilEMailInputGUI::getRetypeValue ( )
Returns
string

Definition at line 190 of file class.ilEMailInputGUI.php.

References $retypevalue.

Referenced by insert().

191  {
192  return $this->retypevalue;
193  }
+ Here is the caller graph for this function:

◆ getSize()

ilEMailInputGUI::getSize ( )
Returns
int

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

References $size.

Referenced by insert().

207  {
208  return $this->size;
209  }
+ Here is the caller graph for this function:

◆ getValue()

ilEMailInputGUI::getValue ( )

Get Value.

Returns
string Value

Definition at line 70 of file class.ilEMailInputGUI.php.

References $value.

Referenced by insert().

71  {
72  return $this->value;
73  }
+ Here is the caller graph for this function:

◆ insert()

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

Definition at line 123 of file class.ilEMailInputGUI.php.

References $lng, ilFormPropertyGUI\getDisabled(), ilFormPropertyGUI\getFieldId(), ilFormPropertyGUI\getHiddenTag(), getMaxLength(), ilFormPropertyGUI\getPostVar(), getRetype(), getRetypeValue(), getSize(), getValue(), ilTemplate\parseCurrentBlock(), ilUtil\prepareFormOutput(), ilTemplate\setCurrentBlock(), and HTML_Template_IT\setVariable().

124  {
125  global $lng;
126 
127  $ptpl = new ilTemplate('tpl.prop_email.html', true, true, 'Services/Form');
128 
129  if($this->getRetype())
130  {
131  $ptpl->setCurrentBlock('retype_email');
132  $ptpl->setVariable('RSIZE', $this->getSize());
133  $ptpl->setVariable('RID', $this->getFieldId());
134  $ptpl->setVariable('RMAXLENGTH', $this->getMaxLength());
135  $ptpl->setVariable('RPOST_VAR', $this->getPostVar());
136 
137  $retype_value = $this->getRetypeValue();
138  $ptpl->setVariable('PROPERTY_RETYPE_VALUE', ilUtil::prepareFormOutput($retype_value));
139  if($this->getDisabled())
140  {
141  $ptpl->setVariable('RDISABLED', ' disabled="disabled"');
142  }
143  $ptpl->setVariable('TXT_RETYPE', $lng->txt('form_retype_email'));
144  $ptpl->parseCurrentBlock();
145  }
146 
147  $ptpl->setVariable('POST_VAR', $this->getPostVar());
148  $ptpl->setVariable('ID', $this->getFieldId());
149  $ptpl->setVariable('PROPERTY_VALUE', ilUtil::prepareFormOutput($this->getValue()));
150  $ptpl->setVariable('SIZE', $this->getSize());
151  $ptpl->setVariable('MAXLENGTH', $this->getMaxLength());
152  if($this->getDisabled())
153  {
154  $ptpl->setVariable('DISABLED', ' disabled="disabled"');
155  $ptpl->setVariable('HIDDEN_INPUT', $this->getHiddenTag($this->getPostVar(), $this->getValue()));
156  }
157 
158  $a_tpl->setCurrentBlock('prop_generic');
159  $a_tpl->setVariable('PROP_GENERIC', $ptpl->get());
160  $a_tpl->parseCurrentBlock();
161  }
static prepareFormOutput($a_str, $a_strip=false)
prepares string output for html forms public
getHiddenTag($a_post_var, $a_value)
Get hidden tag (used for disabled properties)
getPostVar()
Get Post Variable.
setVariable($variable, $value='')
Sets a variable value.
Definition: IT.php:626
getFieldId()
Get Post Variable.
special template class to simplify handling of ITX/PEAR
setCurrentBlock($part="DEFAULT")
Überladene Funktion, die sich hier lokal noch den aktuellen Block merkt.
global $lng
Definition: privfeed.php:40
parseCurrentBlock($part="DEFAULT")
Überladene Funktion, die auf den aktuelle Block vorher noch ein replace ausführt public...
+ Here is the call graph for this function:

◆ setMaxLength()

ilEMailInputGUI::setMaxLength (   $max_length)
Parameters
int$max_length

Definition at line 214 of file class.ilEMailInputGUI.php.

References $max_length.

215  {
216  $this->max_length = $max_length;
217  }

◆ setRetype()

ilEMailInputGUI::setRetype (   $a_val)
Parameters
boolean$a_val

Definition at line 166 of file class.ilEMailInputGUI.php.

Referenced by __construct().

167  {
168  $this->retype = $a_val;
169  }
+ Here is the caller graph for this function:

◆ setRetypeValue()

ilEMailInputGUI::setRetypeValue (   $a_retypevalue)
Parameters
string$a_retypevalue

Definition at line 182 of file class.ilEMailInputGUI.php.

Referenced by setValueByArray().

183  {
184  $this->retypevalue = $a_retypevalue;
185  }
+ Here is the caller graph for this function:

◆ setSize()

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

Definition at line 198 of file class.ilEMailInputGUI.php.

References $size.

199  {
200  $this->size = $size;
201  }

◆ setValue()

ilEMailInputGUI::setValue (   $a_value)

Set Value.

Parameters
string$a_valueValue

Definition at line 61 of file class.ilEMailInputGUI.php.

Referenced by ilUserProfile\addStandardFieldsToForm(), and setValueByArray().

62  {
63  $this->value = $a_value;
64  }
+ Here is the caller graph for this function:

◆ setValueByArray()

ilEMailInputGUI::setValueByArray (   $a_values)

Set value by array.

Parameters
array$a_valuesvalue array

Definition at line 79 of file class.ilEMailInputGUI.php.

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

80  {
81  $this->setValue($a_values[$this->getPostVar()]);
82  $this->setRetypeValue($a_values[$this->getPostVar() . '_retype']);
83  }
setValue($a_value)
Set Value.
getPostVar()
Get Post Variable.
setRetypeValue($a_retypevalue)
+ Here is the call graph for this function:

Field Documentation

◆ $max_length

ilEMailInputGUI::$max_length = 80
protected

Definition at line 34 of file class.ilEMailInputGUI.php.

Referenced by getMaxLength(), and setMaxLength().

◆ $retype

ilEMailInputGUI::$retype = false
protected

Definition at line 39 of file class.ilEMailInputGUI.php.

Referenced by getRetype().

◆ $retypevalue

ilEMailInputGUI::$retypevalue = ''
protected

Definition at line 44 of file class.ilEMailInputGUI.php.

Referenced by getRetypeValue().

◆ $size

ilEMailInputGUI::$size = 30
protected

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

Referenced by getSize(), and setSize().

◆ $value

ilEMailInputGUI::$value
protected

Definition at line 32 of file class.ilEMailInputGUI.php.

Referenced by getValue().


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