ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
ilAlphabetInputGUI Class Reference

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

+ Inheritance diagram for ilAlphabetInputGUI:
+ Collaboration diagram for ilAlphabetInputGUI:

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...
 
 setLetters ($a_val)
 Set letters available. More...
 
 getLetters ()
 Get letters available. More...
 
 checkInput ()
 Check input, strip slashes etc. More...
 
 setFixDBUmlauts ($a_val)
 Set fix db umlauts. More...
 
 getFixDBUmlauts ()
 Get fix db umlauts. More...
 
 fixDBUmlauts ($l)
 Fix db umlauts. More...
 
 setParentCommand ($a_obj, $a_cmd)
 Insert property html. More...
 
 setHighlighted ($a_high_letter)
 Set highlighted. More...
 
 getToolbarHTML ()
 Get HTML for toolbar. 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...
 
 stripSlashesAddSpaceFallback ($a_str)
 Strip slashes with add space fallback, see https://www.ilias.de/mantis/view.php?id=19727. More...
 
 getTableFilterLabelFor ()
 Get label "for" attribute value for filter. More...
 
 getFormLabelFor ()
 Get label "for" attribute value for form. More...
 

Protected Member Functions

 render ($a_mode="")
 Render item. More...
 
- Protected Member Functions inherited from ilFormPropertyGUI
 setType ($a_type)
 Set Type. More...
 
 getMultiIconsHTML ()
 Get HTML for multiple value icons. More...
 

Protected Attributes

 $lng
 
 $ctrl
 
 $letters
 
 $parent_object
 
 $parent_cmd
 
 $highlight
 
 $highlight_letter
 
 $fix_db_umlauts = false
 
- Protected Attributes inherited from ilFormPropertyGUI
 $ctrl
 
 $lng
 
 $type
 
 $title
 
 $postvar
 
 $info
 
 $alert
 
 $required = false
 
 $parentgui
 
 $parentform
 
 $hidden_title = ""
 
 $multi = false
 
 $multi_sortable = false
 
 $multi_addremove = true
 
 $multi_values
 

Additional Inherited Members

- Static Public Member Functions inherited from ilFormPropertyGUI
static removeProhibitedCharacters ($a_text)
 Remove prohibited characters see #19159. More...
 

Detailed Description

This class represents a text 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 15 of file class.ilAlphabetInputGUI.php.

Constructor & Destructor Documentation

◆ __construct()

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

Constructor.

Parameters
string$a_titleTitle
string$a_postvarPost Variable

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

References $DIC.

45  {
46  global $DIC;
47 
48  $this->lng = $DIC->language();
49  $this->ctrl = $DIC->ctrl();
50  parent::__construct($a_title, $a_postvar);
51  }
global $DIC
Definition: saml.php:7

Member Function Documentation

◆ checkInput()

ilAlphabetInputGUI::checkInput ( )

Check input, strip slashes etc.

set alert, if input is not ok.

Returns
boolean Input ok, true/false

Definition at line 109 of file class.ilAlphabetInputGUI.php.

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

110  {
111  $lng = $this->lng;
112 
113  $_POST[$this->getPostVar()] = ilUtil::stripSlashes($_POST[$this->getPostVar()]);
114  if ($this->getRequired() && trim($_POST[$this->getPostVar()]) == "") {
115  $this->setAlert($lng->txt("msg_input_is_required"));
116 
117  return false;
118  }
119 
120  return true;
121  }
getPostVar()
Get Post Variable.
setAlert($a_alert)
Set Alert Text.
static stripSlashes($a_str, $a_strip_html=true, $a_allow="")
strip slashes if magic qoutes is enabled
$_POST["username"]
+ Here is the call graph for this function:

◆ fixDBUmlauts()

ilAlphabetInputGUI::fixDBUmlauts (   $l)

Fix db umlauts.

Parameters

Definition at line 149 of file class.ilAlphabetInputGUI.php.

References $l, and ilUtil\dbSupportsDisctinctUmlauts().

Referenced by getToolbarHTML().

150  {
151  if ($this->fix_db_umlauts && !ilUtil::dbSupportsDisctinctUmlauts()) {
152  $l = str_replace(array("Ä", "Ö", "Ü", "ä", "ö", "ü"), array("A", "O", "U", "a", "o", "u"), $l);
153  }
154  return $l;
155  }
static dbSupportsDisctinctUmlauts()
Only temp fix for #8603, should go to db classes.
global $l
Definition: afr.php:30
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getFixDBUmlauts()

ilAlphabetInputGUI::getFixDBUmlauts ( )

Get fix db umlauts.

Returns
bool fix db umlauts

Definition at line 138 of file class.ilAlphabetInputGUI.php.

References $fix_db_umlauts.

139  {
140  return $this->fix_db_umlauts;
141  }

◆ getLetters()

ilAlphabetInputGUI::getLetters ( )

Get letters available.

Returns
array letters

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

References $letters.

Referenced by getToolbarHTML().

100  {
101  return $this->letters;
102  }
+ Here is the caller graph for this function:

◆ getToolbarHTML()

ilAlphabetInputGUI::getToolbarHTML ( )

Get HTML for toolbar.

Implements ilToolbarItem.

