ILIAS  release_8 Revision v8.24
ilMultipleNestedOrderingElementsInputGUI 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 ilMultipleNestedOrderingElementsInputGUI:
+ Collaboration diagram for ilMultipleNestedOrderingElementsInputGUI:

Public Member Functions

 __construct ($a_title='', $a_postvar='')
 
 setInstanceId ($instanceId)
 
 getInstanceId ()
 
 setInteractionEnabled ($interactionEnabled)
 
 isInteractionEnabled ()
 
 isNestingEnabled ()
 
 setNestingEnabled ($nestingEnabled)
 
 isStylingDisabled ()
 
 setStylingDisabled ($stylingDisabled)
 
 getCssListClass ()
 
 setCssListClass ($cssListClass)
 
 getCssItemClass ()
 
 getCssHandleClass ()
 
 setCssHandleClass ($cssHandleClass)
 
 setCssItemClass ($cssItemClass)
 
 getHtmlListTag ()
 
 setHtmlListTag ($htmlListTag)
 
 getListTpl ()
 
 setListTpl ($listTpl)
 
 render (string $a_mode="")
 
 onCheckInput ()
 
 getHTML ()
 
- Public Member Functions inherited from ilIdentifiedMultiValuesInputGUI
 __construct ($a_title="", $a_postvar="")
 
 getElementAddCmd ()
 
 setElementAddCmd ($elementAddCmd)
 
 getElementRemoveCmd ()
 
 setElementRemoveCmd ($elementRemoveCmd)
 
 getElementMoveUpCommand ()
 
 setElementMoveUpCommand ($elementMoveUpCommand)
 
 getElementMoveDownCommand ()
 
 setElementMoveDownCommand ($elementMoveDownCommand)
 
 setValues ($values)
 
 getValues ()
 
 setValue ($value)
 
 getValue ()
 
 setMultiValues (array $values)
 
 getMultiValues ()
 
 setIdentifiedMultiValues ($values)
 
 getIdentifiedMultiValues ()
 
 setValueByArray (array $a_values)
 
 getInput ()
 
 checkInput ()
 Check input, strip slashes etc. More...
 
 onCheckInput ()
 
 prepareReprintable (assQuestion $question)
 
- Public Member Functions inherited from ilTextInputGUI
 __construct (string $a_title="", string $a_postvar="")
 
 setValue ($a_value)
 
 getValue ()
 
 setValidationFailureMessage (string $a_msg)
 
 getValidationFailureMessage ()
 
 setValidationRegexp (string $a_value)
 
 getValidationRegexp ()
 
 setMaxLength (?int $a_maxlength)
 
 getMaxLength ()
 
 setSize (int $a_size)
 
 setInlineStyle (string $a_style)
 
 getInlineStyle ()
 
 setCssClass (string $a_class)
 
 getCssClass ()
 
 setValueByArray (array $a_values)
 
 getSize ()
 
 setSuffix (string $a_value)
 
 getSuffix ()
 
 setInputType (string $a_type)
 set input type More...
 
 getInputType ()
 
 setSubmitFormOnEnter (bool $a_val)
 
 getSubmitFormOnEnter ()
 
 checkInput ()
 Check input, strip slashes etc. More...
 
 getInput ()
 
 getDataSource ()
 
 setDataSource (string $href, string $a_delimiter=null)
 
 setDataSourceSubmitOnSelection (bool $a_stat)
 
 getDataSourceSubmitOnSelection ()
 
 setDataSourceSubmitUrl (string $a_url)
 
 getDataSourceSubmitUrl ()
 
 setMultiValues (array $a_values)
 
 render (string $a_mode="")
 
 insert (ilTemplate $a_tpl)
 
 getTableFilterHTML ()
 Get input item HTML to be inserted into table filters. More...
 
 getToolbarHTML ()
 Get input item HTML to be inserted into ilToolbarGUI. More...
 
 setDisableHtmlAutoComplete (bool $autocomplete)
 
 isHtmlAutoCompleteDisabled ()
 
 getPostValueForComparison ()
 
- Public Member Functions inherited from ilSubEnabledFormPropertyGUI
 addSubItem (ilFormPropertyGUI $a_item)
 
 getSubItems ()
 
 getSubInputItemsRecursive ()
 returns a flat array of possibly existing subitems recursively More...
 
 checkSubItemsInput ()
 Check SubItems. More...
 
 getSubForm ()
 
 getItemByPostVar (string $a_post_var)
 Get item by post var. 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...
 
