ILIAS  trunk Revision v11.0_alpha-2662-g519ff7d528f
ILIAS\TestQuestionPool\Questions\Presentation\QuestionTable Class Reference
+ Inheritance diagram for ILIAS\TestQuestionPool\Questions\Presentation\QuestionTable:
+ Collaboration diagram for ILIAS\TestQuestionPool\Questions\Presentation\QuestionTable:

Public Member Functions

 __construct (protected UIFactory $ui_factory, protected UIRenderer $ui_renderer, protected DataFactory $data_factory, protected Refinery $refinery, protected URLBuilder $url_builder, protected URLBuilderToken $action_parameter_token, protected URLBuilderToken $row_id_token, protected \ilDBInterface $db, protected \ilLanguage $lng, protected \ilComponentRepository $component_repository, protected \ilRbacSystem $rbac, protected \ilObjUser $current_user, protected TaxonomyService $taxonomy, protected NotesService $notes_service, protected int $parent_obj_id, protected int $request_ref_id)
 
 getTable ()
 
 getFilter (\ilUIService $ui_service, string $action)
 Filters should be part of the Table; for now, since they are not fully integrated, they are rendered and applied seperately. More...
 
 getColums ()
 
 getRows (Table\DataRowBuilder $row_builder, array $visible_column_ids, Range $range, Order $order, ?array $filter_data, ?array $additional_parameters)
 
 getTotalRowCount (?array $filter_data, ?array $additional_parameters)
 
- Public Member Functions inherited from ilAssQuestionList
 __construct (private ilDBInterface $db, private ilLanguage $lng, private Refinery $refinery, private ilComponentRepository $component_repository, private ?NotesService $notes_service=null)
 
 setOrder (?Order $order=null)
 
 setRange (?Range $range=null)
 
 getParentObjId ()
 
 setParentObjId (?int $parentObjId)
 
 setParentObjectType (string $parentObjType)
 
 setParentObjIdsFilter (array $parentObjIdsFilter)
 
 setQuestionInstanceTypeFilter (?string $questionInstanceTypeFilter)
 
 setIncludeQuestionIdsFilter (array $questionIdsFilter)
 
 setExcludeQuestionIdsFilter (array $excludeQuestionIdsFilter)
 
 addFieldFilter (string $fieldName, mixed $fieldValue)
 
 addTaxonomyFilter ($taxId, $taxNodes, $parentObjId, $parentObjType)
 
 addTaxonomyFilterNoTaxonomySet (bool $flag)
 
 setAvailableTaxonomyIds (array $availableTaxonomyIds)
 
 setAnswerStatusActiveId (?int $answerStatusActiveId)
 
 setAnswerStatusFilter (string $answerStatusFilter)
 
 setJoinObjectData (bool $a_val)
 Set if object data table should be joined. More...
 
 load ()
 
 getTotalRowCount (?array $filter_data, ?array $additional_parameters)
 
 setCommentFilter (?int $commented=null)
 
 getDataArrayForQuestionId (int $questionId)
 
 getQuestionDataArray ()
 
 isInList (int $questionId)
 
 getTitle (string $a_comp_id, string $a_item_type, int $a_item_id)
 Get title of an assigned item. More...
 

Protected Member Functions

 getData (Order $order, Range $range)
 
 getActions ()
 
 buildAction (string $act, string $type, bool $async=false)
 
 postOrder (array $list, \ILIAS\Data\Order $order)
 
- Protected Member Functions inherited from ilAssQuestionList
 getTaxItems (string $parentType, int $parentObjId, int $taxId, int $taxNode)
 
 getNumberOfCommentsForQuestion (int $question_id)
 

Private Member Functions

 treeify (&$pointer, $stack)
 
 toNestedList (array $nodes)
 
 taxNodeReader ($tree, $sortfield, $node_id)
 
 singleTaxonomyRepresentation (int $tax_id, array $stored_tax_data, string $check_marker)
 
 taxonomyRepresentation (array $taxonomy_data)
 
 showCommentAction ()
 

Additional Inherited Members

