ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
class.ilMDSettings.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
22
27{
28 protected static ?self $instance = null;
29
31 private bool $copyright_selection_active = false;
32 private bool $oai_pmh_active = false;
33 private string $oai_repository_name = '';
34 private string $oai_identifier_prefix = '';
35 private string $oai_contact_mail = '';
36
37 private function __construct()
38 {
39 $this->read();
40 }
41
42 public static function _getInstance(): ilMDSettings
43 {
44 if (self::$instance) {
45 return self::$instance;
46 }
47 return self::$instance = new ilMDSettings();
48 }
49
50 public function isCopyrightSelectionActive(): bool
51 {
53 }
54
55 public function activateCopyrightSelection(bool $status): void
56 {
57 $this->copyright_selection_active = $status;
58 $this->settings->set('copyright_selection_active', (string) $status);
59 }
60
61 public function isOAIPMHActive(): bool
62 {
64 }
65
66 public function activateOAIPMH(bool $status): void
67 {
68 $this->oai_pmh_active = $status;
69 $this->settings->set('oai_pmh_active', (string) $status);
70 }
71
72 public function getOAIRepositoryName(): string
73 {
75 }
76
77 public function saveOAIRepositoryName(string $oai_repository_name): void
78 {
79 $this->oai_repository_name = $oai_repository_name;
80 $this->settings->set('oai_repository_name', $oai_repository_name);
81 }
82
83 public function getOAIIdentifierPrefix(): string
84 {
86 }
87
88 public function saveOAIIdentifierPrefix(string $oai_identifier_prefix): void
89 {
90 $this->oai_identifier_prefix = $oai_identifier_prefix;
91 $this->settings->set('oai_identifier_prefix', $oai_identifier_prefix);
92 }
93
94 public function getOAIContactMail(): string
95 {
97 }
98
99 public function saveOAIContactMail(string $oai_contact_mail): void
100 {
101 $this->oai_contact_mail = $oai_contact_mail;
102 $this->settings->set('oai_contact_mail', $oai_contact_mail);
103 }
104
105 private function read(): void
106 {
107 $this->settings = new ilSetting('md_settings');
108
109 $this->copyright_selection_active = (bool) $this->settings->get('copyright_selection_active', '0');
110 $this->oai_pmh_active = (bool) $this->settings->get('oai_pmh_active', '0');
111 $this->oai_repository_name = (string) $this->settings->get('oai_repository_name', '');
112 $this->oai_identifier_prefix = (string) $this->settings->get('oai_identifier_prefix', '');
113 $this->oai_contact_mail = (string) $this->settings->get('oai_contact_mail', '');
114 }
115}
activateOAIPMH(bool $status)
saveOAIRepositoryName(string $oai_repository_name)
activateCopyrightSelection(bool $status)
saveOAIIdentifierPrefix(string $oai_identifier_prefix)
string $oai_identifier_prefix
bool $copyright_selection_active
static self $instance
saveOAIContactMail(string $oai_contact_mail)
string $oai_repository_name
ILIAS Setting Class.