- Public Member Functions inherited from ilTableFilterItem
 getTableFilterHTML ()
 Get input item HTML to be inserted into table filters. More...
 
 getTableFilterLabelFor ()
 Get label "for" attribute value. More...
 
 getToolbarHTML ()
 Get input item HTML to be inserted into ilToolbarGUI. More...
 

Data Fields

const HTML_LIST_TAG_UL = 'ul'
 
const HTML_LIST_TAG_OL = 'ol'
 
const CSS_LIST_CLASS = 'dd-list'
 
const CSS_ITEM_CLASS = 'dd-item'
 
const CSS_HANDLE_CLASS = 'il-dd-handle'
 
const POSTVAR_SUBFIELD_NEST_ELEM = 'content'
 
const POSTVAR_SUBFIELD_NEST_INDENT = 'indentation'
 
const DEFAULT_INSTANCE_ID = 'default'
 
- Data Fields inherited from ilIdentifiedMultiValuesInputGUI
const ELEMENT_DEFAULT_ADD_CMD = 'addElement'
 
const ELEMENT_DEFAULT_REMOVE_CMD = 'removeElement'
 
const ELEMENT_DEFAULT_MOVE_UP_CMD = 'moveUpElement'
 
const ELEMENT_DEFAULT_MOVE_DOWN_CMD = 'moveDownElement'
 

Protected Member Functions

 isStylingEnabled ()
 
 getGlobalTpl ()
 
 initListTemplate ()
 
 fetchListHtml ()
 
 renderListContainer ()
 
 renderListSnippet ()
 
 renderListItem ($value, $identifier, $position)
 
 getItemHtml ($value, $identifier, $position, $itemSubFieldPostVar, $itemSubFieldId)
 
 renderBeginListItem ($identifier)
 
 renderEndListItem ()
 
 renderBeginSubList ()
 
 renderEndSubList ()
 
 getCurrentIndentation ($elementValues, $elementCounter)
 
 getNextIndentation ($elementValues, $elementCounter)
 
 renderMainList ()
 
 renderJsInit ()
 
- Protected Member Functions inherited from ilIdentifiedMultiValuesInputGUI
 getMultiValueSubFieldId ($identifier, $subFieldIndex)
 
 getMultiValuePosIndexedFieldId ($identifier, $positionIndex)
 
 getMultiValuePosIndexedSubFieldId ($identifier, $subFieldIndex, $positionIndex)
 
 getFieldIdFromPostVar ($tempPostVar)
 
 getPostVarSubField ($subFieldIndex)
 
 getMultiValuePostVarSubField ($identifier, $subFieldIndex)
 
 getMultiValuePostVarSubFieldPosIndexed ($identifier, $subFieldIndex, $positionIndex)
 
 getMultiValuePostVarPosIndexed ($identifier, $positionIndex)
 
 getMultiValuePostVar ($identifier)
 
 buildMultiValueSubmitVar ($identifier, $positionIndex, $submitCommand)
 
 setIdentifiedMultiValuesByArray ($a_values)
 
 prepareMultiValuesInput ($values)
 
 prepareMultiValuesSubmit ($values)
 
 getFormValuesManipulators ()
 
 addFormValuesManipulator (ilFormValuesManipulator $manipulator)
 
 getSubFieldCompletedPostVar ($subFieldIndex, $elemPostVar)
 
- 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

 $instanceId = self::DEFAULT_INSTANCE_ID
 
 $interactionEnabled = true
 
 $nestingEnabled = true
 
 $stylingDisabled = false
 
 $listTpl = null
 
 $cssListClass = self::CSS_LIST_CLASS
 
 $cssItemClass = self::CSS_ITEM_CLASS
 
 $cssHandleClass = self::CSS_HANDLE_CLASS
 
 $htmlListTag = self::HTML_LIST_TAG_OL
 
- Protected Attributes inherited from ilIdentifiedMultiValuesInputGUI
 $elementAddCmd = self::ELEMENT_DEFAULT_ADD_CMD
 
 $elementRemoveCmd = self::ELEMENT_DEFAULT_REMOVE_CMD
 
 $elementMoveUpCommand = self::ELEMENT_DEFAULT_MOVE_UP_CMD
 
 $elementMoveDownCommand = self::ELEMENT_DEFAULT_MOVE_DOWN_CMD
 
 $identified_multi_values = array()
 
 $formValuesManipulationChain = array()
 
- Protected Attributes inherited from ilTextInputGUI
 $value = null
 
int $maxlength = 200
 
int $size = 40
 
string $validationRegexp = ""
 
string $validationFailureMessage = ''
 
string $suffix = ""
 
string $style_css = ""
 
