Passed
Push — master ( e1f644...b1099f )
by Julius
12:15 queued 12s
created

Defaults::getTitle()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 2
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 0
dl 0
loc 2
rs 10
c 0
b 0
f 0
1
<?php
2
3
declare(strict_types=1);
4
5
/**
6
 * @copyright Copyright (c) 2016, ownCloud, Inc.
7
 *
8
 * @author Björn Schießle <[email protected]>
9
 * @author J0WI <[email protected]>
10
 * @author Joas Schilling <[email protected]>
11
 * @author Julius Härtl <[email protected]>
12
 * @author Lukas Reschke <[email protected]>
13
 * @author Morris Jobke <[email protected]>
14
 * @author Roeland Jago Douma <[email protected]>
15
 * @author scolebrook <[email protected]>
16
 *
17
 * @license AGPL-3.0
18
 *
19
 * This code is free software: you can redistribute it and/or modify
20
 * it under the terms of the GNU Affero General Public License, version 3,
21
 * as published by the Free Software Foundation.
22
 *
23
 * This program is distributed in the hope that it will be useful,
24
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
25
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
26
 * GNU Affero General Public License for more details.
27
 *
28
 * You should have received a copy of the GNU Affero General Public License, version 3,
29
 * along with this program. If not, see <http://www.gnu.org/licenses/>
30
 *
31
 */
32
// use OCP namespace for all classes that are considered public.
33
// This means that they should be used by apps instead of the internal ownCloud classes
34
35
namespace OCP;
36
37
/**
38
 * public api to access default strings and urls for your templates
39
 * @since 6.0.0
40
 */
41
class Defaults {
42
43
	/**
44
	 * \OC_Defaults instance to retrieve the defaults
45
	 * @since 6.0.0
46
	 */
47
	private $defaults;
48
49
	/**
50
	 * creates a \OC_Defaults instance which is used in all methods to retrieve the
51
	 * actual defaults
52
	 * @since 6.0.0
53
	 */
54
	public function __construct(\OC_Defaults $defaults = null) {
55
		if ($defaults === null) {
56
			$defaults = \OC::$server->getThemingDefaults();
57
		}
58
		$this->defaults = $defaults;
59
	}
60
61
	/**
62
	 * get base URL for the organisation behind your ownCloud instance
63
	 * @return string
64
	 * @since 6.0.0
65
	 */
66
	public function getBaseUrl(): string {
67
		return $this->defaults->getBaseUrl();
68
	}
69
70
	/**
71
	 * link to the desktop sync client
72
	 * @return string
73
	 * @since 6.0.0
74
	 */
75
	public function getSyncClientUrl(): string {
76
		return $this->defaults->getSyncClientUrl();
77
	}
78
79
	/**
80
	 * link to the iOS client
81
	 * @return string
82
	 * @since 8.0.0
83
	 */
84
	public function getiOSClientUrl(): string {
85
		return $this->defaults->getiOSClientUrl();
86
	}
87
88
	/**
89
	 * link to the Android client
90
	 * @return string
91
	 * @since 8.0.0
92
	 */
93
	public function getAndroidClientUrl(): string {
94
		return $this->defaults->getAndroidClientUrl();
95
	}
96
97
	/**
98
	 * link to the Android client on F-Droid
99
	 * @return string
100
	 * @since 23.0.0
101
	 */
102
	public function getFDroidClientUrl() {
103
		return $this->defaults->getFDroidClientUrl();
104
	}
105
106
	/**
107
	 * base URL to the documentation of your ownCloud instance
108
	 * @return string
109
	 * @since 6.0.0
110
	 */
111
	public function getDocBaseUrl(): string {
112
		return $this->defaults->getDocBaseUrl();
113
	}
114
115
	/**
116
	 * name of your Nextcloud instance (e.g. MyPrivateCloud)
117
	 * @return string
118
	 * @since 6.0.0
119
	 */
120
	public function getName(): string {
121
		return $this->defaults->getName();
122
	}
123
124
	/**
125
	 * Name of the software product (defaults to Nextcloud)
126
	 *
127
	 * @return string
128
	 * @since 22.0.0
129
	 */
130
	public function getProductName(): string {
131
		return $this->defaults->getProductName();
132
	}
133
134
	/**
135
	 * name of your ownCloud instance containing HTML styles
136
	 * @return string
137
	 * @since 8.0.0
138
	 * @depreacted 22.0.0
139
	 */
140
	public function getHTMLName(): string {
141
		return $this->defaults->getHTMLName();
142
	}
143
144
	/**
145
	 * Entity behind your onwCloud instance
146
	 * @return string
147
	 * @since 6.0.0
148
	 */
149
	public function getEntity(): string {
150
		return $this->defaults->getEntity();
151
	}
152
153
	/**
154
	 * ownCloud slogan
155
	 * @return string
156
	 * @since 6.0.0
157
	 */
158
	public function getSlogan(?string $lang = null): string {
159
		return $this->defaults->getSlogan($lang);
160
	}
161
162
	/**
163
	 * footer, short version
164
	 * @return string
165
	 * @since 6.0.0
166
	 */
167
	public function getShortFooter(): string {
168
		return $this->defaults->getShortFooter();
169
	}
170
171
	/**
172
	 * footer, long version
173
	 * @return string
174
	 * @since 6.0.0
175
	 */
176
	public function getLongFooter(): string {
177
		return $this->defaults->getLongFooter();
178
	}
179
180
	/**
181
	 * Returns the AppId for the App Store for the iOS Client
182
	 * @return string AppId
183
	 * @since 8.0.0
184
	 */
185
	public function getiTunesAppId(): string {
186
		return $this->defaults->getiTunesAppId();
187
	}
188
189
	/**
190
	 * Themed logo url
191
	 *
192
	 * @param bool $useSvg Whether to point to the SVG image or a fallback
193
	 * @return string
194
	 * @since 12.0.0
195
	 */
196
	public function getLogo(bool $useSvg = true): string {
197
		return $this->defaults->getLogo($useSvg);
198
	}
199
200
	/**
201
	 * Returns primary color
202
	 * @return string
203
	 * @since 12.0.0
204
	 */
205
	public function getColorPrimary(): string {
206
		return $this->defaults->getColorPrimary();
207
	}
208
209
	/**
210
	 * @param string $key
211
	 * @return string URL to doc with key
212
	 * @since 12.0.0
213
	 */
214
	public function buildDocLinkToKey(string $key): string {
215
		return $this->defaults->buildDocLinkToKey($key);
216
	}
217
218
	/**
219
	 * Returns the title
220
	 * @return string title
221
	 * @since 12.0.0
222
	 */
223
	public function getTitle(): string {
224
		return $this->defaults->getTitle();
225
	}
226
227
	/**
228
	 * Returns primary color
229
	 * @return string
230
	 * @since 13.0.0
231
	 */
232
	public function getTextColorPrimary(): string {
233
		return $this->defaults->getTextColorPrimary();
234
	}
235
}
236