ILIAS  release_8 Revision v8.19
All Data Structures Namespaces Files Functions Variables Modules Pages
ilNestedListInputGUI 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 ilNestedListInputGUI:
+ Collaboration diagram for ilNestedListInputGUI:

Public Member Functions

 __construct (string $a_title="", string $a_postvar="")
 
 addListNode (string $a_id, string $a_text, string $a_parent="0", bool $a_checked=false, bool $a_disabled=false, string $a_img_src="", string $a_img_alt="", string $a_post_var="")
 
 setValue (string $a_value)
 
 getValue ()
 
 setValueByArray (array $a_values)
 
 checkInput ()
 
 getInput ()
 
 render ()
 
 insert (ilTemplate $a_tpl)
 
- 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 Attributes

string $value = "1"
 
array $checked = []
 
array $list_nodes = []
 
ilNestedList $list
 
- 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
 

Additional Inherited Members

- Static Public Member Functions inherited from ilFormPropertyGUI
static removeProhibitedCharacters (string $a_text)
 Remove prohibited characters see #19159. More...
 
- 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)
 

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 (nested) list of checkboxes (could be extended for radio items, too)

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

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

Constructor & Destructor Documentation

◆ __construct()

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

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

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

36  {
37  global $DIC;
38 
39  $this->lng = $DIC->language();
40  parent::__construct($a_title, $a_postvar);
41  $this->setType("nested_list");
42 
43  $this->list = new ilNestedList();
44  $this->list->setListClass("il_Explorer");
45  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
global $DIC
Definition: feed.php:28
__construct(Container $dic, ilPlugin $plugin)
+ Here is the call graph for this function:

Member Function Documentation

◆ addListNode()

ilNestedListInputGUI::addListNode ( string  $a_id,
string  $a_text,
string  $a_parent = "0",
bool  $a_checked = false,
bool  $a_disabled = false,
string  $a_img_src = "",
string  $a_img_alt = "",
string  $a_post_var = "" 
)

Definition at line 47 of file class.ilNestedListInputGUI.php.

56  {
57  $this->list_nodes[$a_id] = array("text" => $a_text,
58  "parent" => $a_parent, "checked" => $a_checked, "disabled" => $a_disabled,
59  "img_src" => $a_img_src, "img_alt" => $a_img_alt, "post_var" => $a_post_var);
60  }

◆ checkInput()

ilNestedListInputGUI::checkInput ( )

Definition at line 81 of file class.ilNestedListInputGUI.php.

81  : bool
82  {
83  return true;
84  }

◆ getInput()

ilNestedListInputGUI::getInput ( )

Definition at line 86 of file class.ilNestedListInputGUI.php.

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

86  : array
87  {
88  return $this->strArray($this->getPostVar());
89  }
+ Here is the call graph for this function:

◆ getValue()

ilNestedListInputGUI::getValue ( )

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

References $value.

67  : string
68  {
69  return $this->value;
70  }

◆ insert()

ilNestedListInputGUI::insert ( ilTemplate  $a_tpl)

Definition at line 125 of file class.ilNestedListInputGUI.php.

References ilTemplate\parseCurrentBlock(), render(), ilTemplate\setCurrentBlock(), and HTML_Template_IT\setVariable().

125  : void
126  {
127  $html = $this->render();
128 
129  $a_tpl->setCurrentBlock("prop_generic");
130  $a_tpl->setVariable("PROP_GENERIC", $html);
131  $a_tpl->parseCurrentBlock();
132  }
parseCurrentBlock(string $part=ilGlobalTemplateInterface::DEFAULT_BLOCK)
setVariable($variable, $value='')
Sets a variable value.
Definition: IT.php:514
setCurrentBlock(string $part=ilGlobalTemplateInterface::DEFAULT_BLOCK)
+ Here is the call graph for this function:

◆ render()

ilNestedListInputGUI::render ( )

Definition at line 91 of file class.ilNestedListInputGUI.php.

References $id, ilLegacyFormElementsUtil\formCheckbox(), ilFormPropertyGUI\getPostVar(), and ilUtil\img().

Referenced by insert().

91  : string
92  {
93  foreach ($this->list_nodes as $id => $n) {
94  if ($n["post_var"] == "") {
95  $post_var = $this->getPostVar() . "[]";
96  } else {
97  $post_var = $n["post_var"];
98  }
99  $value = $id;
101  $n["checked"],
102  $post_var,
103  (string) $value,
104  $n["disabled"]
105  );
106  if ($n["img_src"] != "") {
107  $item_html .= ilUtil::img(
108  $n["img_src"],
109  $n["img_alt"],
110  "",
111  "",
112  0,
113  "",
114  "ilIcon"
115  ) . " ";
116  }
117  $item_html .= $n["text"];
118 
119  $this->list->addListNode($item_html, (string) $id, $n["parent"]);
120  }
121 
122  return $this->list->getHTML();
123  }
static img(string $a_src, ?string $a_alt=null, $a_width="", $a_height="", $a_border=0, $a_id="", $a_class="")
Build img tag.
static formCheckbox(bool $checked, string $varname, string $value, bool $disabled=false)
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
Definition: plugin.php:23
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setValue()

ilNestedListInputGUI::setValue ( string  $a_value)

Definition at line 62 of file class.ilNestedListInputGUI.php.

62  : void
63  {
64  $this->value = $a_value;
65  }

◆ setValueByArray()

ilNestedListInputGUI::setValueByArray ( array  $a_values)

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

72  : void
73  {
74  // $this->setChecked($a_values[$this->getPostVar()]);
75 // foreach($this->getSubItems() as $item)
76 // {
77 // $item->setValueByArray($a_values);
78 // }
79  }

Field Documentation

◆ $checked

array ilNestedListInputGUI::$checked = []
protected

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

◆ $list

ilNestedList ilNestedListInputGUI::$list
protected

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

◆ $list_nodes

array ilNestedListInputGUI::$list_nodes = []
protected

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

◆ $value

string ilNestedListInputGUI::$value = "1"
protected

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

Referenced by getValue().


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