string $css_class = ""
 
string $ajax_datasource = ""
 
string $ajax_datasource_delimiter = null
 
bool $ajax_datasource_commit = false
 
string $ajax_datasource_commit_url = ""
 
bool $submit_form_on_enter = false
 
bool $autocomplete_disabled = false
 
string $input_type = ""
 
- Protected Attributes inherited from ilSubEnabledFormPropertyGUI
array $sub_items = array()
 
- 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...
 

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

Author
Nadia Ahmad nahma.nosp@m.d@da.nosp@m.tabay.nosp@m..de

Definition at line 23 of file class.ilMultipleNestedOrderingElementsInputGUI.php.

Constructor & Destructor Documentation

◆ __construct()

ilMultipleNestedOrderingElementsInputGUI::__construct (   $a_title = '',
  $a_postvar = '' 
)

Reimplemented from ilIdentifiedMultiValuesInputGUI.

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

56 {
57 parent::__construct($a_title, $a_postvar);
58
60 $this->addFormValuesManipulator($manipulator);
61 }
addFormValuesManipulator(ilFormValuesManipulator $manipulator)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc

References ILIAS\GlobalScreen\Provider\__construct(), and ilIdentifiedMultiValuesInputGUI\addFormValuesManipulator().

+ Here is the call graph for this function:

Member Function Documentation

◆ fetchListHtml()

ilMultipleNestedOrderingElementsInputGUI::fetchListHtml ( )
protected

Definition at line 194 of file class.ilMultipleNestedOrderingElementsInputGUI.php.

194 : string
195 {
196 return $this->getListTpl()->get();
197 }

References getListTpl().

Referenced by renderMainList().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getCssHandleClass()

ilMultipleNestedOrderingElementsInputGUI::getCssHandleClass ( )
Returns
string

Definition at line 135 of file class.ilMultipleNestedOrderingElementsInputGUI.php.

References $cssHandleClass.

Referenced by ilAssNestedOrderingElementsInputGUI\__construct(), renderJsInit(), and renderListItem().

+ Here is the caller graph for this function:

◆ getCssItemClass()

ilMultipleNestedOrderingElementsInputGUI::getCssItemClass ( )
Returns
string

Definition at line 127 of file class.ilMultipleNestedOrderingElementsInputGUI.php.

References $cssItemClass.

Referenced by ilAssNestedOrderingElementsInputGUI\__construct(), renderBeginListItem(), and renderJsInit().

+ Here is the caller graph for this function:

◆ getCssListClass()

ilMultipleNestedOrderingElementsInputGUI::getCssListClass ( )
Returns
string

Definition at line 111 of file class.ilMultipleNestedOrderingElementsInputGUI.php.

References $cssListClass.

Referenced by ilAssNestedOrderingElementsInputGUI\__construct(), renderBeginSubList(), and renderJsInit().

+ Here is the caller graph for this function:

◆ getCurrentIndentation()

ilMultipleNestedOrderingElementsInputGUI::getCurrentIndentation (   $elementValues,
  $elementCounter 
)
abstractprotected
Parameters
array$elementValues
integer$elementCounter
Returns
integer $currentDepth

Reimplemented in ilAssNestedOrderingElementsInputGUI.

Referenced by renderMainList().

+ Here is the caller graph for this function:

◆ getGlobalTpl()

ilMultipleNestedOrderingElementsInputGUI::getGlobalTpl ( )
protected

Definition at line 172 of file class.ilMultipleNestedOrderingElementsInputGUI.php.

173 {
174 return isset($GLOBALS['DIC']) ? $GLOBALS['DIC']['tpl'] : $GLOBALS['tpl'];
175 }
if(!defined('PATH_SEPARATOR')) $GLOBALS['_PEAR_default_error_mode']
Definition: PEAR.php:64

References $GLOBALS.

Referenced by render().

+ Here is the caller graph for this function:

◆ getHTML()

ilMultipleNestedOrderingElementsInputGUI::getHTML ( )

Definition at line 472 of file class.ilMultipleNestedOrderingElementsInputGUI.php.

472 : string
473 {
474 return $this->render();
475 }

References render().

+ Here is the call graph for this function:

◆ getHtmlListTag()

ilMultipleNestedOrderingElementsInputGUI::getHtmlListTag ( )
Returns
string

Definition at line 159 of file class.ilMultipleNestedOrderingElementsInputGUI.php.

References $htmlListTag.

Referenced by renderBeginSubList(), renderEndSubList(), and renderJsInit().

+ Here is the caller graph for this function:

◆ getInstanceId()

