You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

Defaults.php 4.6KB

11 years ago
8 years ago
8 years ago
11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217
  1. <?php
  2. /**
  3. * @copyright Copyright (c) 2016, ownCloud, Inc.
  4. *
  5. * @author Björn Schießle <bjoern@schiessle.org>
  6. * @author Joas Schilling <coding@schilljs.com>
  7. * @author Lukas Reschke <lukas@statuscode.ch>
  8. * @author Morris Jobke <hey@morrisjobke.de>
  9. * @author Roeland Jago Douma <roeland@famdouma.nl>
  10. * @author scolebrook <scolebrook@mac.com>
  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. * Public interface of ownCloud for apps to use.
  29. * Defaults Class
  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. namespace OCP;
  35. /**
  36. * public api to access default strings and urls for your templates
  37. * @since 6.0.0
  38. */
  39. class Defaults {
  40. /**
  41. * \OC_Defaults instance to retrieve the defaults
  42. * @since 6.0.0
  43. */
  44. private $defaults;
  45. /**
  46. * creates a \OC_Defaults instance which is used in all methods to retrieve the
  47. * actual defaults
  48. * @since 6.0.0
  49. */
  50. public function __construct(\OC_Defaults $defaults = null) {
  51. if ($defaults === null) {
  52. $defaults = \OC::$server->getThemingDefaults();
  53. }
  54. $this->defaults = $defaults;
  55. }
  56. /**
  57. * get base URL for the organisation behind your ownCloud instance
  58. * @return string
  59. * @since 6.0.0
  60. */
  61. public function getBaseUrl() {
  62. return $this->defaults->getBaseUrl();
  63. }
  64. /**
  65. * link to the desktop sync client
  66. * @return string
  67. * @since 6.0.0
  68. */
  69. public function getSyncClientUrl() {
  70. return $this->defaults->getSyncClientUrl();
  71. }
  72. /**
  73. * link to the iOS client
  74. * @return string
  75. * @since 8.0.0
  76. */
  77. public function getiOSClientUrl() {
  78. return $this->defaults->getiOSClientUrl();
  79. }
  80. /**
  81. * link to the Android client
  82. * @return string
  83. * @since 8.0.0
  84. */
  85. public function getAndroidClientUrl() {
  86. return $this->defaults->getAndroidClientUrl();
  87. }
  88. /**
  89. * base URL to the documentation of your ownCloud instance
  90. * @return string
  91. * @since 6.0.0
  92. */
  93. public function getDocBaseUrl() {
  94. return $this->defaults->getDocBaseUrl();
  95. }
  96. /**
  97. * name of your ownCloud instance
  98. * @return string
  99. * @since 6.0.0
  100. */
  101. public function getName() {
  102. return $this->defaults->getName();
  103. }
  104. /**
  105. * name of your ownCloud instance containing HTML styles
  106. * @return string
  107. * @since 8.0.0
  108. */
  109. public function getHTMLName() {
  110. return $this->defaults->getHTMLName();
  111. }
  112. /**
  113. * Entity behind your onwCloud instance
  114. * @return string
  115. * @since 6.0.0
  116. */
  117. public function getEntity() {
  118. return $this->defaults->getEntity();
  119. }
  120. /**
  121. * ownCloud slogan
  122. * @return string
  123. * @since 6.0.0
  124. */
  125. public function getSlogan(?string $lang = null) {
  126. return $this->defaults->getSlogan($lang);
  127. }
  128. /**
  129. * footer, short version
  130. * @return string
  131. * @since 6.0.0
  132. */
  133. public function getShortFooter() {
  134. return $this->defaults->getShortFooter();
  135. }
  136. /**
  137. * footer, long version
  138. * @return string
  139. * @since 6.0.0
  140. */
  141. public function getLongFooter() {
  142. return $this->defaults->getLongFooter();
  143. }
  144. /**
  145. * Returns the AppId for the App Store for the iOS Client
  146. * @return string AppId
  147. * @since 8.0.0
  148. */
  149. public function getiTunesAppId() {
  150. return $this->defaults->getiTunesAppId();
  151. }
  152. /**
  153. * Themed logo url
  154. *
  155. * @param bool $useSvg Whether to point to the SVG image or a fallback
  156. * @return string
  157. * @since 12.0.0
  158. */
  159. public function getLogo($useSvg = true) {
  160. return $this->defaults->getLogo($useSvg);
  161. }
  162. /**
  163. * Returns primary color
  164. * @return string
  165. * @since 12.0.0
  166. */
  167. public function getColorPrimary() {
  168. return $this->defaults->getColorPrimary();
  169. }
  170. /**
  171. * @param string $key
  172. * @return string URL to doc with key
  173. * @since 12.0.0
  174. */
  175. public function buildDocLinkToKey($key) {
  176. return $this->defaults->buildDocLinkToKey($key);
  177. }
  178. /**
  179. * Returns the title
  180. * @return string title
  181. * @since 12.0.0
  182. */
  183. public function getTitle() {
  184. return $this->defaults->getTitle();
  185. }
  186. /**
  187. * Returns primary color
  188. * @return string
  189. * @since 13.0.0
  190. */
  191. public function getTextColorPrimary() {
  192. return $this->defaults->getTextColorPrimary();
  193. }
  194. }