ILIAS  trunk Revision v11.0_alpha-2662-g519ff7d528f
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 (string $a_title="", string $a_postvar="")
 
 setValue (string $a_value)
 
 getValue ()
 
 setValueByArray (array $a_values)
 
 setLetters (array $a_val)
 
 getLetters ()
 
 checkInput ()
 
 getInput ()
 
 setFixDBUmlauts (bool $a_val)
 
 getFixDBUmlauts ()
 
 fixDBUmlauts (string $l)
 
 setParentCommand (object $a_obj, string $a_cmd)
 
 setHighlighted (string $a_high_letter)
 
 getToolbarHTML ()
 Get input item HTML to be inserted into ilToolbarGUI. More...
 
- Public Member Functions inherited from ilFormPropertyGUI
 __construct (string $a_title="", string $a_postvar="")
 
 executeCommand ()
 
 getType ()
 
 setTitle (string $a_title)
 
 getTitle ()
 
 setPostVar (string $a_postvar)
 
 getPostVar ()
 
 getFieldId ()
 
 setInfo (string $a_info)
 
 getInfo ()
 
 setAlert (string $a_alert)
 
 getAlert ()
 
 setRequired (bool $a_required)
 
 getRequired ()
 
 setDisabled (bool $a_disabled)
 
 getDisabled ()
 
 checkInput ()
 Check input, strip slashes etc. More...
 
 setParentForm (ilPropertyFormGUI $a_parentform)
 
 getParentForm ()
 
 setParent (ilFormPropertyGUI $a_val)
 
 getParent ()
 
 getSubForm ()
 
 hideSubForm ()
 
 setHiddenTitle (string $a_val)
 
 getHiddenTitle ()
 
 getItemByPostVar (string $a_post_var)
 Get item by post var. More...
 
 serializeData ()
 
 unserializeData (string $a_data)
 
 setParentTable ($a_val)
 Set parent table. More...
 
 getParentTable ()
 Get parent table. More...
 
 writeToSession ()
 
 clearFromSession ()
 
 readFromSession ()
 
 getHiddenTag (string $a_post_var, string $a_value)
 
 setMulti (bool $a_multi, bool $a_sortable=false, bool $a_addremove=true)
 
 getMulti ()
 
 setMultiValues (array $a_values)
 
 getMultiValues ()
 
 getContentOutsideFormTag ()
 Get content that has to reside outside of the parent form tag, e.g. More...
 
 stripSlashesAddSpaceFallback (string $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...
 
 setRequestParam (string $key, $val)
 This writes the request (aka post) values. More...
 

Protected Member Functions

 render (string $a_mode="")
 
- Protected Member Functions inherited from ilFormPropertyGUI
 symbol ()
 
 setType (string $a_type)
 
 checkParentFormTable ()
 
 getSessionKey ()
 
 getMultiIconsHTML ()
 
 int ($key)
 
 intArray ($key)
 
 str ($key)
 
 raw ($key)
 
 strArray ($key)
 
 arrayArray ($key)
 
 isRequestParamArray (string $key)
 
 getRequestParam (string $key, Refinery\Transformation $t)
 

Protected Attributes

array $letters = []
 
object $parent_object
 
string $parent_cmd = ""
 
bool $highlight = false
 
string $highlight_letter = ""
 
bool $fix_db_umlauts = false
 
bool $db_supports_distinct_umlauts = null
 
ilDBInterface $db
 
- Protected Attributes inherited from ilFormPropertyGUI
array $set_params = []
 
ilTable2GUI $parent_table = null
 
ilFormPropertyGUI $parent_gui = null
 
ilCtrl $ctrl
 
ilLanguage $lng
 
string $type = ""
 
string $title = ""
 
string $postvar = ""
 
string $info = ""
 
string $alert = ""
 
bool $required = false
 
ilPropertyFormGUI $parentform = null
 
string $hidden_title = ""
 
bool $multi = false
 
bool $multi_sortable = false
 
bool $multi_addremove = true
 
array $multi_values = []
 
RequestInterface $request
 
HTTP Services $http
 
Refinery Factory $refinery = null
 
bool $disabled = false
 
ilGlobalTemplateInterface $global_tpl = null
 

Private Member Functions

 dbSupportsDisctinctUmlauts ()
 Only temp fix for #8603, should go to db classes. More...
 

Private Attributes

string $value = ""
 

Additional Inherited Members

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

Detailed Description

This class represents a text property in a property form.

Author
Alexander Killing killi.nosp@m.ng@l.nosp@m.eifos.nosp@m..de
Deprecated:
12 This component will be removed with ILIAS 12

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

Constructor & Destructor Documentation

◆ __construct()

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

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

References $DIC, ILIAS\GlobalScreen\Provider\__construct(), ILIAS\Repository\ctrl(), and ILIAS\Repository\lng().

42  {
43  global $DIC;
44 
45  $this->lng = $DIC->language();
46  $this->ctrl = $DIC->ctrl();
47  $this->db = $DIC->database();
48  parent::__construct($a_title, $a_postvar);
49  }
global $DIC
Definition: shib_login.php:26
__construct(Container $dic, ilPlugin $plugin)
+ Here is the call graph for this function:

Member Function Documentation

◆ checkInput()

ilAlphabetInputGUI::checkInput ( )

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

References ilFormPropertyGUI\$lng, ilFormPropertyGUI\getPostVar(), ilFormPropertyGUI\getRequired(), ilFormPropertyGUI\setAlert(), ilFormPropertyGUI\str(), and ilLanguage\txt().

93  : bool
94  {
95  $lng = $this->lng;
96 
97  if ($this->getRequired() && trim($this->str($this->getPostVar())) == "") {
98  $this->setAlert($lng->txt("msg_input_is_required"));
99  return false;
100  }
101 
102  return true;
103  }
txt(string $a_topic, string $a_default_lang_fallback_mod="")
gets the text for a given topic if the topic is not in the list, the topic itself with "-" will be re...
+ Here is the call graph for this function:

◆ dbSupportsDisctinctUmlauts()

ilAlphabetInputGUI::dbSupportsDisctinctUmlauts ( )
private

Only temp fix for #8603, should go to db classes.

Deprecated:

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

References $db_supports_distinct_umlauts.

Referenced by fixDBUmlauts().

55  : ?bool
56  {
57  if (!isset($this->db_supports_distinct_umlauts)) {
58  $set = $this->db->query(
59  "SELECT (" . $this->db->quote("A", "text") . " = " . $this->db->quote("Ä", "text") . ") t FROM DUAL "
60  );
61  $rec = $this->db->fetchAssoc($set);
62  $this->db_supports_distinct_umlauts = !(bool) $rec["t"];
63  }
64 
66  }
+ Here is the caller graph for this function:

◆ fixDBUmlauts()

ilAlphabetInputGUI::fixDBUmlauts ( string  $l)

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

References dbSupportsDisctinctUmlauts().

Referenced by getToolbarHTML().

120  : string
121  {
122  if ($this->fix_db_umlauts && !$this->dbSupportsDisctinctUmlauts()) {
123  $l = str_replace(array("Ä", "Ö", "Ü", "ä", "ö", "ü"), array("A", "O", "U", "a", "o", "u"), $l);
124  }
125  return $l;
126  }
dbSupportsDisctinctUmlauts()
Only temp fix for #8603, should go to db classes.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getFixDBUmlauts()

ilAlphabetInputGUI::getFixDBUmlauts ( )

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

References $fix_db_umlauts.

115  : bool
116  {
117  return $this->fix_db_umlauts;
118  }

◆ getInput()

ilAlphabetInputGUI::getInput ( )

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

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

105  : string
106  {
107  return $this->str($this->getPostVar());
108  }
+ Here is the call graph for this function:

◆ getLetters()

ilAlphabetInputGUI::getLetters ( )

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

References $letters.

Referenced by getToolbarHTML().

88  : array
89  {
90  return $this->letters;
91  }
+ Here is the caller graph for this function:

◆ getToolbarHTML()

ilAlphabetInputGUI::getToolbarHTML ( )

Get input item HTML to be inserted into ilToolbarGUI.

Implements ilToolbarItem.

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

References ilFormPropertyGUI\$ctrl, ilFormPropertyGUI\$lng, fixDBUmlauts(), getLetters(), ilLanguage\loadLanguageModule(), null, and ilLanguage\txt().

149  : string
150  {
151  $ilCtrl = $this->ctrl;
152  $lng = $this->lng;
153 
154  $lng->loadLanguageModule("form");
155 
156  $tpl = new ilTemplate("tpl.prop_alphabet.html", true, true, "components/ILIAS/Form");
157  foreach ($this->getLetters() as $l) {
158  if (is_null($l)) {
159  continue;
160  }
161  $l = $this->fixDBUmlauts($l);
162  $tpl->setCurrentBlock("letter");
163  $tpl->setVariable("TXT_LET", $l);
164  $ilCtrl->setParameter($this->parent_object, "letter", rawurlencode($l));
165  $tpl->setVariable("TXT_LET", $l);
166  $tpl->setVariable("HREF_LET", $ilCtrl->getLinkTarget($this->parent_object, $this->parent_cmd));
167  if ($this->highlight && $this->highlight_letter !== null && $this->highlight_letter == $l) {
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  $tpl->setVariable("CLASSA", ' class="ilHighlighted" ');
177  }
178  return $tpl->get();
179  }
txt(string $a_topic, string $a_default_lang_fallback_mod="")
gets the text for a given topic if the topic is not in the list, the topic itself with "-" will be re...
loadLanguageModule(string $a_module)
Load language module.
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
+ Here is the call graph for this function:

◆ getValue()

ilAlphabetInputGUI::getValue ( )

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

References $value.

73  : string
74  {
75  return $this->value;
76  }

◆ render()

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

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

129  : string
130  {
131  return "";
132  }

◆ setFixDBUmlauts()

ilAlphabetInputGUI::setFixDBUmlauts ( bool  $a_val)

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

110  : void
111  {
112  $this->fix_db_umlauts = $a_val;
113  }

◆ setHighlighted()

ilAlphabetInputGUI::setHighlighted ( string  $a_high_letter)

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

144  : void {
145  $this->highlight = ($a_high_letter != "");
146  $this->highlight_letter = $a_high_letter;
147  }

◆ setLetters()

ilAlphabetInputGUI::setLetters ( array  $a_val)

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

83  : void
84  {
85  $this->letters = $a_val;
86  }

◆ setParentCommand()

ilAlphabetInputGUI::setParentCommand ( object  $a_obj,
string  $a_cmd 
)

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

137  : void {
138  $this->parent_object = $a_obj;
139  $this->parent_cmd = $a_cmd;
140  }

◆ setValue()

ilAlphabetInputGUI::setValue ( string  $a_value)

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

Referenced by setValueByArray().

68  : void
69  {
70  $this->value = $a_value;
71  }
+ Here is the caller graph for this function:

◆ setValueByArray()

ilAlphabetInputGUI::setValueByArray ( array  $a_values)

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

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

78  : void
79  {
80  $this->setValue($a_values[$this->getPostVar()]);
81  }
+ Here is the call graph for this function:

Field Documentation

◆ $db

ilDBInterface ilAlphabetInputGUI::$db
protected

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

◆ $db_supports_distinct_umlauts

bool ilAlphabetInputGUI::$db_supports_distinct_umlauts = null
protected

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

Referenced by dbSupportsDisctinctUmlauts().

◆ $fix_db_umlauts

bool ilAlphabetInputGUI::$fix_db_umlauts = false
protected

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

Referenced by getFixDBUmlauts().

◆ $highlight

bool ilAlphabetInputGUI::$highlight = false
protected

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

◆ $highlight_letter

string ilAlphabetInputGUI::$highlight_letter = ""
protected

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

◆ $letters

array ilAlphabetInputGUI::$letters = []
protected

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

Referenced by getLetters().

◆ $parent_cmd

string ilAlphabetInputGUI::$parent_cmd = ""
protected

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

◆ $parent_object

object ilAlphabetInputGUI::$parent_object
protected

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

◆ $value

string ilAlphabetInputGUI::$value = ""
private

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

Referenced by getValue().


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