diff options
author | Morris Jobke <hey@morrisjobke.de> | 2017-04-07 15:42:43 -0500 |
---|---|---|
committer | Morris Jobke <hey@morrisjobke.de> | 2017-04-09 21:43:01 -0500 |
commit | 5b4adf66e51e21b3ecbd683397a362b60f792a50 (patch) | |
tree | 8bdc129ac9fd6575ee41be438ff667e49f7110a2 /lib/public/Defaults.php | |
parent | ca9d25169dcdd2923a356e2a797d8704506a3787 (diff) | |
download | nextcloud-server-5b4adf66e51e21b3ecbd683397a362b60f792a50.tar.gz nextcloud-server-5b4adf66e51e21b3ecbd683397a362b60f792a50.zip |
Move OC_Defaults to OCP\Defaults
* currently there are two ways to access default values:
OCP\Defaults or OC_Defaults (which is extended by
OCA\Theming\ThemingDefaults)
* our code used a mixture of both of them, which made
it hard to work on theme values
* this extended the public interface with the missing
methods and uses them everywhere to only rely on the
public interface
Signed-off-by: Morris Jobke <hey@morrisjobke.de>
Diffstat (limited to 'lib/public/Defaults.php')
-rw-r--r-- | lib/public/Defaults.php | 45 |
1 files changed, 42 insertions, 3 deletions
diff --git a/lib/public/Defaults.php b/lib/public/Defaults.php index ae873831b8b..591da18c7ee 100644 --- a/lib/public/Defaults.php +++ b/lib/public/Defaults.php @@ -42,7 +42,6 @@ class Defaults { /** * \OC_Defaults instance to retrieve the defaults - * @return string * @since 6.0.0 */ private $defaults; @@ -52,8 +51,11 @@ class Defaults { * actual defaults * @since 6.0.0 */ - function __construct() { - $this->defaults = \OC::$server->getThemingDefaults(); + function __construct(\OC_Defaults $defaults = null) { + if ($defaults === null) { + $defaults = \OC::$server->getThemingDefaults(); + } + $this->defaults = $defaults; } /** @@ -172,4 +174,41 @@ class Defaults { public function getiTunesAppId() { return $this->defaults->getiTunesAppId(); } + + /** + * Themed logo url + * + * @return string + * @since 12.0.0 + */ + public function getLogo() { + return $this->defaults->getLogo(); + } + + /** + * Returns primary color + * @return string + * @since 12.0.0 + */ + public function getColorPrimary() { + return $this->defaults->getColorPrimary(); + } + + /** + * @param string $key + * @return string URL to doc with key + * @since 12.0.0 + */ + public function buildDocLinkToKey($key) { + return $this->defaults->buildDocLinkToKey($key); + } + + /** + * Returns the title + * @return string title + * @since 12.0.0 + */ + public function getTitle() { + return $this->defaults->getTitle(); + } } |