Definition at line 205 of file class.ilAlphabetInputGUI.php.

References $ctrl, $ilCtrl, $l, $lng, $tpl, fixDBUmlauts(), and getLetters().

206  {
208  $lng = $this->lng;
209 
210  $lng->loadLanguageModule("form");
211 
212  $tpl = new ilTemplate("tpl.prop_alphabet.html", true, true, "Services/Form");
213  foreach ((array) $this->getLetters() as $l) {
214  $l = $this->fixDBUmlauts($l);
215  $tpl->setCurrentBlock("letter");
216  $tpl->setVariable("TXT_LET", $l);
217  $ilCtrl->setParameter($this->parent_object, "letter", rawurlencode($l));
218  $tpl->setVariable("TXT_LET", $l);
219  $tpl->setVariable("HREF_LET", $ilCtrl->getLinkTarget($this->parent_object, $this->parent_cmd));
220  if ($this->highlight && $this->highlight_letter !== null && $this->highlight_letter == $l) {
221  $tpl->setVariable("CLASS", ' class="ilHighlighted" ');
222  }
223  $tpl->parseCurrentBlock();
224  }
225  $ilCtrl->setParameter($this->parent_object, "letter", "");
226  $tpl->setVariable("TXT_ALL", $lng->txt("form_alphabet_all"));
227  $tpl->setVariable("HREF_ALL", $ilCtrl->getLinkTarget($this->parent_object, $this->parent_cmd));
228  if ($this->highlight && $this->highlight_letter === null) {
229  $tpl->setVariable("CLASSA", ' class="ilHighlighted" ');
230  }
231  return $tpl->get();
232  }
$tpl
Definition: ilias.php:10
fixDBUmlauts($l)
Fix db umlauts.
global $ilCtrl
Definition: ilias.php:18
special template class to simplify handling of ITX/PEAR
global $l
Definition: afr.php:30
getLetters()
Get letters available.
+ Here is the call graph for this function:

◆ getValue()

ilAlphabetInputGUI::getValue ( )

Get Value.

Returns
string Value

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

69  {
70  return $this->value;
71  }

◆ render()

ilAlphabetInputGUI::render (   $a_mode = "")
protected

Render item.

Definition at line 161 of file class.ilAlphabetInputGUI.php.

162  {
163  die("only implemented for toolbar usage");
164  }

◆ setFixDBUmlauts()

ilAlphabetInputGUI::setFixDBUmlauts (   $a_val)

Set fix db umlauts.

Parameters
bool$a_valfix db umlauts

Definition at line 128 of file class.ilAlphabetInputGUI.php.

129  {
130  $this->fix_db_umlauts = $a_val;
131  }

◆ setHighlighted()

ilAlphabetInputGUI::setHighlighted (   $a_high_letter)

Set highlighted.

Parameters

Definition at line 196 of file class.ilAlphabetInputGUI.php.

197  {
198  $this->highlight = true;
199  $this->highlight_letter = $a_high_letter;
200  }

◆ setLetters()

ilAlphabetInputGUI::setLetters (   $a_val)

Set letters available.

Parameters
arrayletters

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

90  {
91  $this->letters = $a_val;
92  }

◆ setParentCommand()

ilAlphabetInputGUI::setParentCommand (   $a_obj,
  $a_cmd 
)

Insert property html.

Returns
int Size Set parent cmd
Parameters
objectparent object
stringparent command

Definition at line 184 of file class.ilAlphabetInputGUI.php.

185  {
186  $this->parent_object = $a_obj;
187  $this->parent_cmd = $a_cmd;
188  }

◆ setValue()

ilAlphabetInputGUI::setValue (   $a_value)

Set Value.

Parameters
string$a_valueValue

Definition at line 58 of file class.ilAlphabetInputGUI.php.

Referenced by setValueByArray().

59  {
60  $this->value = $a_value;
61  }
+ Here is the caller graph for this function:

◆ setValueByArray()

ilAlphabetInputGUI::setValueByArray (   $a_values)

Set value by array.

Parameters
array$a_valuesvalue array

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

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

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

Field Documentation

◆ $ctrl

ilAlphabetInputGUI::$ctrl
protected

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

Referenced by getToolbarHTML().

◆ $fix_db_umlauts

ilAlphabetInputGUI::$fix_db_umlauts = false
protected

Definition at line 36 of file class.ilAlphabetInputGUI.php.

Referenced by getFixDBUmlauts().

◆ $highlight

ilAlphabetInputGUI::$highlight
protected

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

◆ $highlight_letter

ilAlphabetInputGUI::$highlight_letter
protected

Definition at line 31 of file class.ilAlphabetInputGUI.php.

◆ $letters

ilAlphabetInputGUI::$letters
protected

Definition at line 27 of file class.ilAlphabetInputGUI.php.

Referenced by getLetters().

◆ $lng

ilAlphabetInputGUI::$lng
protected

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

Referenced by checkInput(), and getToolbarHTML().

◆ $parent_cmd

ilAlphabetInputGUI::$parent_cmd
protected

Definition at line 29 of file class.ilAlphabetInputGUI.php.

◆ $parent_object

ilAlphabetInputGUI::$parent_object
protected

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


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