ILIAS  release_10 Revision v10.1-43-ga1241a92c2f
ThumbsGUI.php
Go to the documentation of this file.
1 <?php
2 
19 declare(strict_types=1);
20 
22 
23 
26 
27 class ThumbsGUI
28 {
29 
31  protected \ILIAS\MediaObjects\MediaObjectManager $media_manager;
32 
33  public function __construct(
34  protected InternalDomainService $domain,
35  protected InternalGUIService $gui
36  ) {
37  $this->thumbs_manager = $this->domain->thumbs();
38  }
39 
40  public function getThumbHtml(int $mob_id) : string
41  {
42  $mob = new \ilObjMediaObject($mob_id);
43  $f = $this->gui->ui()->factory();
44  $r = $this->gui->ui()->renderer();
45  $im = $f->image()->responsive(
46  $this->thumbs_manager->getThumbSrc($mob_id),
47  $mob->getTitle()
48  );
49  return "<div class='ilMediaPoolPreviewThumbnail'>" .
50  $r->render($im) .
51  "</div>";
52  }
53 }
__construct(protected InternalDomainService $domain, protected InternalGUIService $gui)
Definition: ThumbsGUI.php:33
ILIAS MediaObjects MediaObjectManager $media_manager
Definition: ThumbsGUI.php:31
$r