Passed
Push — master ( be0002...f0c8f7 )
by Roeland
116:12 queued 05:20
created

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