19declare(strict_types=1);
34 private readonly \
ilCtrl $ctrl,
38 private readonly UIFactory $ui_factory,
47 $question_title = $this->properties_repository->getForQuestionId($question_id)?->
getTitle();
49 if ($question_title ===
null) {
50 return $this->ui_factory->link()->standard(
51 "{$this->lng->txt('deleted')} ({$this->lng->txt('id')}: {$question_id})",
56 return $this->ui_factory->link()->standard(
57 $this->
refinery->encode()->htmlSpecialCharsAsEntities()->transform(
58 $this->properties_repository->getForQuestionId($question_id)?->getTitle()
60 $this->static_url->builder()->build(
71 if ($question_id === null) {
74 $question_title = $this->properties_repository->getForQuestionId($question_id)?->getTitle();
76 if ($question_title ===
null) {
77 return "{$this->lng->txt('deleted')} ({$this->lng->txt('id')}: {$question_id})";
80 return $this->
refinery->encode()->htmlSpecialCharsAsEntities()->transform($question_title);
86 if ($test_obj_id === 0) {
87 return $this->ui_factory->link()->standard(
88 "{$this->lng->txt('deleted')} ({$this->lng->txt('id')}: {$test_ref_id})",
94 return $this->ui_factory->link()->standard(
95 "{$this->lng->txt('in_trash')} ({$this->lng->txt('title')}: "
101 return $this->ui_factory->link()->standard(
103 $this->static_url->builder()->build(
'tst',
new ReferenceId($test_ref_id))->__toString()
110 if ($test_obj_id === 0) {
111 return "{$this->lng->txt('deleted')} ({$this->lng->txt('id')}: {$test_ref_id})";
114 return \ilObject::_lookupTitle($test_obj_id);
123 return $this->buildPossiblyLinkedTitle(
132 ?
string $title =
null,
133 bool $reference =
false
135 if ($qpl_id === null) {
136 return $this->ui_factory->link()->standard(
137 $title ?? $this->
lng->txt(
'tst_question_not_from_pool_info'),
143 return $this->ui_factory->link()->standard(
144 $this->
lng->txt(
'tst_question_not_from_pool_info'),
149 $qpl_obj_id = $qpl_id;
154 return $this->buildPossiblyLinkedTitle(
157 \ilObjQuestionPoolGUI::class,
165 string $target_class_type,
166 bool $reference =
false
168 $ref_id = $this->getFirstReferenceWithCurrentUserAccess(
171 \
ilObject::_getAllReferences($obj_id)
175 return $this->ui_factory->link()->standard(
176 "{$title} ({$this->lng->txt('status_no_permission')})",
181 return $this->getLinkedTitle(
$ref_id, $title, $target_class_type);
187 string $target_class_type
189 $this->
ctrl->setParameterByClass($target_class_type,
'ref_id',
$ref_id);
190 $linked_title = $this->ui_factory->link()->standard(
192 $this->
ctrl->getLinkTargetByClass(
196 $this->
ctrl->clearParametersByClass($target_class_type);
197 return $linked_title;
205 if ($reference && $this->
access->checkAccess(
'read',
'', $obj_id)) {
209 $references_with_access = array_filter(
210 array_values($all_ref_ids),
212 return $this->
access->checkAccess(
'read',
'', $ref_id);
215 if ($references_with_access !== []) {
216 return array_shift($references_with_access);
Builds a Color from either hex- or rgb values.
__construct(private readonly GeneralQuestionPropertiesRepository $properties_repository, private readonly \ilCtrl $ctrl, private readonly \ilAccessHandler $access, private readonly \ilLanguage $lng, private readonly StaticURLServices $static_url, private readonly UIFactory $ui_factory, private readonly Refinery $refinery)
buildTestTitleAsText(int $test_ref_id)
buildPossiblyLinkedTitle(int $obj_id, string $title, string $target_class_type, bool $reference=false)
buildAccessCheckedTestTitleAsLinkForObjId(int $test_obj_id, string $title)
buildTestTitleAsLink(int $test_ref_id)
buildAccessCheckedQuestionpoolTitleAsLink(?int $qpl_id, ?string $title=null, bool $reference=false)
buildQuestionTitleAsLink(int $question_id, int $test_ref_id)
getFirstReferenceWithCurrentUserAccess(bool $reference, int $obj_id, array $all_ref_ids)
buildQuestionTitleAsText(?int $question_id)
getLinkedTitle(int $ref_id, string $title, string $target_class_type)
Class ilCtrl provides processing control methods.
Class ilObject Basic functions for all objects.
static _lookupType(int $id, bool $reference=false)
static _isInTrash(int $ref_id)
static _lookupObjId(int $ref_id)
static _lookupTitle(int $obj_id)
return['delivery_method'=> 'php',]
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Interface ilAccessHandler This interface combines all available interfaces which can be called via gl...
if(!file_exists('../ilias.ini.php'))