ilMultipleNestedOrderingElementsInputGUI::getInstanceId ( )

Reimplemented in ilAssNestedOrderingElementsInputGUI.

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

References $instanceId.

Referenced by renderJsInit(), and renderListContainer().

+ Here is the caller graph for this function:

◆ getItemHtml()

ilMultipleNestedOrderingElementsInputGUI::getItemHtml (   $value,
  $identifier,
  $position,
  $itemSubFieldPostVar,
  $itemSubFieldId 
)
abstractprotected
Parameters
$value
$identifier
$position
$itemSubFieldPostVar
$itemSubFieldId
Returns
mixed

Reimplemented in ilAssNestedOrderingElementsInputGUI.

Referenced by renderListItem().

+ Here is the caller graph for this function:

◆ getListTpl()

ilMultipleNestedOrderingElementsInputGUI::getListTpl ( )

◆ getNextIndentation()

ilMultipleNestedOrderingElementsInputGUI::getNextIndentation (   $elementValues,
  $elementCounter 
)
abstractprotected
Parameters
array$elementValues
integer$elementCounter
Returns
integer $nextDepth

Reimplemented in ilAssNestedOrderingElementsInputGUI.

Referenced by renderMainList().

+ Here is the caller graph for this function:

◆ initListTemplate()

ilMultipleNestedOrderingElementsInputGUI::initListTemplate ( )
protected

Definition at line 187 of file class.ilMultipleNestedOrderingElementsInputGUI.php.

187 : void
188 {
189 $this->setListTpl(
190 new ilTemplate('tpl.prop_nested_ordering_list.html', true, true, 'Modules/TestQuestionPool')
191 );
192 }
special template class to simplify handling of ITX/PEAR

References setListTpl().

Referenced by renderMainList().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ isInteractionEnabled()

ilMultipleNestedOrderingElementsInputGUI::isInteractionEnabled ( )

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

References $interactionEnabled.

Referenced by render().

+ Here is the caller graph for this function:

◆ isNestingEnabled()

ilMultipleNestedOrderingElementsInputGUI::isNestingEnabled ( )

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

References $nestingEnabled.

Referenced by renderJsInit(), and renderMainList().

+ Here is the caller graph for this function:

◆ isStylingDisabled()

ilMultipleNestedOrderingElementsInputGUI::isStylingDisabled ( )

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

References $stylingDisabled.

Referenced by isStylingEnabled().

+ Here is the caller graph for this function:

◆ isStylingEnabled()

ilMultipleNestedOrderingElementsInputGUI::isStylingEnabled ( )
protected

Definition at line 103 of file class.ilMultipleNestedOrderingElementsInputGUI.php.

References isStylingDisabled().

Referenced by render().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ onCheckInput()

ilMultipleNestedOrderingElementsInputGUI::onCheckInput ( )

Reimplemented from ilIdentifiedMultiValuesInputGUI.

Definition at line 467 of file class.ilMultipleNestedOrderingElementsInputGUI.php.

467 : bool
468 {
469 return true;
470 }

◆ render()

ilMultipleNestedOrderingElementsInputGUI::render ( string  $a_mode = "")

Reimplemented from ilTextInputGUI.

Definition at line 448 of file class.ilMultipleNestedOrderingElementsInputGUI.php.

