Completed
Push — master ( 5ca5eb...afb5d4 )
by Lukas
16:52
created

Defaults::buildDocLinkToKey()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 2
nc 1
nop 1
dl 0
loc 3
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 scolebrook <[email protected]>
10
 *
11
 * @license AGPL-3.0
12
 *
13
 * This code is free software: you can redistribute it and/or modify
14
 * it under the terms of the GNU Affero General Public License, version 3,
15
 * as published by the Free Software Foundation.
16
 *
17
 * This program is distributed in the hope that it will be useful,
18
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
19
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20
 * GNU Affero General Public License for more details.
21
 *
22
 * You should have received a copy of the GNU Affero General Public License, version 3,
23
 * along with this program.  If not, see <http://www.gnu.org/licenses/>
24
 *
25
 */
26
27
/**
28
 * Public interface of ownCloud for apps to use.
29
 * Defaults Class
30
 *
31
 */
32
33
// use OCP namespace for all classes that are considered public.
34
// This means that they should be used by apps instead of the internal ownCloud classes
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
	function __construct(\OC_Defaults $defaults = null) {
0 ignored issues
show
Best Practice introduced by
It is generally recommended to explicitly declare the visibility for methods.

Adding explicit visibility (private, protected, or public) is generally recommend to communicate to other developers how, and from where this method is intended to be used.

Loading history...
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() {
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() {
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() {
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() {
94
		return $this->defaults->getAndroidClientUrl();
95
	}
96
97
	/**
98
	 * base URL to the documentation of your ownCloud instance
99
	 * @return string
100
	 * @since 6.0.0
101
	 */
102
	public function getDocBaseUrl() {
103
		return $this->defaults->getDocBaseUrl();
104
	}
105
106
	/**
107
	 * name of your ownCloud instance
108
	 * @return string
109
	 * @since 6.0.0
110
	 */
111
	public function getName() {
112
		return $this->defaults->getName();
113
	}
114
115
	/**
116
	 * name of your ownCloud instance containing HTML styles
117
	 * @return string
118
	 * @since 8.0.0
119
	 */
120
	public function getHTMLName() {
121
		return $this->defaults->getHTMLName();
122
	}
123
124
	/**
125
	 * Entity behind your onwCloud instance
126
	 * @return string
127
	 * @since 6.0.0
128
	 */
129
	public function getEntity() {
130
		return $this->defaults->getEntity();
131
	}
132
133
	/**
134
	 * ownCloud slogan
135
	 * @return string
136
	 * @since 6.0.0
137
	 */
138
	public function getSlogan() {
139
		return $this->defaults->getSlogan();
140
	}
141
142
	/**
143
	 * logo claim
144
	 * @return string
145
	 * @since 6.0.0
146
	 */
147
	public function getLogoClaim() {
148
		return $this->defaults->getLogoClaim();
149
	}
150
151
	/**
152
	 * footer, short version
153
	 * @return string
154
	 * @since 6.0.0
155
	 */
156
	public function getShortFooter() {
157
		return $this->defaults->getShortFooter();
158
	}
159
160
	/**
161
	 * footer, long version
162
	 * @return string
163
	 * @since 6.0.0
164
	 */
165
	public function getLongFooter() {
166
		return $this->defaults->getLongFooter();
167
	}
168
169
	/**
170
	 * Returns the AppId for the App Store for the iOS Client
171
	 * @return string AppId
172
	 * @since 8.0.0
173
	 */
174
	public function getiTunesAppId() {
175
		return $this->defaults->getiTunesAppId();
176
	}
177
178
	/**
179
	 * Themed logo url
180
	 *
181
	 * @return string
182
	 * @since 12.0.0
183
	 */
184
	public function getLogo() {
185
		return $this->defaults->getLogo();
186
	}
187
188
	/**
189
	 * Returns primary color
190
	 * @return string
191
	 * @since 12.0.0
192
	 */
193
	public function getColorPrimary() {
194
		return $this->defaults->getColorPrimary();
195
	}
196
197
	/**
198
	 * @param string $key
199
	 * @return string URL to doc with key
200
	 * @since 12.0.0
201
	 */
202
	public function buildDocLinkToKey($key) {
203
		return $this->defaults->buildDocLinkToKey($key);
204
	}
205
206
	/**
207
	 * Returns the title
208
	 * @return string title
209
	 * @since 12.0.0
210
	 */
211
	public function getTitle() {
212
		return $this->defaults->getTitle();
213
	}
214
}
215