ILIAS  release_8 Revision v8.24
class.ilRatingGUI.php
Go to the documentation of this file.
1<?php
2
26{
27 protected ilLanguage$lng;
28 protected ilCtrl $ctrl;
29 protected ilObjUser $user;
30 protected string $id = "rtg_";
32 protected string $export_subobj_title = "";
33 protected array $ctrl_path = [];
34 protected bool $enable_categories = false;
35 protected string $your_rating_text = "";
36 protected \ILIAS\DI\UIServices $ui;
37
38 protected int $obj_id;
39 protected string $obj_type;
40 protected ?int $sub_obj_id;
41 protected ?string $sub_obj_type;
42 protected int $userid;
43 protected $update_callback = null;
44 protected ?array $requested_ratings = null;
45 protected int $requested_rating;
46
47 public function __construct()
48 {
49 global $DIC;
50
51 $this->lng = $DIC->language();
52 $this->ctrl = $DIC->ctrl();
53 $this->user = $DIC->user();
54 $lng = $DIC->language();
55
56 $this->ui = $DIC->ui();
57
58 $params = $DIC->http()->request()->getQueryParams();
59 $body = $DIC->http()->request()->getParsedBody();
60
61 if (isset($body['rating'])) {
62 if (is_array($body['rating'])) {
63 $this->requested_ratings = ($body['rating'] ?? null);
64 } else {
65 $this->requested_rating = (int) ($body['rating'] ?? 0);
66 }
67 } else {
68 $this->requested_rating = (int) ($params['rating'] ?? 0);
69 }
70
71 $lng->loadLanguageModule("rating");
72 }
73
77 public function executeCommand(): void
78 {
79 $ilCtrl = $this->ctrl;
80
81 $next_class = $ilCtrl->getNextClass($this);
82 $cmd = $ilCtrl->getCmd();
83
84 switch ($next_class) {
85 case "ilratingcategorygui":
86 $gui = new ilRatingCategoryGUI($this->obj_id, $this->export_callback, $this->export_subobj_title);
87 $ilCtrl->forwardCommand($gui);
88 break;
89
90 default:
91 $this->$cmd();
92 break;
93 }
94 }
95
96 public function getUnsafeGetCommands(): array
97 {
98 return ['saveRating'];
99 }
100
101 public function getSafePostCommands(): array
102 {
103 return [];
104 }
105
114 public function setObject(
115 int $a_obj_id,
116 string $a_obj_type,
117 ?int $a_sub_obj_id = 0,
118 ?string $a_sub_obj_type = ""
119 ): void {
120 $ilUser = $this->user;
121
122 if (!trim($a_sub_obj_type)) {
123 $a_sub_obj_type = "-";
124 }
125
126 $this->obj_id = $a_obj_id;
127 $this->obj_type = $a_obj_type;
128 $this->sub_obj_id = $a_sub_obj_id;
129 $this->sub_obj_type = $a_sub_obj_type;
130 $this->id = "rtg_" . $this->obj_id . "_" . $this->obj_type . "_" . $this->sub_obj_id . "_" .
132
133 $this->setUserId($ilUser->getId());
134 }
135
136 public function setUserId(int $a_userid): void
137 {
138 $this->userid = $a_userid;
139 }
140
141 public function getUserId(): int
142 {
143 return $this->userid;
144 }
145
146 public function setYourRatingText(string $a_val): void
147 {
148 $this->your_rating_text = $a_val;
149 }
150
151 public function getYourRatingText(): string
152 {
153 return $this->your_rating_text;
154 }
155
156 public function enableCategories(bool $a_value): void
157 {
158 $this->enable_categories = $a_value;
159 }
160
161 public function setCtrlPath(array $a_value): void
162 {
163 $this->ctrl_path = $a_value;
164 }
165
166 // Render rating details
167 protected function renderDetails(
168 string $a_js_id,
169 bool $a_may_rate,
170 array $a_categories = null,
171 string $a_onclick = null,
172 bool $a_average = false,
173 bool $add_tooltip = false
174 ): string {
175 $lng = $this->lng;
176 $ilCtrl = $this->ctrl;
177
178 $ttpl = new ilTemplate("tpl.rating_details.html", true, true, "Services/Rating");
179
180 $rate_text = null;
181 if ($this->getYourRatingText() != "#") {
182 $rate_text = ($this->getYourRatingText() != "")
183 ? $this->getYourRatingText()
184 : $lng->txt("rating_your_rating");
185 }
186
187 // no categories: 1 simple rating (link)
188 if (!$a_categories) {
189 if ($a_may_rate) {
191 $this->obj_id,
192 $this->obj_type,
193 $this->sub_obj_id,
194 $this->sub_obj_type,
195 $this->getUserId(),
196 0
197 );
198 $overall_rating = [
199 "avg" => 0,
200 "cnt" => 0
201 ];
202 if ($a_average) {
203 $overall_rating = ilRating::getOverallRatingForObject(
204 $this->obj_id,
205 $this->obj_type,
206 $this->sub_obj_id,
207 $this->sub_obj_type
208 );
209 }
210
211 // user rating links
212 for ($i = 1; $i <= 5; $i++) {
213 if ($a_average &&
214 $i == $rating) {
215 $ttpl->setCurrentBlock("rating_mark_simple");
216 $ttpl->setVariable(
217 "SRC_MARK_SIMPLE",
218 ilUtil::getImagePath("icon_rate_marker.svg")
219 );
220 $ttpl->parseCurrentBlock();
221 }
222
223 $ttpl->setCurrentBlock("rating_link_simple");
224 if (stristr($a_onclick, "%rating%")) {
225 $url_save = "#";
226 } else {
227 $ilCtrl->setParameter($this, "rating", $i);
228 if (!$this->ctrl_path) {
229 $url_save = $ilCtrl->getLinkTarget($this, "saveRating");
230 } else {
231 $url_save = $ilCtrl->getLinkTargetByClass($this->ctrl_path, "saveRating");
232 }
233 }
234 $ttpl->setVariable("HREF_RATING", $url_save);
235
236 if ($a_onclick) {
237 $onclick = str_replace("%rating%", $i, $a_onclick);
238 $ttpl->setVariable("ONCLICK_RATING", ' onclick="' . $onclick . '"');
239 }
240
241 if ($a_average) {
242 $ref_rating = $overall_rating["avg"];
243 } else {
244 $ref_rating = $rating;
245 }
246
247 if ($ref_rating >= $i) {
248 $ttpl->setVariable(
249 "SRC_ICON",
250 ilUtil::getImagePath("icon_rate_on.svg")
251 );
252 } else {
253 $ttpl->setVariable(
254 "SRC_ICON",
255 ilUtil::getImagePath("icon_rate_off.svg")
256 );
257 }
258 $ttpl->setVariable(
259 "ALT_ICON",
260 sprintf($lng->txt("rating_rate_x_of_5"), $i)
261 );
262 $ttpl->parseCurrentBlock();
263 }
264
265 // remove
266 if ($rating) {
267 $ttpl->setCurrentBlock("rating_simple_del_bl");
268 $ttpl->setVariable("CAPTION_RATING_DEL", $lng->txt("rating_remove"));
269
270 if (stristr($a_onclick, "%rating%")) {
271 $url_save = "#";
272 } else {
273 $ilCtrl->setParameter($this, "rating", 0);
274 if (!$this->ctrl_path) {
275 $url_save = $ilCtrl->getLinkTarget($this, "saveRating");
276 } else {
277 $url_save = $ilCtrl->getLinkTargetByClass($this->ctrl_path, "saveRating");
278 }
279 }
280 $ttpl->setVariable("HREF_RATING_DEL", $url_save);
281
282 if ($a_onclick) {
283 $onclick = str_replace("%rating%", 0, $a_onclick);
284 $ttpl->setVariable("ONCLICK_RATING_DEL", ' onclick="' . $onclick . '"');
285 }
286
287 $ttpl->parseCurrentBlock();
288 }
289
290 if ($rate_text) {
291 $ttpl->setCurrentBlock("rating_simple_title");
292 $ttpl->setVariable("TXT_RATING_SIMPLE", $rate_text);
293 $ttpl->parseCurrentBlock();
294 }
295
296 if ($a_average &&
297 $overall_rating["cnt"]) {
298 $ttpl->setCurrentBlock("number_votes_simple");
299 $ttpl->setVariable("NUMBER_VOTES_SIMPLE", $overall_rating["cnt"]);
300 $ttpl->parseCurrentBlock();
301 }
302
303 if ($add_tooltip) {
304 $unique_id = $this->id . "_block";
305 $ttpl->setVariable("TTID", $unique_id);
306 $this->addTooltip(
307 $unique_id,
308 (int) ($overall_rating["cnt"] ?? 0),
309 (float) ($overall_rating["avg"] ?? 0),
310 (int) ($rating ?? 0)
311 );
312 }
313
314 // user rating text
315 $ttpl->setCurrentBlock("user_rating_simple");
316 $ttpl->parseCurrentBlock();
317 }
318 }
319 // categories: overall & user (form)
320 else {
321 $has_user_rating = false;
322 $overall_rating = [
323 "avg" => 0,
324 "cnt" => 0
325 ];
326 foreach ($a_categories as $category) {
327 $user_rating = round(ilRating::getRatingForUserAndObject(
328 $this->obj_id,
329 $this->obj_type,
330 $this->sub_obj_id,
331 $this->sub_obj_type,
332 $this->getUserId(),
333 $category["id"]
334 ));
335
336 $overall_rating = ilRating::getOverallRatingForObject(
337 $this->obj_id,
338 $this->obj_type,
339 $this->sub_obj_id,
340 $this->sub_obj_type,
341 $category["id"]
342 );
343
344 for ($i = 1; $i <= 5; $i++) {
345 if ($a_may_rate && $i == $user_rating) {
346 $has_user_rating = true;
347
348 $ttpl->setCurrentBlock("rating_mark");
349 $ttpl->setVariable(
350 "SRC_MARK",
351 ilUtil::getImagePath("icon_rate_marker.svg")
352 );
353 $ttpl->parseCurrentBlock();
354 }
355
356 $ttpl->setCurrentBlock("user_rating_icon");
357 if ($overall_rating["avg"] >= $i) {
358 $ttpl->setVariable(
359 "SRC_ICON",
360 ilUtil::getImagePath("icon_rate_on.svg")
361 );
362 } elseif ($overall_rating["avg"] + 1 <= $i) {
363 $ttpl->setVariable(
364 "SRC_ICON",
365 ilUtil::getImagePath("icon_rate_off.svg")
366 );
367 } else {
368 $nr = round(($overall_rating["avg"] + 1 - $i) * 10);
369 $ttpl->setVariable(
370 "SRC_ICON",
371 ilUtil::getImagePath("icon_rate_$nr.svg")
372 );
373 }
374 $ttpl->setVariable(
375 "ALT_ICON",
376 sprintf($lng->txt("rating_rate_x_of_5"), $i)
377 );
378
379 if ($a_may_rate) {
380 $ttpl->setVariable("HREF_RATING", "il.Rating.setValue(" . $category["id"] . "," . $i . ", '" . $a_js_id . "')");
381 $ttpl->setVariable("CATEGORY_ID", $category["id"]);
382 $ttpl->setVariable("ICON_VALUE", $i);
383 $ttpl->setVariable("JS_ID", $a_js_id);
384 $ttpl->setVariable("ICON_MOUSEACTION", " onmouseover=\"il.Rating.toggleIcon(this," . $i . ")\"" .
385 " onmouseout=\"il.Rating.toggleIcon(this," . $i . ",1)\"");
386 }
387
388 $ttpl->parseCurrentBlock();
389 }
390
391 if ($a_may_rate) {
392 $ttpl->setCurrentBlock("user_rating_category_column");
393 $ttpl->setVariable("JS_ID", $a_js_id);
394 $ttpl->setVariable("CATEGORY_ID", $category["id"]);
395 $ttpl->setVariable("CATEGORY_VALUE", $user_rating);
396 if ($add_tooltip) {
397 $unique_id = $this->id . "_block_" . $category["id"];
398 $ttpl->setVariable("CAT_TTID", $unique_id);
399 $this->addTooltip(
400 $unique_id,
401 (int) ($overall_rating["cnt"] ?? 0),
402 (float) ($overall_rating["avg"] ?? 0),
403 (int) ($user_rating ?? 0)
404 );
405 }
406 $ttpl->parseCurrentBlock();
407 }
408
409
410 // category title
411 $ttpl->setCurrentBlock("user_rating_category");
412 $ttpl->setVariable("TXT_RATING_CATEGORY", $category["title"]);
413 $ttpl->parseCurrentBlock();
414 }
415
416 if ($overall_rating["cnt"] > 0) {
417 $ttpl->setCurrentBlock("votes_number_bl");
418 $ttpl->setVariable("NUMBER_VOTES", sprintf($lng->txt("rating_number_votes"), $overall_rating["cnt"]));
419 $ttpl->parseCurrentBlock();
420 }
421
422 if ($a_may_rate) {
423 // remove
424 if ($has_user_rating) {
425 $ttpl->setCurrentBlock("user_rating_categories_del_bl");
426 $ttpl->setVariable("CAPTION_RATING_DEL_CAT", $lng->txt("rating_remove"));
427
428 $ilCtrl->setParameter($this, "rating", 0);
429 if (!$this->ctrl_path) {
430 $url_save = $ilCtrl->getLinkTarget($this, "resetUserRating");
431 } else {
432 $url_save = $ilCtrl->getLinkTargetByClass($this->ctrl_path, "resetUserRating");
433 }
434 $ttpl->setVariable("HREF_RATING_DEL_CAT", $url_save);
435
436 $ttpl->parseCurrentBlock();
437 }
438
439 if (!$this->ctrl_path) {
440 $url_form = $ilCtrl->getFormAction($this, "saveRating");
441 } else {
442 $url_form = $ilCtrl->getFormActionByClass($this->ctrl_path, "saveRating");
443 }
444 $ttpl->setVariable("FORM_ACTION", $url_form);
445 $ttpl->setVariable("TXT_SUBMIT", $lng->txt("rating_overlay_submit"));
446 $ttpl->setVariable("CMD_SUBMIT", "saveRating");
447 $ttpl->touchBlock("user_rating_categories_form_out");
448 }
449 }
450
451 return $ttpl->get();
452 }
453
454 // Get HTML for rating of an object (and a user)
455 public function getHTML(
456 bool $a_show_overall = true,
457 bool $a_may_rate = true,
458 string $a_onclick = null,
459 string $a_additional_id = null
460 ): string {
461 $lng = $this->lng;
462 $unique_id = $this->id;
463 if ($a_additional_id) {
464 $unique_id .= "_" . $a_additional_id;
465 }
466
467 $categories = array();
468 if ($this->enable_categories) {
469 $categories = ilRatingCategory::getAllForObject($this->obj_id);
470 }
471
472 $may_rate = ($this->getUserId() != ANONYMOUS_USER_ID);
473 if ($may_rate && !$a_may_rate) {
474 $may_rate = false;
475 }
476
477 $has_overlay = false;
478 if ($may_rate || $categories) {
479 $has_overlay = true;
480 }
481
482 $ttpl = new ilTemplate("tpl.rating_input.html", true, true, "Services/Rating");
483
484 // user rating
485 $user_rating = 0;
486 if ($may_rate || !$a_show_overall) {
487 $user_rating = round(ilRating::getRatingForUserAndObject(
488 $this->obj_id,
489 $this->obj_type,
490 $this->sub_obj_id,
491 $this->sub_obj_type,
492 $this->getUserId()
493 ));
494 }
495
496 // (1) overall rating
497 if ($a_show_overall) {
499 $this->obj_id,
500 $this->obj_type,
501 $this->sub_obj_id,
502 $this->sub_obj_type
503 );
504 } else {
505 $rating = array("avg" => $user_rating);
506 }
507
508 for ($i = 1; $i <= 5; $i++) {
509 if ($a_show_overall &&
510 $i == $user_rating) {
511 $ttpl->setCurrentBlock("rating_mark");
512 $ttpl->setVariable(
513 "SRC_MARK",
514 ilUtil::getImagePath("icon_rate_marker.svg")
515 );
516 $ttpl->parseCurrentBlock();
517 }
518
519 $ttpl->setCurrentBlock("rating_icon");
520 if ($rating["avg"] >= $i) {
521 $ttpl->setVariable(
522 "SRC_ICON",
523 ilUtil::getImagePath("icon_rate_on.svg")
524 );
525 } elseif ($rating["avg"] + 1 <= $i) {
526 $ttpl->setVariable(
527 "SRC_ICON",
528 ilUtil::getImagePath("icon_rate_off.svg")
529 );
530 } else {
531 $nr = round(($rating["avg"] + 1 - $i) * 10);
532 $ttpl->setVariable(
533 "SRC_ICON",
534 ilUtil::getImagePath("icon_rate_$nr.svg")
535 );
536 }
537 $ttpl->setVariable("ALT_ICON", "");
538 $ttpl->parseCurrentBlock();
539 }
540 $ttpl->setCurrentBlock("rating_icon");
541
542 if ($a_show_overall) {
543 if ($rating["cnt"] > 0) {
544 $ttpl->setCurrentBlock("rat_nr");
545 $ttpl->setVariable("RT_NR", $rating["cnt"]);
546 $ttpl->parseCurrentBlock();
547 }
548 }
549
550 $this->addTooltip(
551 $unique_id . "_tt",
552 (int) ($rating["cnt"] ?? 0),
553 (float) ($rating["avg"] ?? 0),
554 (int) ($user_rating ?? 0)
555 );
556
557 // add overlay (trigger)
558 if ($has_overlay) {
559 $ov = new ilOverlayGUI($unique_id);
560 $ov->setTrigger("tr_" . $unique_id, "click", "tr_" . $unique_id);
561 $ov->add();
562
563 $ttpl->setCurrentBlock("act_rat_start");
564 $ttpl->setVariable("ID", $unique_id);
565 $ttpl->setVariable("TXT_OPEN_DIALOG", $lng->txt("rating_open_dialog"));
566 $ttpl->parseCurrentBlock();
567
568 $ttpl->touchBlock("act_rat_end");
569 }
570
571 $ttpl->parseCurrentBlock();
572
573
574 // (2) user rating
575
576 if ($has_overlay) {
577 $ttpl->setVariable(
578 "RATING_DETAILS",
579 $this->renderDetails("rtov_", $may_rate, $categories, $a_onclick)
580 );
581
582 $ttpl->setCurrentBlock("user_rating");
583 $ttpl->setVariable("ID", $unique_id);
584 $ttpl->parseCurrentBlock();
585 }
586
587 $ttpl->setVariable("TTID", $unique_id);
588
589 return $ttpl->get();
590 }
591
592 protected function addTooltip(
593 string $id,
594 int $cnt = 0,
595 float $avg = 0,
596 int $user = 0
597 ): void {
598 $lng = $this->lng;
599
600 $tt = "";
601 if ($cnt == 0) {
602 $tt = $lng->txt("rat_not_rated_yet");
603 } else {
604 if ($cnt == 1) {
605 $tt = $lng->txt("rat_one_rating");
606 } else {
607 $tt = sprintf($lng->txt("rat_nr_ratings"), $cnt);
608 }
609 $tt .= "<br>" . $lng->txt("rating_avg_rating") . ": " . round($avg, 1);
610 }
611
612 if ($user > 0) {
613 $tt .= "<br>" . $lng->txt("rating_personal_rating") . ": " . $user;
614 }
615 if ($tt !== "") {
617 $id,
618 $tt,
619 "",
620 "bottom center",
621 "top center",
622 false
623 );
624 }
625 }
626
627 public function getBlockHTML(string $a_title): string
628 {
629 $ui = $this->ui;
630
631 $categories = array();
632 if ($this->enable_categories) {
633 $categories = ilRatingCategory::getAllForObject($this->obj_id);
634 }
635
636 $may_rate = ($this->getUserId() != ANONYMOUS_USER_ID);
637
638
639 $panel = $ui->factory()->panel()->secondary()->legacy(
640 $a_title,
641 $ui->factory()->legacy(
642 $this->renderDetails("rtsb_", $may_rate, $categories, null, true, true)
643 )
644 );
645
646 return $ui->renderer()->render($panel);
647 }
648
652 public function saveRating(): void
653 {
654 $ilCtrl = $this->ctrl;
655
656 if (!is_array($this->requested_ratings)) {
657 $rating = $this->requested_rating;
658 if ($rating == 0) {
659 $this->resetUserRating();
660 } else {
662 $this->obj_id,
663 $this->obj_type,
664 $this->sub_obj_id,
665 $this->sub_obj_type,
666 $this->getUserId(),
667 $rating
668 );
669 }
670 } else {
671 foreach ($this->requested_ratings as $cat_id => $rating) {
673 $this->obj_id,
674 $this->obj_type,
675 $this->sub_obj_id,
676 $this->sub_obj_type,
677 $this->getUserId(),
678 $rating,
679 $cat_id
680 );
681 }
682 }
683
684 if ($this->update_callback) {
685 call_user_func(
686 $this->update_callback,
687 $this->obj_id,
688 $this->obj_type,
689 $this->sub_obj_id,
690 $this->sub_obj_type
691 );
692 }
693
694 if ($ilCtrl->isAsynch()) {
695 exit();
696 }
697 }
698
699 public function setUpdateCallback($a_callback): void
700 {
701 $this->update_callback = $a_callback;
702 }
703
704 public function resetUserRating(): void
705 {
707 $this->obj_id,
708 $this->obj_type,
709 (int) $this->sub_obj_id,
710 $this->sub_obj_type,
711 $this->getUserId()
712 );
713 }
714
715 public function setExportCallback($a_callback, string $a_subobj_title): void
716 {
717 $this->export_callback = $a_callback;
718 $this->export_subobj_title = $a_subobj_title;
719 }
720
721 // Build list gui property for object
722 public function getListGUIProperty(
723 int $a_ref_id,
724 bool $a_may_rate,
725 string $a_ajax_hash,
726 int $parent_ref_id
727 ): string {
728 return $this->getHTML(
729 true,
730 $a_may_rate,
731 "il.Object.saveRatingFromListGUI(" . $a_ref_id . ", '" . $a_ajax_hash . "', %rating%);",
732 $parent_ref_id
733 );
734 }
735}
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
Definition: plugin.php:23
return true
Class ilCtrl provides processing control methods.
getNextClass($a_gui_class=null)
@inheritDoc
User class.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Class ilRatingCategoryGUI.
static getAllForObject(int $a_parent_obj_id)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
setObject(int $a_obj_id, string $a_obj_type, ?int $a_sub_obj_id=0, ?string $a_sub_obj_type="")
Set Object.
getUnsafeGetCommands()
This method must return a list of unsafe GET commands.
string $your_rating_text
setUserId(int $a_userid)
setCtrlPath(array $a_value)
getBlockHTML(string $a_title)
executeCommand()
execute command
getSafePostCommands()
This method must return a list of safe POST commands.
setUpdateCallback($a_callback)
setYourRatingText(string $a_val)
getListGUIProperty(int $a_ref_id, bool $a_may_rate, string $a_ajax_hash, int $parent_ref_id)
saveRating()
Save Rating.
ILIAS DI UIServices $ui
renderDetails(string $a_js_id, bool $a_may_rate, array $a_categories=null, string $a_onclick=null, bool $a_average=false, bool $add_tooltip=false)
setExportCallback($a_callback, string $a_subobj_title)
enableCategories(bool $a_value)
array $requested_ratings
addTooltip(string $id, int $cnt=0, float $avg=0, int $user=0)
getHTML(bool $a_show_overall=true, bool $a_may_rate=true, string $a_onclick=null, string $a_additional_id=null)
string $export_subobj_title
static getRatingForUserAndObject(int $a_obj_id, string $a_obj_type, int $a_sub_obj_id, string $a_sub_obj_type, int $a_user_id, int $a_category_id=null)
Get rating for a user and an object.
static getOverallRatingForObject(int $a_obj_id, string $a_obj_type, int $a_sub_obj_id=null, string $a_sub_obj_type=null, int $a_category_id=null)
Get overall rating for an object.
static resetRatingForUserAndObject(int $a_obj_id, string $a_obj_type, int $a_sub_obj_id, string $a_sub_obj_type, int $a_user_id)
Reset rating for a user and an object.
static writeRatingForUserAndObject(int $a_obj_id, string $a_obj_type, ?int $a_sub_obj_id, ?string $a_sub_obj_type, int $a_user_id, int $a_rating, int $a_category_id=0)
Write rating for a user and an object.
special template class to simplify handling of ITX/PEAR
static addTooltip(string $a_el_id, string $a_text, string $a_container="", string $a_my="bottom center", string $a_at="top center", bool $a_use_htmlspecialchars=true)
static getImagePath(string $img, string $module_path="", string $mode="output", bool $offline=false)
get image path (for images located in a template directory)
const ANONYMOUS_USER_ID
Definition: constants.php:27
return['3gp', '7z', 'ai', 'aif', 'aifc', 'aiff', 'au', 'arw', 'avi', 'backup', 'bak', 'bas', 'bpmn', 'bpmn2', 'bmp', 'bib', 'bibtex', 'bz', 'bz2', 'c', 'c++', 'cc', 'cct', 'cdf', 'cer', 'class', 'cls', 'conf', 'cpp', 'crt', 'crs', 'crw', 'cr2', 'css', 'cst', 'csv', 'cur', 'db', 'dcr', 'des', 'dng', 'doc', 'docx', 'dot', 'dotx', 'dtd', 'dvi', 'el', 'eps', 'epub', 'f', 'f77', 'f90', 'flv', 'for', 'g3', 'gif', 'gl', 'gan', 'ggb', 'gsd', 'gsm', 'gtar', 'gz', 'gzip', 'h', 'hpp', 'htm', 'html', 'htmls', 'ibooks', 'ico', 'ics', 'ini', 'ipynb', 'java', 'jbf', 'jpeg', 'jpg', 'js', 'jsf', 'jso', 'json', 'latex', 'lang', 'less', 'log', 'lsp', 'ltx', 'm1v', 'm2a', 'm2v', 'm3u', 'm4a', 'm4v', 'markdown', 'm', 'mat', 'md', 'mdl', 'mdown', 'mid', 'min', 'midi', 'mobi', 'mod', 'mov', 'movie', 'mp2', 'mp3', 'mp4', 'mpa', 'mpeg', 'mpg', 'mph', 'mpga', 'mpp', 'mpt', 'mpv', 'mpx', 'mv', 'mw', 'mv4', 'nb', 'nbp', 'nef', 'nif', 'niff', 'obj', 'obm', 'odt', 'ods', 'odp', 'odg', 'odf', 'oga', 'ogg', 'ogv', 'old', 'p', 'pas', 'pbm', 'pcl', 'pct', 'pcx', 'pdf', 'pgm', 'pic', 'pict', 'png', 'por', 'pov', 'project', 'properties', 'ppa', 'ppm', 'pps', 'ppsx', 'ppt', 'pptx', 'ppz', 'ps', 'psd', 'pwz', 'qt', 'qtc', 'qti', 'qtif', 'r', 'ra', 'ram', 'rar', 'rast', 'rda', 'rev', 'rexx', 'ris', 'rf', 'rgb', 'rm', 'rmd', 'rmi', 'rmm', 'rmp', 'rt', 'rtf', 'rtx', 'rv', 's', 's3m', 'sav', 'sbs', 'sec', 'sdml', 'sgm', 'sgml', 'smi', 'smil', 'srt', 'sps', 'spv', 'stl', 'svg', 'swa', 'swf', 'swz', 'tar', 'tex', 'texi', 'texinfo', 'text', 'tgz', 'tif', 'tiff', 'ttf', 'txt', 'tmp', 'uvproj', 'vdf', 'vimeo', 'viv', 'vivo', 'vrml', 'vsdx', 'wav', 'webm', 'wmv', 'wmx', 'wmz', 'woff', 'wwd', 'xhtml', 'xif', 'xls', 'xlsx', 'xmind', 'xml', 'xsl', 'xsd', 'zip']
global $DIC
Definition: feed.php:28
if(isset($_FILES['img_file']) &&is_array($_FILES['img_file'])) $panel
Definition: imgupload.php:198
$ilUser
Definition: imgupload.php:34
Interface ilCtrlSecurityInterface provides ilCtrl security information.
exit
Definition: login.php:28
if(! $DIC->user() ->getId()||!ilLTIConsumerAccess::hasCustomProviderCreationAccess()) $params
Definition: ltiregstart.php:33
$i
Definition: metadata.php:41
$lng