ILIAS  trunk Revision v12.0_alpha-33-ge186251a14d
PageRetrieval.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
22
23use Generator;
24use ilCtrl;
28
30{
31 public function __construct(
32 protected int $obj_id,
33 protected ilCtrl $ctrl
34 ) {
35 }
36
40 public function getPossibleTypes(): Generator
41 {
42 yield 'lm:pg';
43 }
44
48 public function getAllIDsForType(string $type): Generator
49 {
50 if ($type !== 'lm:pg') {
51 return;
52 }
53 foreach (ilLMPageObject::getPageList($this->obj_id) as $page) {
54 yield (int) $page['obj_id'];
55 }
56 }
57
58 public function getLinkToSubObject(string $type, int $id): string
59 {
60 if ($type !== 'lm:pg') {
61 return '';
62 }
63 $this->ctrl->setParameterByClass(ilLMPageObjectGUI::class, 'obj_id', $id);
64 $link = $this->ctrl->getLinkTargetByClass(ilLMPageObjectGUI::class, 'edit');
65 $this->ctrl->clearParameterByClass(ilLMPageObjectGUI::class, 'obj_id');
66 return $link;
67 }
68
69 public function getTitleOfSubObject(string $type, int $id): string
70 {
71 if ($type !== 'lm:pg') {
72 return '';
73 }
75 }
76}
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
Definition: plugin.php:23
__construct(protected int $obj_id, protected ilCtrl $ctrl)
getLinkToSubObject(string $type, int $id)
getTitleOfSubObject(string $type, int $id)
Class ilCtrl provides processing control methods.
static _lookupTitle(int $a_obj_id)
User Interface for Learning Module Page Objects Editing.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static getPageList(int $lm_id)