448 : string
449 {
450 if ($this->isStylingEnabled()) {
451 $this->getGlobalTpl()->addCss('Services/Form/css/nested_ordering.css');
452 }
453
454 if ($this->isInteractionEnabled()) {
457
458 $this->getGlobalTpl()->addJavaScript('./node_modules/nestable2/dist/jquery.nestable.min.js');
459 $this->renderJsInit();
460
461 return $this->renderMainList();
462 }
463
464 return $this->renderMainList();
465 }
static initjQueryUI(ilGlobalTemplateInterface $a_tpl=null)
inits and adds the jQuery-UI JS-File to the global template (see included_components....
static initjQuery(ilGlobalTemplateInterface $a_tpl=null)
inits and adds the jQuery JS-File to the global or a passed template

References getGlobalTpl(), iljQueryUtil\initjQuery(), iljQueryUtil\initjQueryUI(), isInteractionEnabled(), isStylingEnabled(), renderJsInit(), and renderMainList().

Referenced by getHTML().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ renderBeginListItem()

ilMultipleNestedOrderingElementsInputGUI::renderBeginListItem (   $identifier)
protected

Definition at line 244 of file class.ilMultipleNestedOrderingElementsInputGUI.php.

244 : void
245 {
246 $this->getListTpl()->setCurrentBlock('begin_list_item');
247 $this->getListTpl()->setVariable('LIST_ITEM_ID', $identifier);
248 $this->getListTpl()->setVariable('ILC_ITEM_CSS_CLASS', $this->getCssItemClass());
249 $this->getListTpl()->parseCurrentBlock();
250 $this->renderListSnippet();
251 }

References getCssItemClass(), getListTpl(), and renderListSnippet().

Referenced by renderMainList().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ renderBeginSubList()

ilMultipleNestedOrderingElementsInputGUI::renderBeginSubList ( )
protected

Definition at line 261 of file class.ilMultipleNestedOrderingElementsInputGUI.php.

261 : void
262 {
263 $this->getListTpl()->setCurrentBlock('begin_sublist');
264 $this->getListTpl()->setVariable('BEGIN_HTML_LIST_TAG', $this->getHtmlListTag());
265 $this->getListTpl()->setVariable('ILC_LIST_CSS_CLASS', $this->getCssListClass());
266 $this->getListTpl()->parseCurrentBlock();
267 $this->renderListSnippet();
268 }

References getCssListClass(), getHtmlListTag(), getListTpl(), and renderListSnippet().

Referenced by renderMainList().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ renderEndListItem()

ilMultipleNestedOrderingElementsInputGUI::renderEndListItem ( )
protected

Definition at line 253 of file class.ilMultipleNestedOrderingElementsInputGUI.php.

253 : void
254 {
255 $this->getListTpl()->setCurrentBlock('end_list_item');
256 $this->getListTpl()->touchBlock('end_list_item');
257 $this->getListTpl()->parseCurrentBlock();
258 $this->renderListSnippet();
259 }

References getListTpl(), and renderListSnippet().

Referenced by renderMainList().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ renderEndSubList()

ilMultipleNestedOrderingElementsInputGUI::renderEndSubList ( )
protected

Definition at line 270 of file class.ilMultipleNestedOrderingElementsInputGUI.php.

270 : void
271 {
272 $this->getListTpl()->setCurrentBlock('end_sublist');
273 $this->getListTpl()->setVariable('END_HTML_LIST_TAG', $this->getHtmlListTag());
274 $this->getListTpl()->parseCurrentBlock();
275 $this->renderListSnippet();
276 }

References getHtmlListTag(), getListTpl(), and renderListSnippet().

Referenced by renderMainList().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ renderJsInit()

ilMultipleNestedOrderingElementsInputGUI::renderJsInit ( )
protected

Definition at line 427 of file class.ilMultipleNestedOrderingElementsInputGUI.php.

427 : void
428 {
429 $config = [];
430
431 if (!$this->isNestingEnabled()) {
432 $config['maxDepth'] = 1;
433 }
434
435 $config['listNodeName'] = $this->getHtmlListTag();
436 $config['listClass'] = $this->getCssListClass();
437 $config['itemClass'] = $this->getCssItemClass();
438 $config['handleClass'] = $this->getCssHandleClass();
439
440 $this->global_tpl->addJavaScript('Modules/TestQuestionPool/templates/default/nested_ordering.js');
441 $this->global_tpl->addOnLoadCode("nested_ordering_input.init('"
442 . $this->getInstanceId() . "', '"
443 . $this->getPostVarSubField('indentation') . "', "
444 . json_encode($config)
445 . ')');
446 }
if(!array_key_exists('PATH_INFO', $_SERVER)) $config
Definition: metadata.php:85

References $config, getCssHandleClass(), getCssItemClass(), getCssListClass(), getHtmlListTag(), getInstanceId(), ilIdentifiedMultiValuesInputGUI\getPostVarSubField(), and isNestingEnabled().

Referenced by render().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ renderListContainer()

ilMultipleNestedOrderingElementsInputGUI::renderListContainer ( )
protected

Definition at line 199 of file class.ilMultipleNestedOrderingElementsInputGUI.php.

199 : void
200 {
201 $this->getListTpl()->setCurrentBlock('list_container');
202 $this->getListTpl()->setVariable('INSTANCE_ID', $this->getInstanceId());
203 $this->getListTpl()->parseCurrentBlock();
204 }

References getInstanceId(), and getListTpl().

Referenced by renderMainList().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ renderListItem()

ilMultipleNestedOrderingElementsInputGUI::renderListItem (   $value,
  $identifier,
  $position 
)
protected

Definition at line 212 of file class.ilMultipleNestedOrderingElementsInputGUI.php.

212 : void
213 {
214 $subPostVar = $this->getMultiValuePostVarSubField($identifier, self::POSTVAR_SUBFIELD_NEST_ELEM);
215 $subFieldId = $this->getMultiValueSubFieldId($identifier, self::POSTVAR_SUBFIELD_NEST_ELEM);
216
217 $this->getListTpl()->setCurrentBlock('item_value');
218
219 $this->getListTpl()->setVariable('ILC_HANDLE_CSS_CLASS', $this->getCssHandleClass());
220
221 $this->getListTpl()->setVariable('LIST_ITEM_VALUE', $this->getItemHtml(
222 $value,
223 $identifier,
224 $position,
225 $subPostVar,
226 $subFieldId
227 ));
228
229 $this->getListTpl()->parseCurrentBlock();
230
231 $this->renderListSnippet();
232 }
getItemHtml($value, $identifier, $position, $itemSubFieldPostVar, $itemSubFieldId)

References ilTextInputGUI\$value, getCssHandleClass(), getItemHtml(), getListTpl(), ilIdentifiedMultiValuesInputGUI\getMultiValuePostVarSubField(), ilIdentifiedMultiValuesInputGUI\getMultiValueSubFieldId(), and renderListSnippet().

Referenced by renderMainList().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ renderListSnippet()

ilMultipleNestedOrderingElementsInputGUI::renderListSnippet ( )
protected

Definition at line 206 of file class.ilMultipleNestedOrderingElementsInputGUI.php.

206 : void
207 {
208 $this->getListTpl()->setCurrentBlock('list_snippet');
209 $this->getListTpl()->parseCurrentBlock();
210 }

References getListTpl().

Referenced by renderBeginListItem(), renderBeginSubList(), renderEndListItem(), renderEndSubList(), and renderListItem().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ renderMainList()

ilMultipleNestedOrderingElementsInputGUI::renderMainList ( )
protected

Definition at line 292 of file class.ilMultipleNestedOrderingElementsInputGUI.php.

292 : string
293 {
294 $this->initListTemplate();
295 $this->renderBeginSubList();
296
297
298 $values = array_values($this->getIdentifiedMultiValues());
299 $keys = array_keys($this->getIdentifiedMultiValues());
300 $prevIndent = 0;
301
302 foreach ($values as $counter => $value) {
303 $identifier = str_replace(assOrderingQuestionGUI::F_NESTED_IDENTIFIER_PREFIX, '', $keys[$counter]);
304
305 if ($this->isNestingEnabled()) {
306 $curIndent = $this->getCurrentIndentation($values, $counter);
307 $nextIndent = $this->getNextIndentation($values, $counter);
308 } else {
309 $curIndent = $nextIndent = 0;
310 }
311
312 if ($prevIndent == $curIndent) {
313 // pcn = Previous, Current, Next -> Depth
314 // pcn: 000, 001, 110, 220
315 if ($curIndent == $nextIndent) {
316 // (1) pcn: 000
317 // echo"(1)";
318 $this->renderBeginListItem($identifier);
319 $this->renderListItem($value, $identifier, $counter);
320 $this->renderEndListItem();
321 } elseif ($curIndent > $nextIndent) {
322 if ($prevIndent == $nextIndent) {
323 // wenn prev = cur ist und cur > next, wie soll prev = next sein !?
324
325 // (8) pcn: 110
326 // echo"(8)";
327 $this->renderBeginListItem($identifier);
328 $this->renderListItem($value, $identifier, $counter);
329 $this->renderEndListItem();
330 $this->renderEndSubList();
331 $this->renderEndListItem();
332 } elseif ($prevIndent > $nextIndent) {
333 // (12) pcn: 220
334 // echo"(12)";
335 $this->renderBeginListItem($identifier);
336 $this->renderListItem($value, $identifier, $counter);
337
338 for ($openlists = $nextIndent; $openlists < $curIndent; $openlists++) {
339 $this->renderEndListItem();
340 $this->renderEndSubList();
341 $this->renderEndListItem();
342 }
343 }
344 } elseif ($curIndent < $nextIndent) {
345 // (2) pcn: 001
346 // echo"(2)";
347 $this->renderBeginListItem($identifier);
348 $this->renderListItem($value, $identifier, $counter);
349 $this->renderBeginSubList();
350 }
351 } elseif ($prevIndent > $curIndent) {
352 if ($curIndent == $nextIndent) {
353 // (6) pcn: 100
354 // echo"(6)";
355 $this->renderBeginListItem($identifier);
356 $this->renderListItem($value, $identifier, $counter);
357 $this->renderEndListItem();
358 } elseif ($curIndent > $nextIndent) {
359 // (11) pcn: 210
360 // echo"(11)";
361 $this->renderBeginListItem($identifier);
362 $this->renderListItem($value, $identifier, $counter);
363 $this->renderEndListItem();
364 $this->renderEndSubList();
365 } elseif ($curIndent < $nextIndent) {
366 if ($prevIndent == $nextIndent) {
367 // (7) pcn: 101
368 // echo"(7)";
369 $this->renderBeginListItem($identifier);
370 $this->renderListItem($value, $identifier, $counter);
371 $this->renderBeginSubList();
372 } elseif ($prevIndent > $nextIndent) {
373 // (10) pcn: 201
374 // echo"(10)";
375 $this->renderBeginListItem($identifier);
376 $this->renderListItem($value, $identifier, $counter);
377 for ($openlists = $nextIndent; $openlists < $curIndent; $openlists++) {
378 $this->renderEndSubList();
379 }
380 $this->renderBeginSubList();
381 }
382 }
383 } elseif ($prevIndent < $curIndent) {
384 if ($curIndent == $nextIndent) {
385 // (4) pcn: 011
386 // echo"(4)";
387 $this->renderBeginListItem($identifier);
388 $this->renderListItem($value, $identifier, $counter);
389 $this->renderEndListItem();
390 } elseif ($curIndent > $nextIndent) {
391 if ($prevIndent == $nextIndent) {
392 // (3) pcn: 010,
393 // echo"(3)";
394 $this->renderBeginListItem($identifier);
395 $this->renderListItem($value, $identifier, $counter);
396 $this->renderEndListItem();
397 $this->renderEndSubList();
398 $this->renderEndListItem();
399 } elseif ($prevIndent > $nextIndent) {
400 // (9) pcn: 120
401 // echo"(9)";
402 $this->renderBeginListItem($identifier);
403 $this->renderListItem($value, $identifier, $counter);
404 for ($openlists = $nextIndent; $openlists < $curIndent; $openlists++) {
405 $this->renderEndListItem();
406 $this->renderEndSubList();
407 }
408 }
409 } elseif ($curIndent < $nextIndent) {
410 // (5) pcn: 012
411 // echo"(5)";
412 $this->renderBeginListItem($identifier);
413 $this->renderListItem($value, $identifier, $counter);
414 $this->renderBeginSubList();
415 }
416 }
417
418 $prevIndent = $curIndent;
419 }
420
421 $this->renderEndSubList();
422 $this->renderListContainer();
423
424 return $this->fetchListHtml();
425 }
getNextIndentation($elementValues, $elementCounter)
getCurrentIndentation($elementValues, $elementCounter)
$keys
Definition: metadata.php:204

References $keys, ilTextInputGUI\$value, assOrderingQuestionGUI\F_NESTED_IDENTIFIER_PREFIX, fetchListHtml(), getCurrentIndentation(), ilIdentifiedMultiValuesInputGUI\getIdentifiedMultiValues(), getNextIndentation(), initListTemplate(), isNestingEnabled(), renderBeginListItem(), renderBeginSubList(), renderEndListItem(), renderEndSubList(), renderListContainer(), and renderListItem().

Referenced by render().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setCssHandleClass()

ilMultipleNestedOrderingElementsInputGUI::setCssHandleClass (   $cssHandleClass)
Parameters
string$cssHandleClass

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

143 : void
144 {
145 $this->cssHandleClass = $cssHandleClass;
146 }

References $cssHandleClass.

Referenced by ilAssNestedOrderingElementsInputGUI\__construct().

+ Here is the caller graph for this function:

◆ setCssItemClass()

ilMultipleNestedOrderingElementsInputGUI::setCssItemClass (   $cssItemClass)
Parameters
string$cssItemClass

Definition at line 151 of file class.ilMultipleNestedOrderingElementsInputGUI.php.

151 : void
152 {
153 $this->cssItemClass = $cssItemClass;
154 }

References $cssItemClass.

Referenced by ilAssNestedOrderingElementsInputGUI\__construct().

+ Here is the caller graph for this function:

◆ setCssListClass()

ilMultipleNestedOrderingElementsInputGUI::setCssListClass (   $cssListClass)
Parameters
string$cssListClass

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

119 : void
120 {
121 $this->cssListClass = $cssListClass;
122 }

References $cssListClass.

Referenced by ilAssNestedOrderingElementsInputGUI\__construct().

+ Here is the caller graph for this function:

◆ setHtmlListTag()

ilMultipleNestedOrderingElementsInputGUI::setHtmlListTag (   $htmlListTag)
Parameters
string$htmlListTag

Definition at line 167 of file class.ilMultipleNestedOrderingElementsInputGUI.php.

167 : void
168 {
169 $this->htmlListTag = $htmlListTag;
170 }

References $htmlListTag.

Referenced by ilAssNestedOrderingElementsInputGUI\__construct().

+ Here is the caller graph for this function:

◆ setInstanceId()

ilMultipleNestedOrderingElementsInputGUI::setInstanceId (   $instanceId)

Definition at line 63 of file class.ilMultipleNestedOrderingElementsInputGUI.php.

63 : void
64 {
65 $this->instanceId = $instanceId;
66 }

References $instanceId.

◆ setInteractionEnabled()

ilMultipleNestedOrderingElementsInputGUI::setInteractionEnabled (   $interactionEnabled)

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

73 : void
74 {
75 $this->interactionEnabled = $interactionEnabled;
76 }

References $interactionEnabled.

◆ setListTpl()

ilMultipleNestedOrderingElementsInputGUI::setListTpl (   $listTpl)

Definition at line 182 of file class.ilMultipleNestedOrderingElementsInputGUI.php.

182 : void
183 {
184 $this->listTpl = $listTpl;
185 }

References $listTpl.

Referenced by initListTemplate().

+ Here is the caller graph for this function:

◆ setNestingEnabled()

ilMultipleNestedOrderingElementsInputGUI::setNestingEnabled (   $nestingEnabled)

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

88 : void
89 {
90 $this->nestingEnabled = $nestingEnabled;
91 }

References $nestingEnabled.

◆ setStylingDisabled()

ilMultipleNestedOrderingElementsInputGUI::setStylingDisabled (   $stylingDisabled)

Definition at line 98 of file class.ilMultipleNestedOrderingElementsInputGUI.php.

98 : void
99 {
100 $this->stylingDisabled = $stylingDisabled;
101 }

References $stylingDisabled.

Field Documentation

◆ $cssHandleClass

ilMultipleNestedOrderingElementsInputGUI::$cssHandleClass = self::CSS_HANDLE_CLASS
protected

◆ $cssItemClass

ilMultipleNestedOrderingElementsInputGUI::$cssItemClass = self::CSS_ITEM_CLASS
protected

◆ $cssListClass

ilMultipleNestedOrderingElementsInputGUI::$cssListClass = self::CSS_LIST_CLASS
protected

◆ $htmlListTag

ilMultipleNestedOrderingElementsInputGUI::$htmlListTag = self::HTML_LIST_TAG_OL
protected

◆ $instanceId

ilMultipleNestedOrderingElementsInputGUI::$instanceId = self::DEFAULT_INSTANCE_ID
protected

◆ $interactionEnabled

ilMultipleNestedOrderingElementsInputGUI::$interactionEnabled = true
protected

◆ $listTpl

ilMultipleNestedOrderingElementsInputGUI::$listTpl = null
protected

Definition at line 45 of file class.ilMultipleNestedOrderingElementsInputGUI.php.

Referenced by getListTpl(), and setListTpl().

◆ $nestingEnabled

ilMultipleNestedOrderingElementsInputGUI::$nestingEnabled = true
protected

◆ $stylingDisabled

ilMultipleNestedOrderingElementsInputGUI::$stylingDisabled = false
protected

◆ CSS_HANDLE_CLASS

const ilMultipleNestedOrderingElementsInputGUI::CSS_HANDLE_CLASS = 'il-dd-handle'

◆ CSS_ITEM_CLASS

const ilMultipleNestedOrderingElementsInputGUI::CSS_ITEM_CLASS = 'dd-item'

◆ CSS_LIST_CLASS

const ilMultipleNestedOrderingElementsInputGUI::CSS_LIST_CLASS = 'dd-list'

◆ DEFAULT_INSTANCE_ID

const ilMultipleNestedOrderingElementsInputGUI::DEFAULT_INSTANCE_ID = 'default'

◆ HTML_LIST_TAG_OL

const ilMultipleNestedOrderingElementsInputGUI::HTML_LIST_TAG_OL = 'ol'

◆ HTML_LIST_TAG_UL

const ilMultipleNestedOrderingElementsInputGUI::HTML_LIST_TAG_UL = 'ul'

◆ POSTVAR_SUBFIELD_NEST_ELEM

const ilMultipleNestedOrderingElementsInputGUI::POSTVAR_SUBFIELD_NEST_ELEM = 'content'

◆ POSTVAR_SUBFIELD_NEST_INDENT

const ilMultipleNestedOrderingElementsInputGUI::POSTVAR_SUBFIELD_NEST_INDENT = 'indentation'

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