133 : array
134 {
135 $usage_type = (string) (
$usage[
"type"] ??
"");
136 $container_type = "";
137 if (str_contains($usage_type, ":")) {
138 [$container_type, $usage_type] = explode(":", $usage_type, 2);
139 }
140
141 $item = [
142 "type" => "",
143 "title" => "",
144 "sub_txt" => "",
145 "sub_title" => "",
146 "link" => ""
147 ];
148
149 switch ($usage_type) {
150 case "pg":
153 break;
154 }
155 switch ($container_type) {
156 case "lm":
158 $learning_module = new \ilObjLearningModule(
$page->getParentId(),
false);
159 $item["type"] = $this->domain->lng()->txt("obj_" . $container_type);
160 $item["title"] = $learning_module->getTitle();
161 $item["sub_txt"] = $this->domain->lng()->txt("pg");
164 if ($ref_id > 0) {
166 null,
167 "pg",
168 true,
169 $page->getId() .
"_" . $ref_id
170 );
171 }
172 }
173 break;
174
175 case "wpg":
176 $item["type"] = $this->domain->lng()->txt("obj_wiki");
178 $item["sub_txt"] = $this->domain->lng()->txt("pg");
181 if ($ref_id > 0) {
183 }
184 break;
185
186 case "term":
187 $term_id =
$page->getId();
189 $item["type"] = $this->domain->lng()->txt("obj_glo");
191 $item["sub_txt"] = $this->domain->lng()->txt("cont_term");
194 if ($ref_id > 0) {
196 }
197 break;
198
199 case "cont":
201 $item["type"] = $this->domain->lng()->txt("obj_" . $object_type);
204 if ($ref_id > 0) {
206 }
207 break;
208
209 case "mep":
210 $item["type"] = $this->domain->lng()->txt("mep_page_type_mep");
211 $item["sub_txt"] = $this->domain->lng()->txt("mep_page_type_mep");
216 foreach ($ref_ids as $ref_id) {
218 break;
219 }
220 break;
221 }
222 break;
223
224 default:
226 if ($object_id > 0) {
228 $item["type"] = $this->domain->lng()->txt("obj_" . $object_type);
231 if ($ref_id > 0) {
233 }
234 }
235 break;
236 }
237
238 if ((
$usage[
"trash"] ??
false) ===
true) {
239 $item["title"] .= " (" . $this->domain->lng()->txt("trash") . ")";
240 }
241 break;
242
243 case "mep":
244 $item["type"] = $this->domain->lng()->txt("obj_mep");
247 if ($ref_id > 0) {
249 }
250 break;
251
252 case "map":
253 $item["type"] = $this->domain->lng()->txt("obj_mob");
255 $item["sub_txt"] = $this->domain->lng()->txt("cont_link_area");
256 break;
257
258 case "news":
261 $item["type"] = $this->domain->lng()->txt("obj_" . $object_type);
263 $item["sub_txt"] = $this->domain->lng()->txt("news");
265 if ($ref_id > 0) {
267 }
268 break;
269 }
270
271 $title = $item["title"];
272 if ($item["sub_txt"] !== "") {
273 $title .= ", " . $item["sub_txt"];
274 if ($item["sub_title"] !== "") {
275 $title .= ": " . $item["sub_title"];
276 }
277 }
278
279 if ($usage_type === "clip") {
280 $title = $this->domain->lng()->txt("cont_users_have_mob_in_clip1") .
282 $this->domain->lng()->txt("cont_users_have_mob_in_clip2");
283 }
284
285 return [
287 "object" => $title,
288 "object_link" => $item["link"],
289 "type" => $item["type"],
291 ];
292 }
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
static _lookGlossaryTerm(int $term_id)
get glossary term
static _lookGlossaryID(int $term_id)
get glossary id form term id
static _lookupTitle(int $a_obj_id)
static _getStaticLink(?int $a_ref_id, string $a_type='', bool $a_fallback_goto=true, string $append="")
static _lookupContextObjId(int $a_news_id)
Context Object ID.
static _lookupType(int $id, bool $reference=false)
static _getAllReferences(int $id)
get all reference ids for object ID
static _lookupTitle(int $obj_id)
Class ilPageObject Handles PageObjects of ILIAS Learning Modules (see ILIAS DTD)
static lookupTitle(int $a_page_id, string $lang="-")
foreach(array_slice($argv, 1) as $argument) $usage