ILIAS  release_5-0 Revision 5.0.0-1144-gc4397b1f87
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...
 
 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...
 
 removeProhibitedCharacters ($a_text)
 Remove prohibited characters see #19159. 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

 $letters
 
 $parent_object
 
 $parent_cmd
 
 $highlight
 
 $highlight_letter
 
- 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
 

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 29 of file class.ilAlphabetInputGUI.php.

30  {
31  parent::__construct($a_title, $a_postvar);
32  }

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 90 of file class.ilAlphabetInputGUI.php.

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

91  {
92  global $lng;
93 
95  if ($this->getRequired() && trim($_POST[$this->getPostVar()]) == "")
96  {
97  $this->setAlert($lng->txt("msg_input_is_required"));
98 
99  return false;
100  }
101 
102  return true;
103  }
$_POST['username']
Definition: cron.php:12
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
global $lng
Definition: privfeed.php:40
+ Here is the call graph for this function:

◆ getLetters()

ilAlphabetInputGUI::getLetters ( )

Get letters available.

Returns
array letters

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

References $letters.

Referenced by getToolbarHTML().

81  {
82  return $this->letters;
83  }
+ Here is the caller graph for this function:

◆ getToolbarHTML()

ilAlphabetInputGUI::getToolbarHTML ( )

Get HTML for toolbar.

Implements ilToolbarItem.

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

References $ilCtrl, $lng, $tpl, and getLetters().

153  {
154  global $ilCtrl, $lng;
155 
156  $lng->loadLanguageModule("form");
157 
158  $tpl = new ilTemplate("tpl.prop_alphabet.html", true, true, "Services/Form");
159  foreach ((array)$this->getLetters() as $l)
160  {
161  $tpl->setCurrentBlock("letter");
162  $tpl->setVariable("TXT_LET", $l);
163  $ilCtrl->setParameter($this->parent_object, "letter", rawurlencode($l));
164  $tpl->setVariable("TXT_LET", $l);
165  $tpl->setVariable("HREF_LET", $ilCtrl->getLinkTarget($this->parent_object, $this->parent_cmd));
166  if ($this->highlight && $this->highlight_letter !== null && $this->highlight_letter == $l)
167  {
168  $tpl->setVariable("CLASS", ' class="ilHighlighted" ');
169  }
170  $tpl->parseCurrentBlock();
171  }
172  $ilCtrl->setParameter($this->parent_object, "letter", "");
173  $tpl->setVariable("TXT_ALL", $lng->txt("form_alphabet_all"));
174  $tpl->setVariable("HREF_ALL", $ilCtrl->getLinkTarget($this->parent_object, $this->parent_cmd));
175  if ($this->highlight && $this->highlight_letter === null)
176  {
177  $tpl->setVariable("CLASSA", ' class="ilHighlighted" ');
178  }
179  return $tpl->get();
180  }
global $tpl
Definition: ilias.php:8
global $ilCtrl
Definition: ilias.php:18
special template class to simplify handling of ITX/PEAR
global $lng
Definition: privfeed.php:40
getLetters()
Get letters available.
+ Here is the call graph for this function:

◆ getValue()

ilAlphabetInputGUI::getValue ( )

Get Value.

Returns
string Value

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

50  {
51  return $this->value;
52  }

◆ render()

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

Render item.

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

109  {
110  die("only implemented for toolbar usage");
111  }

◆ setHighlighted()

ilAlphabetInputGUI::setHighlighted (   $a_high_letter)

Set highlighted.

Parameters

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

144  {
145  $this->highlight = true;
146  $this->highlight_letter = $a_high_letter;
147  }

◆ setLetters()

ilAlphabetInputGUI::setLetters (   $a_val)

Set letters available.

Parameters
arrayletters

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

Referenced by ilGlossaryPresentationGUI\listTerms().

71  {
72  $this->letters = $a_val;
73  }
+ Here is the caller graph for this function:

◆ setParentCommand()

ilAlphabetInputGUI::setParentCommand (   $a_obj,
  $a_cmd 
)

Insert property html.

Returns
int Size Set parent cmd
Parameters
objectparent object
stringparent command

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

132  {
133  $this->parent_object = $a_obj;
134  $this->parent_cmd = $a_cmd;
135  }

◆ setValue()

ilAlphabetInputGUI::setValue (   $a_value)

Set Value.

Parameters
string$a_valueValue

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

Referenced by setValueByArray().

40  {
41  $this->value = $a_value;
42  }
+ 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 60 of file class.ilAlphabetInputGUI.php.

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

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

Field Documentation

◆ $highlight

ilAlphabetInputGUI::$highlight
protected

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

◆ $highlight_letter

ilAlphabetInputGUI::$highlight_letter
protected

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

◆ $letters

ilAlphabetInputGUI::$letters
protected

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

Referenced by getLetters().

◆ $parent_cmd

ilAlphabetInputGUI::$parent_cmd
protected

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

◆ $parent_object

ilAlphabetInputGUI::$parent_object
protected

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


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