- Data Fields inherited from ilAssQuestionList
const QUESTION_ANSWER_STATUS_NON_ANSWERED = 'nonAnswered'
 answer status domain for single questions More...
 
const QUESTION_ANSWER_STATUS_WRONG_ANSWERED = 'wrongAnswered'
 
const QUESTION_ANSWER_STATUS_CORRECT_ANSWERED = 'correctAnswered'
 
const ANSWER_STATUS_FILTER_ALL_NON_CORRECT = 'allNonCorrect'
 answer status filter value domain More...
 
const ANSWER_STATUS_FILTER_NON_ANSWERED_ONLY = 'nonAnswered'
 
const ANSWER_STATUS_FILTER_WRONG_ANSWERED_ONLY = 'wrongAnswered'
 
const QUESTION_INSTANCE_TYPE_ORIGINALS = 'QST_INSTANCE_TYPE_ORIGINALS'
 
const QUESTION_INSTANCE_TYPE_DUPLICATES = 'QST_INSTANCE_TYPE_DUPLICATES'
 
const QUESTION_INSTANCE_TYPE_ALL = 'QST_INSTANCE_TYPE_ALL'
 
const QUESTION_COMMENTED_ONLY = '1'
 
const QUESTION_COMMENTED_EXCLUDED = '2'
 
- Protected Attributes inherited from ilAssQuestionList
bool $join_obj_data = true
 
string $filter_comments = null
 
array $questions = []
 

Detailed Description

Definition at line 36 of file QuestionTable.php.

Constructor & Destructor Documentation

◆ __construct()

ILIAS\TestQuestionPool\Questions\Presentation\QuestionTable::__construct ( protected UIFactory  $ui_factory,
protected UIRenderer  $ui_renderer,
protected DataFactory  $data_factory,
protected Refinery  $refinery,
protected URLBuilder  $url_builder,
protected URLBuilderToken  $action_parameter_token,
protected URLBuilderToken  $row_id_token,
protected \ilDBInterface  $db,
protected \ilLanguage  $lng,
protected \ilComponentRepository  $component_repository,
protected \ilRbacSystem  $rbac,
protected \ilObjUser  $current_user,
protected TaxonomyService  $taxonomy,
protected NotesService  $notes_service,
protected int  $parent_obj_id,
protected int  $request_ref_id 
)

Definition at line 38 of file QuestionTable.php.

References ILIAS\GlobalScreen\Provider\__construct(), ilLanguage\loadLanguageModule(), and ilAssQuestionList\setAvailableTaxonomyIds().

55  {
56  $lng->loadLanguageModule('qpl');
57  parent::__construct($db, $lng, $refinery, $component_repository, $notes_service);
58  $this->setAvailableTaxonomyIds($taxonomy->getUsageOfObject($parent_obj_id));
59  }
setAvailableTaxonomyIds(array $availableTaxonomyIds)
__construct(Container $dic, ilPlugin $plugin)
global $lng
Definition: privfeed.php:31
+ Here is the call graph for this function:

Member Function Documentation

◆ buildAction()

ILIAS\TestQuestionPool\Questions\Presentation\QuestionTable::buildAction ( string  $act,
string  $type,
bool  $async = false 
)
protected

Definition at line 349 of file QuestionTable.php.

References ILIAS\Repository\lng().

Referenced by ILIAS\TestQuestionPool\Questions\Presentation\QuestionTable\getActions().

