ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
SettingsManager.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
21namespace ILIAS\Wiki\Settings;
22
26
28{
29 protected \ILIAS\Notes\Service $notes;
30
31 public function __construct(
32 protected InternalDataService $data,
33 protected InternalRepoService $repo,
34 protected InternalDomainService $domain
35 ) {
36 global $DIC;
37 $this->notes = $DIC->notes();
38 }
39
40 public function create(Settings $settings): void
41 {
42 $this->repo->settings()->create($settings);
43 }
44
45 public function update(Settings $settings): void
46 {
47 $this->repo->settings()->update($settings);
48 $this->notes->domain()->activateComments($settings->getId(), $settings->getPublicNotes());
49 }
50
51 public function getById(int $id): ?Settings
52 {
53 return $this->repo->settings()->getById($id);
54 }
55
56 public function getStartPageOptions(int $ref_id): array
57 {
58 $pm = $this->domain->page()->page($ref_id);
59 $options = [];
60 foreach ($pm->getWikiPages() as $page) {
61 $options[(string) $page->getId()] = \ilStr::shortenTextExtended($page->getTitle(), 60, true);
62 }
63 return $options;
64 }
65
66 public function getStartPageId(Settings $settings): ?int
67 {
68 return \ilWikiPage::_getPageIdForWikiTitle(
69 $settings->getId(),
70 $settings->getStartPage()
71 );
72 }
73}
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
Definition: plugin.php:23
Repository internal data service.
Repository internal repo service.
__construct(protected InternalDataService $data, protected InternalRepoService $repo, protected InternalDomainService $domain)
static shortenTextExtended(string $a_str, int $a_len, bool $a_dots=false, bool $a_next_blank=false, bool $a_keep_extension=false)
$ref_id
Definition: ltiauth.php:66
global $DIC
Definition: shib_login.php:26