ILIAS  release_8 Revision v8.24
ilAlphabetInputGUI Class Reference

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V. 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 ()
 Check input, strip slashes etc. More...
 
 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...
 
 getToolbarHTML ()
 Get input item HTML to be inserted into ilToolbarGUI. More...
 

Protected Member Functions

 render (string $a_mode="")
 
- Protected Member Functions inherited from ilFormPropertyGUI
 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 file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V.

ILIAS is licensed with the GPL-3.0, see https://www.gnu.org/licenses/gpl-3.0.en.html You should have received a copy of said license along with the source code, too.

If this is not the case or you just want to try ILIAS, you'll find us at: https://www.ilias.de https://github.com/ILIAS-eLearning This class represents a text property in a property form.

Author
Alexander Killing killi.nosp@m.ng@l.nosp@m.eifos.nosp@m..de

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

Constructor & Destructor Documentation

◆ __construct()

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

Reimplemented from ilFormPropertyGUI.

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

41 {
42 global $DIC;
43
44 $this->lng = $DIC->language();
45 $this->ctrl = $DIC->ctrl();
46 $this->db = $DIC->database();
47 parent::__construct($a_title, $a_postvar);
48 }
global $DIC
Definition: feed.php:28
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc

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

+ Here is the call graph for this function:

Member Function Documentation

◆ checkInput()

ilAlphabetInputGUI::checkInput ( )

Check input, strip slashes etc.

set alert, if input is not ok.

Reimplemented from ilFormPropertyGUI.

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

92 : bool
93 {
95
96 if ($this->getRequired() && trim($this->str($this->getPostVar())) == "") {
97 $this->setAlert($lng->txt("msg_input_is_required"));
98 return false;
99 }
100
101 return true;
102 }
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...

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

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

54 : ?bool
55 {
56 if (!isset($this->db_supports_distinct_umlauts)) {
57 $set = $this->db->query(
58 "SELECT (" . $this->db->quote("A", "text") . " = " . $this->db->quote("Ä", "text") . ") t FROM DUAL "
59 );
60 $rec = $this->db->fetchAssoc($set);
61 $this->db_supports_distinct_umlauts = !(bool) $rec["t"];
62 }
63
65 }

References $db_supports_distinct_umlauts.

Referenced by fixDBUmlauts().

+ Here is the caller graph for this function:

◆ fixDBUmlauts()

ilAlphabetInputGUI::fixDBUmlauts ( string  $l)

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

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

References dbSupportsDisctinctUmlauts().

+ Here is the call graph for this function:

◆ getFixDBUmlauts()

ilAlphabetInputGUI::getFixDBUmlauts ( )

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

114 : bool
115 {
117 }

References $fix_db_umlauts.

◆ getInput()

ilAlphabetInputGUI::getInput ( )

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

104 : string
105 {
106 return $this->str($this->getPostVar());
107 }

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

+ Here is the call graph for this function:

◆ getLetters()

ilAlphabetInputGUI::getLetters ( )

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

87 : array
88 {
89 return $this->letters;
90 }

References $letters.

◆ getToolbarHTML()

ilAlphabetInputGUI::getToolbarHTML ( )

Get input item HTML to be inserted into ilToolbarGUI.

Implements ilToolbarItem.

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

148 : string
149 {
150 $ilCtrl = $this->ctrl;
152
153 $lng->loadLanguageModule("form");
154
155 $tpl = new ilTemplate("tpl.prop_alphabet.html", true, true, "Services/Form");
156 foreach ($this->getLetters() as $l) {
157 if (is_null($l)) {
158 continue;
159 }
160 $l = $this->fixDBUmlauts($l);
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 $tpl->setVariable("CLASS", ' class="ilHighlighted" ');
168 }
169 $tpl->parseCurrentBlock();
170 }
171 $ilCtrl->setParameter($this->parent_object, "letter", "");
172 $tpl->setVariable("TXT_ALL", $lng->txt("form_alphabet_all"));
173 $tpl->setVariable("HREF_ALL", $ilCtrl->getLinkTarget($this->parent_object, $this->parent_cmd));
174 if ($this->highlight && $this->highlight_letter === null) {
175 $tpl->setVariable("CLASSA", ' class="ilHighlighted" ');
176 }
177 return $tpl->get();
178 }
loadLanguageModule(string $a_module)
Load language module.
special template class to simplify handling of ITX/PEAR
if($DIC->http() ->request() ->getMethod()=="GET" &&isset($DIC->http() ->request() ->getQueryParams()['tex'])) $tpl
Definition: latex.php:41

References $lng, and $tpl.

◆ getValue()

ilAlphabetInputGUI::getValue ( )

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

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

References $value.

◆ render()

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

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

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

◆ setFixDBUmlauts()

ilAlphabetInputGUI::setFixDBUmlauts ( bool  $a_val)

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

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

◆ setHighlighted()

ilAlphabetInputGUI::setHighlighted ( string  $a_high_letter)

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

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

◆ setLetters()

ilAlphabetInputGUI::setLetters ( array  $a_val)

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

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

◆ setParentCommand()

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

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

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

◆ setValue()

ilAlphabetInputGUI::setValue ( string  $a_value)

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

67 : void
68 {
69 $this->value = $a_value;
70 }

Referenced by setValueByArray().

+ Here is the caller graph for this function:

◆ setValueByArray()

ilAlphabetInputGUI::setValueByArray ( array  $a_values)

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

77 : void
78 {
79 $this->setValue($a_values[$this->getPostVar()]);
80 }

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

+ Here is the call graph for this function:

Field Documentation

◆ $db

ilDBInterface ilAlphabetInputGUI::$db
protected

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

◆ $db_supports_distinct_umlauts

bool ilAlphabetInputGUI::$db_supports_distinct_umlauts = null
protected

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

Referenced by dbSupportsDisctinctUmlauts().

◆ $fix_db_umlauts

bool ilAlphabetInputGUI::$fix_db_umlauts = false
protected

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

Referenced by getFixDBUmlauts().

◆ $highlight

bool ilAlphabetInputGUI::$highlight = false
protected

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

◆ $highlight_letter

string ilAlphabetInputGUI::$highlight_letter = ""
protected

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

◆ $letters

array ilAlphabetInputGUI::$letters = []
protected

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

Referenced by getLetters().

◆ $parent_cmd

string ilAlphabetInputGUI::$parent_cmd = ""
protected

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

◆ $parent_object

object ilAlphabetInputGUI::$parent_object
protected

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

◆ $value

string ilAlphabetInputGUI::$value = ""
private

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

Referenced by getValue().


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