349  : array
350  {
351  $action = $this->ui_factory->table()->action()
352  ->$type(
353  $this->lng->txt($act),
354  $this->url_builder->withParameter($this->action_parameter_token, $act),
355  $this->row_id_token
356  );
357  if ($async) {
358  $action = $action->withAsync(true);
359  }
360 
361  return [$act => $action];
362  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getActions()

ILIAS\TestQuestionPool\Questions\Presentation\QuestionTable::getActions ( )
protected

Definition at line 330 of file QuestionTable.php.

References ILIAS\TestQuestionPool\Questions\Presentation\QuestionTable\buildAction(), ilBulkEditQuestionsGUI\CMD_EDITLIFECYCLE, ilBulkEditQuestionsGUI\CMD_EDITTAUTHOR, ilBulkEditQuestionsGUI\CMD_EDITTAXONOMIES, and ILIAS\TestQuestionPool\Questions\Presentation\QuestionTable\showCommentAction().

Referenced by ILIAS\TestQuestionPool\Questions\Presentation\QuestionTable\getTable().

330  : array
331  {
332  return array_merge(
333  $this->buildAction('copy', 'standard'),
334  $this->buildAction('move', 'standard'),
335  $this->buildAction('delete', 'standard'),
336  $this->buildAction('export', 'multi'),
337  $this->buildAction('preview', 'single'),
338  $this->buildAction('statistics', 'single'),
339  $this->buildAction('edit_question', 'single'),
340  $this->buildAction('edit_page', 'single'),
341  $this->buildAction('feedback', 'single'),
345  $this->showCommentAction() ? $this->buildAction('comments', 'single', true) : []
346  );
347  }
buildAction(string $act, string $type, bool $async=false)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getColums()

ILIAS\TestQuestionPool\Questions\Presentation\QuestionTable::getColums ( )

Definition at line 147 of file QuestionTable.php.

References Vendor\Package\$f, ilUtil\getImagePath(), and ILIAS\Repository\lng().

Referenced by ILIAS\TestQuestionPool\Questions\Presentation\QuestionTable\getTable().

147  : array
148  {
149  $f = $this->ui_factory->table()->column();
150  $df = $this->data_factory->dateFormat();
151  $icon_yes = $this->ui_factory->symbol()->icon()->custom(\ilUtil::getImagePath('standard/icon_checked.svg'), 'yes');
152  $icon_no = $this->ui_factory->symbol()->icon()->custom(\ilUtil::getImagePath('standard/icon_unchecked.svg'), 'no');
153 
154  return [
155  'title' => $f->link($this->lng->txt('title')),
156  'description' => $f->text($this->lng->txt('description'))->withIsOptional(true, true),
157  'ttype' => $f->text($this->lng->txt('question_type'))->withIsOptional(true, true),
158  'points' => $f->number($this->lng->txt('points'))->withDecimals(2)->withIsOptional(true, true),
159  'author' => $f->text($this->lng->txt('author'))->withIsOptional(true, true),
160  'lifecycle' => $f->text($this->lng->txt('qst_lifecycle'))->withIsOptional(true, true),
161  'taxonomies' => $f->text($this->lng->txt('qpl_settings_subtab_taxonomies'))->withIsOptional(true, true),
162  'feedback' => $f->boolean($this->lng->txt('feedback'), $icon_yes, $icon_no)->withIsOptional(true, true),
163  'created' => $f->date(
164  $this->lng->txt('create_date'),
165  $this->current_user->getDateTimeFormat()
166  )->withIsOptional(true, true),
167  'tstamp' => $f->date(
168  $this->lng->txt('last_update'),
169  $this->current_user->getDateTimeFormat()
170  )->withIsOptional(true, true),
171  'comments' => $f->number($this->lng->txt('comments'))->withIsOptional(true, false),
172  ];
173  }
static getImagePath(string $image_name, string $module_path="", string $mode="output", bool $offline=false)
get image path (for images located in a template directory)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getData()

ILIAS\TestQuestionPool\Questions\Presentation\QuestionTable::getData ( Order  $order,
Range  $range 
)
protected

Definition at line 320 of file QuestionTable.php.

References $data, ilAssQuestionList\getQuestionDataArray(), ilAssQuestionList\load(), null, ILIAS\TestQuestionPool\Questions\Presentation\QuestionTable\postOrder(), ilAssQuestionList\setParentObjId(), and ILIAS\Data\Range\unpack().

Referenced by ILIAS\TestQuestionPool\Questions\Presentation\QuestionTable\getRows().

320  : array
321  {
322  $this->setParentObjId($this->parent_obj_id);
323  $this->load();
324  $data = $this->postOrder($this->getQuestionDataArray(), $order);
325  [$offset, $length] = $range->unpack();
326  $length = $length > 0 ? $length : null;
327  return array_slice($data, $offset, $length);
328  }
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
postOrder(array $list, \ILIAS\Data\Order $order)
setParentObjId(?int $parentObjId)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getFilter()

ILIAS\TestQuestionPool\Questions\Presentation\QuestionTable::getFilter ( \ilUIService  $ui_service,
string  $action 
)

Filters should be part of the Table; for now, since they are not fully integrated, they are rendered and applied seperately.

Definition at line 76 of file QuestionTable.php.

References ilObjQuestionPool\_getQuestionTypes(), ilUIService\filter(), ilAssQuestionLifecycle\getDraftInstance(), ILIAS\Repository\lng(), ilAssQuestionList\QUESTION_COMMENTED_EXCLUDED, ilAssQuestionList\QUESTION_COMMENTED_ONLY, ilObjTaxonomy\SORT_ALPHABETICAL, and ILIAS\TestQuestionPool\Questions\Presentation\QuestionTable\taxNodeReader().

76  : Filter
77  {
78  $lifecycle_options = array_merge(
79  ['' => $this->lng->txt('qst_lifecycle_filter_all')],
80  \ilAssQuestionLifecycle::getDraftInstance()->getSelectOptions($this->lng)
81  );
82  $question_type_options = [
83  '' => $this->lng->txt('filter_all_question_types')
84  ];
85  $question_types = \ilObjQuestionPool::_getQuestionTypes();
86  foreach ($question_types as $translation => $row) {
87  $question_type_options[$row['type_tag']] = $translation;
88  }
89 
90  $field_factory = $this->ui_factory->input()->field();
91  $filter_inputs = [
92  'title' => $field_factory->text($this->lng->txt("title")),
93  'description' => $field_factory->text($this->lng->txt("description")),
94  'author' => $field_factory->text($this->lng->txt("author")),
95  'lifecycle' => $field_factory->select($this->lng->txt("qst_lifecycle"), $lifecycle_options),
96  'type' => $field_factory->select($this->lng->txt("type"), $question_type_options),
97  'commented' => $field_factory->select(
98  $this->lng->txt("ass_comments"),
99  [
100  \ilAssQuestionList::QUESTION_COMMENTED_ONLY => $this->lng->txt('qpl_filter_commented_only'),
101  \ilAssQuestionList::QUESTION_COMMENTED_EXCLUDED => $this->lng->txt('qpl_filter_commented_exclude')
102  ]
103  )
104  ];
105 
106  $taxs = $this->taxonomy->getUsageOfObject($this->parent_obj_id, true);
107  $tax_filter_options = [
108  'null' => '<b>' . $this->lng->txt('tax_filter_notax') . '</b>'
109  ];
110 
111  foreach ($taxs as $tax_entry) {
112  $tax = new \ilObjTaxonomy($tax_entry['tax_id']);
113  $tax_tree = $tax->getTree();
114  $sortfield = $tax->getSortingMode() === \ilObjTaxonomy::SORT_ALPHABETICAL ? 'title' : 'order_nr';
115  $children = $this->taxNodeReader($tax_tree, $sortfield, $tax_tree->readRootId());
116  $nodes = implode('-', array_map(fn($node) => $node['obj_id'], $children));
117 
118  $tax_id = $tax_entry['tax_id'] . '-0-' . $nodes;
119  $tax_title = '<b>' . $tax_entry['title'] . '</b>';
120  $tax_filter_options[$tax_id] = $tax_title;
121 
122  foreach ($children as $subtax) {
123  $stax_id = $subtax['tax_id'] . '-' . $subtax['obj_id'];
124  $stax_title = str_repeat('&nbsp; ', ($subtax['depth'] - 2) * 2)
125  . ' &boxur;&HorizontalLine; '
126  . $subtax['title'];
127 
128  $tax_filter_options[$stax_id] = $stax_title;
129  }
130  }
131  $filter_inputs['taxonomies'] = $field_factory->multiSelect($this->lng->txt("tax_filter"), $tax_filter_options);
132 
133  $active = array_fill(0, count($filter_inputs), true);
134 
135  $filter = $ui_service->filter()->standard(
136  'question_table_filter_id',
137  $action,
138  $filter_inputs,
139  $active,
140  true,
141  true
142  );
143  return $filter;
144  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static _getQuestionTypes($all_tags=false, $fixOrder=false, $withDeprecatedTypes=true)
+ Here is the call graph for this function:

◆ getRows()

ILIAS\TestQuestionPool\Questions\Presentation\QuestionTable::getRows ( Table\DataRowBuilder  $row_builder,
array  $visible_column_ids,
Range  $range,
Order  $order,
?array  $filter_data,
?array  $additional_parameters 
)

Definition at line 274 of file QuestionTable.php.

References $lifecycle, ILIAS\TestQuestionPool\Questions\Presentation\QuestionTable\getData(), ilAssQuestionLifecycle\getInstance(), ILIAS\Repository\lng(), ILIAS\Repository\rbac(), and ILIAS\TestQuestionPool\Questions\Presentation\QuestionTable\taxonomyRepresentation().

281  : \Generator {
282  $no_write_access = !($this->rbac->checkAccess('write', $this->request_ref_id));
283  $timezone = new \DateTimeZone($this->current_user->getTimeZone());
284  foreach ($this->getData($order, $range) as $record) {
285  $row_id = (string) $record['question_id'];
286  $record['created'] = (new \DateTimeImmutable("@{$record['created']}"))->setTimezone($timezone);
287  $record['tstamp'] = (new \DateTimeImmutable("@{$record['tstamp']}"))->setTimezone($timezone);
288  $lifecycle = \ilAssQuestionLifecycle::getInstance($record['lifecycle']);
289  $record['lifecycle'] = $lifecycle->getTranslation($this->lng);
290 
291  $title = $record['title'];
292  $to_question = $this->url_builder
293  ->withParameter($this->action_parameter_token, 'preview')
294  ->withParameter($this->row_id_token, $row_id)
295  ->buildURI()->__toString();
296  if (!(bool) $record['complete']) {
297  $title .= ' (' . $this->lng->txt('warning_question_not_complete') . ')';
298  }
299  $record['title'] = $this->ui_factory->link()->standard($title, $to_question);
300  $record['taxonomies'] = $this->taxonomyRepresentation($record['taxonomies']);
301 
302  yield $row_builder->buildDataRow($row_id, $record)
303  ->withDisabledAction('move', $no_write_access)
304  ->withDisabledAction('copy', $no_write_access)
305  ->withDisabledAction('delete', $no_write_access)
306  ->withDisabledAction('feedback', $no_write_access)
307  ;
308  }
309  }
$lifecycle
+ Here is the call graph for this function:

◆ getTable()

ILIAS\TestQuestionPool\Questions\Presentation\QuestionTable::getTable ( )

Definition at line 61 of file QuestionTable.php.

References ILIAS\TestQuestionPool\Questions\Presentation\QuestionTable\getActions(), ILIAS\TestQuestionPool\Questions\Presentation\QuestionTable\getColums(), and ILIAS\Repository\lng().

61  : Table\Data
62  {
63  return $this->ui_factory->table()->data(
64  $this,
65  $this->lng->txt('questions'),
66  $this->getColums(),
67  )
68  ->withActions($this->getActions())
69  ->withId('qpt' . $this->parent_obj_id . '_' . $this->request_ref_id);
70  }
+ Here is the call graph for this function:

◆ getTotalRowCount()

ILIAS\TestQuestionPool\Questions\Presentation\QuestionTable::getTotalRowCount ( ?array  $filter_data,
?array  $additional_parameters 
)

Definition at line 311 of file QuestionTable.php.

References ilAssQuestionList\getQuestionDataArray(), ilAssQuestionList\load(), and ilAssQuestionList\setParentObjId().

314  : ?int {
315  $this->setParentObjId($this->parent_obj_id);
316  $this->load();
317  return count($this->getQuestionDataArray());
318  }
setParentObjId(?int $parentObjId)
+ Here is the call graph for this function:

◆ postOrder()

ILIAS\TestQuestionPool\Questions\Presentation\QuestionTable::postOrder ( array  $list,
\ILIAS\Data\Order  $order 
)
protected

Definition at line 364 of file QuestionTable.php.

References Vendor\Package\$a, Vendor\Package\$b, and null.

Referenced by ILIAS\TestQuestionPool\Questions\Presentation\QuestionTable\getData().

364  : array
365  {
366  [$aspect, $direction] = $order->join('', function ($i, $k, $v) {
367  return [$k, $v];
368  });
369  usort($list, static function (array $a, array $b) use ($aspect): int {
370  if (is_numeric($a[$aspect]) || is_bool($a[$aspect])) {
371  return $a[$aspect] <=> $b[$aspect];
372  }
373  if (is_array($a[$aspect])) {
374  return $a[$aspect] <=> $b[$aspect];
375  }
376 
377  $aspect_a = '';
378  $aspect_b = '';
379  if ($a[$aspect] !== null) {
380  $aspect_a = $a[$aspect];
381  }
382  if ($b[$aspect] !== null) {
383  $aspect_b = $b[$aspect];
384  }
385 
386  return strcoll($aspect_a, $aspect_b);
387  });
388 
389  if ($direction === $order::DESC) {
390  $list = array_reverse($list);
391  }
392  return $list;
393  }
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
$a
thx to https://mlocati.github.io/php-cs-fixer-configurator for the examples
+ Here is the caller graph for this function:

◆ showCommentAction()

ILIAS\TestQuestionPool\Questions\Presentation\QuestionTable::showCommentAction ( )
private

Definition at line 395 of file QuestionTable.php.

References ILIAS\Repository\rbac().

Referenced by ILIAS\TestQuestionPool\Questions\Presentation\QuestionTable\getActions().

395  : bool
396  {
397  return $this->notes_service->domain()->commentsActive($this->parent_obj_id)
398  || $this->rbac->checkAccess('write', $this->request_ref_id);
399  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ singleTaxonomyRepresentation()

ILIAS\TestQuestionPool\Questions\Presentation\QuestionTable::singleTaxonomyRepresentation ( int  $tax_id,
array  $stored_tax_data,
string  $check_marker 
)
private

Definition at line 223 of file QuestionTable.php.

References $path, ilObject\_lookupTitle(), ilObjTaxonomy\SORT_ALPHABETICAL, ILIAS\TestQuestionPool\Questions\Presentation\QuestionTable\taxNodeReader(), ILIAS\TestQuestionPool\Questions\Presentation\QuestionTable\toNestedList(), and ILIAS\TestQuestionPool\Questions\Presentation\QuestionTable\treeify().

Referenced by ILIAS\TestQuestionPool\Questions\Presentation\QuestionTable\taxonomyRepresentation().

227  : string {
228  $tax = new \ilObjTaxonomy($tax_id);
229  $tax_tree = $tax->getTree();
230  $sortfield = $tax->getSortingMode() === \ilObjTaxonomy::SORT_ALPHABETICAL ? 'title' : 'order_nr';
231  $taxnodes = $this->taxNodeReader($tax_tree, $sortfield, $tax_tree->readRootId());
232 
233  $nodes = [];
234  foreach ($taxnodes as $taxnode) {
235  $taxdata = array_filter(
236  $stored_tax_data,
237  fn($data_child) => $data_child['node_id'] === $taxnode['obj_id']
238  );
239 
240  foreach (array_keys($taxdata) as $node_obj_id) {
241  $path = array_map(
242  fn($n) => in_array($n['obj_id'], array_keys($stored_tax_data)) ? $check_marker . $n['title'] : $n['title'],
243  $tax_tree->getPathFull($node_obj_id),
244  );
245  $path[0] = \ilObject::_lookupTitle($tax_id);
246  $this->treeify($nodes, $path);
247  }
248  }
249  return $this->toNestedList($nodes);
250  }
$path
Definition: ltiservices.php:29
static _lookupTitle(int $obj_id)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ taxNodeReader()

ILIAS\TestQuestionPool\Questions\Presentation\QuestionTable::taxNodeReader (   $tree,
  $sortfield,
  $node_id 
)
private

Definition at line 202 of file QuestionTable.php.

References Vendor\Package\$a, Vendor\Package\$b, and $c.

Referenced by ILIAS\TestQuestionPool\Questions\Presentation\QuestionTable\getFilter(), and ILIAS\TestQuestionPool\Questions\Presentation\QuestionTable\singleTaxonomyRepresentation().

202  : array
203  {
204  $ret = [];
205  $nodes = $tree->getChildsByTypeFilter($node_id, ['taxn']);
206  usort(
207  $nodes,
208  fn($a, $b) => strcmp(
209  (string) $a[$sortfield],
210  (string) $b[$sortfield]
211  )
212  );
213 
214  foreach ($nodes as $node) {
215  $ret[] = $node;
216  foreach ($this->taxNodeReader($tree, $sortfield, $node['obj_id']) as $c) {
217  $ret[] = $c;
218  }
219  }
220  return $ret;
221  }
$c
Definition: deliver.php:25
$a
thx to https://mlocati.github.io/php-cs-fixer-configurator for the examples
+ Here is the caller graph for this function:

◆ taxonomyRepresentation()

ILIAS\TestQuestionPool\Questions\Presentation\QuestionTable::taxonomyRepresentation ( array  $taxonomy_data)
private

Definition at line 252 of file QuestionTable.php.

References $check, ilUtil\getImagePath(), and ILIAS\TestQuestionPool\Questions\Presentation\QuestionTable\singleTaxonomyRepresentation().

Referenced by ILIAS\TestQuestionPool\Questions\Presentation\QuestionTable\getRows().

252  : string
253  {
254  $check = $this->ui_renderer->render(
255  $this->ui_factory->symbol()->icon()->custom(\ilUtil::getImagePath('standard/icon_checked.svg'), 'checked')
256  );
257 
258  $taxonomies = [];
259  $taxs = $this->taxonomy->getUsageOfObject($this->parent_obj_id, true);
260  foreach ($taxs as $tax_entry) {
261  $tax_id = $tax_entry['tax_id'];
262  if (!array_key_exists($tax_id, $taxonomy_data)) {
263  continue;
264  }
265  $taxonomies[] = $this->singleTaxonomyRepresentation(
266  $tax_id,
267  $taxonomy_data[$tax_id],
268  $check
269  );
270  }
271  return implode('', $taxonomies);
272  }
static getImagePath(string $image_name, string $module_path="", string $mode="output", bool $offline=false)
get image path (for images located in a template directory)
$check
Definition: buildRTE.php:81
singleTaxonomyRepresentation(int $tax_id, array $stored_tax_data, string $check_marker)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ toNestedList()

ILIAS\TestQuestionPool\Questions\Presentation\QuestionTable::toNestedList ( array  $nodes)
private

Definition at line 187 of file QuestionTable.php.

Referenced by ILIAS\TestQuestionPool\Questions\Presentation\QuestionTable\singleTaxonomyRepresentation().

187  : string
188  {
189  $entries = [];
190  foreach ($nodes as $k => $n) {
191  if ($n === []) {
192  $entries[] = $k;
193  } else {
194  $entries[] = $k . $this->toNestedList($n);
195  }
196  }
197  return $this->ui_renderer->render(
198  $this->ui_factory->listing()->unordered($entries)
199  );
200  }
+ Here is the caller graph for this function:

◆ treeify()

ILIAS\TestQuestionPool\Questions\Presentation\QuestionTable::treeify ( $pointer,
  $stack 
)
private

Definition at line 175 of file QuestionTable.php.

Referenced by ILIAS\TestQuestionPool\Questions\Presentation\QuestionTable\singleTaxonomyRepresentation().

176  {
177  $hop = array_shift($stack);
178  if (!$hop) {
179  return;
180  }
181  if (! array_key_exists($hop, $pointer)) {
182  $pointer[$hop] = [];
183  }
184  $this->treeify($pointer[$hop], $stack);
185  }
+ Here is the caller graph for this function:

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