135 : array
136 {
137 $usage_type = (string) (
$usage[
"type"] ??
"");
138 $container_type = "";
139 if (str_contains($usage_type, ":")) {
140 [$container_type, $usage_type] = explode(":", $usage_type, 2);
141 }
142
143 $item = [
144 "type" => "",
145 "title" => "",
146 "sub_txt" => "",
147 "sub_title" => "",
148 "link" => ""
149 ];
150
151 switch ($usage_type) {
152 case "pg":
155 break;
156 }
157
158 switch ($container_type) {
159 case "lm":
160 $lm_obj = new \ilObjLearningModule(
$page->getParentId(),
false);
161 $item["type"] = $this->domain->lng()->txt("obj_" . $container_type);
162 $item["title"] = $lm_obj->getTitle();
163 $item["sub_txt"] = $this->domain->lng()->txt("pg");
166 if ($ref_id > 0) {
167 $item["link"] = \ilLink::_getLink(
168 null,
169 "pg",
170 [],
171 $page->getId() .
"_" . $ref_id
172 );
173 }
174 break;
175
176 case "wpg":
177 $item["type"] = $this->domain->lng()->txt("obj_wiki");
179 $item["sub_txt"] = $this->domain->lng()->txt("pg");
182 if ($ref_id > 0) {
184 }
185 break;
186
187 case "term":
188 $term_id =
$page->getId();
190 $item["type"] = $this->domain->lng()->txt("obj_glo");
192 $item["sub_txt"] = $this->domain->lng()->txt("cont_term");
195 if ($ref_id > 0) {
197 }
198 break;
199
200 case "cont":
202 $item["type"] = $this->domain->lng()->txt("obj_" . $object_type);
205 if ($ref_id > 0) {
207 }
208 break;
209
210 case "copa":
211 $item["type"] = $this->domain->lng()->txt("obj_" . $container_type);
214 if ($ref_id > 0) {
216 }
217 break;
218 }
219
220 if ((
$usage[
"trash"] ??
false) ===
true) {
221 $item["title"] .= " (" . $this->domain->lng()->txt("trash") . ")";
222 }
223 break;
224
225 case "mep":
226 $item["type"] = $this->domain->lng()->txt("obj_mep");
229 if ($ref_id > 0) {
231 }
232 break;
233
234 case "map":
235 $item["type"] = $this->domain->lng()->txt("obj_mob");
237 $item["sub_txt"] = $this->domain->lng()->txt("cont_link_area");
238 break;
239 }
240
241 $title = $item["title"];
242 if ($item["sub_txt"] !== "") {
243 $title .= ", " . $item["sub_txt"];
244 if ($item["sub_title"] !== "") {
245 $title .= ": " . $item["sub_title"];
246 }
247 }
248
249 if ($usage_type === "clip") {
250 $title = $this->domain->lng()->txt("cont_users_have_mob_in_clip1") .
252 $this->domain->lng()->txt("cont_users_have_mob_in_clip2");
253 }
254
255 return [
257 "object" => $title,
258 "object_link" => $item["link"],
259 "type" => $item["type"],
261 ];
262 }
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
buildVersions(array $usage)
getFirstWritableRefId(int $object_id)
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 _lookupType(int $id, bool $reference=false)
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