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
164 string $target_class_type
166 $ref_id = $this->getFirstReferenceWithCurrentUserAccess(
167 \
ilObject::_getAllReferences($obj_id)
171 return $this->ui_factory->link()->standard(
172 "{$title} ({$this->lng->txt('status_no_permission')})",
177 return $this->getLinkedTitle(
$ref_id, $title, $target_class_type);
183 string $target_class_type
185 $this->
ctrl->setParameterByClass($target_class_type,
'ref_id',
$ref_id);
186 $linked_title = $this->ui_factory->link()->standard(
188 $this->
ctrl->getLinkTargetByClass(
192 $this->
ctrl->clearParametersByClass($target_class_type);
193 return $linked_title;
199 $references_with_access = array_filter(
200 array_values($all_ref_ids),
205 if ($references_with_access !== []) {
206 return array_shift($references_with_access);
Builds a Color from either hex- or rgb values.
buildPossiblyLinkedTitle(int $obj_id, string $title, string $target_class_type)
getFirstReferenceWithCurrentUserAccess(array $all_ref_ids)
__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)
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)
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'))