diff options
author | Bjoern Schiessle <bjoern@schiessle.org> | 2016-06-06 17:40:38 +0200 |
---|---|---|
committer | Bjoern Schiessle <bjoern@schiessle.org> | 2016-06-30 17:26:03 +0200 |
commit | 3cb7672b06df20616b3db8ead20ba0f3e50c9a47 (patch) | |
tree | 608f389752f4f88737ac1504105fe60c3c471fdc /lib | |
parent | eed6c6a8b9a17e2eb290b9db76ebdbb8429336b1 (diff) | |
download | nextcloud-server-3cb7672b06df20616b3db8ead20ba0f3e50c9a47.tar.gz nextcloud-server-3cb7672b06df20616b3db8ead20ba0f3e50c9a47.zip |
initial commit for the theming app
Diffstat (limited to 'lib')
-rw-r--r-- | lib/private/defaults.php | 8 | ||||
-rw-r--r-- | lib/private/server.php | 21 | ||||
-rw-r--r-- | lib/private/template.php | 2 |
3 files changed, 26 insertions, 5 deletions
diff --git a/lib/private/defaults.php b/lib/private/defaults.php index 00c45872ab3..eacbf88bf1a 100644 --- a/lib/private/defaults.php +++ b/lib/private/defaults.php @@ -55,12 +55,12 @@ class OC_Defaults { $this->defaultName = 'Nextcloud'; /* short name, used when referring to the software */ $this->defaultTitle = 'Nextcloud'; /* can be a longer name, for titles */ $this->defaultBaseUrl = 'https://nextcloud.com'; - $this->defaultSyncClientUrl = 'https://nextcloud.com/install/'; + $this->defaultSyncClientUrl = 'https://nextcloud.com/install'; $this->defaultiOSClientUrl = 'https://itunes.apple.com/us/app/owncloud/id543672169?mt=8'; $this->defaultiTunesAppId = '543672169'; - $this->defaultAndroidClientUrl = 'https://play.google.com/store/apps/details?id=com.nextcloud.client'; - $this->defaultDocBaseUrl = 'https://docs.nextcloud.org'; - $this->defaultDocVersion = $version[0]; // used to generate doc links + $this->defaultAndroidClientUrl = 'https://play.google.com/store/apps/details?id=com.owncloud.android'; + $this->defaultDocBaseUrl = 'https://doc.owncloud.org'; + $this->defaultDocVersion = $version[0] . '.' . $version[1]; // used to generate doc links $this->defaultSlogan = $this->l->t('a safe home for all your data'); $this->defaultLogoClaim = ''; $this->defaultMailHeaderColor = '#0082c9'; /* header color of mail notifications */ diff --git a/lib/private/server.php b/lib/private/server.php index 7d4b02fefee..0731239e884 100644 --- a/lib/private/server.php +++ b/lib/private/server.php @@ -73,6 +73,8 @@ use OC\Security\SecureRandom; use OC\Security\TrustedDomainHelper; use OC\Session\CryptoWrapper; use OC\Tagging\TagMapper; +use OCA\Theming\Template; +use OCP\IL10N; use OCP\IServerContainer; use OCP\Security\IContentSecurityPolicyManager; use Symfony\Component\EventDispatcher\EventDispatcher; @@ -562,6 +564,17 @@ class Server extends ServerContainer implements IServerContainer { $factory = new $factoryClass($this); return $factory->getManager(); }); + $this->registerService('ThemingDefaults', function(Server $c) { + if($this->getConfig()->getSystemValue('installed', false) && $this->getAppManager()->isInstalled('theming')) { + return new Template( + $this->getConfig(), + $this->getL10N('theming'), + $this->getURLGenerator(), + new \OC_Defaults() + ); + } + return new \OC_Defaults(); + }); $this->registerService('EventDispatcher', function () { return new EventDispatcher(); }); @@ -1207,6 +1220,14 @@ class Server extends ServerContainer implements IServerContainer { } /** + * @internal Not public by intention. + * @return \OC_Defaults + */ + public function getThemingDefaults() { + return $this->query('ThemingDefaults'); + } + + /** * @return \OC\IntegrityCheck\Checker */ public function getIntegrityCodeChecker() { diff --git a/lib/private/template.php b/lib/private/template.php index 2653ae6086a..ec35a1d9ba8 100644 --- a/lib/private/template.php +++ b/lib/private/template.php @@ -76,7 +76,7 @@ class OC_Template extends \OC\Template\Base { $parts = explode('/', $app); // fix translation when app is something like core/lostpassword $l10n = \OC::$server->getL10N($parts[0]); - $themeDefaults = new OC_Defaults(); + $themeDefaults = \OC::$server->getThemingDefaults(); list($path, $template) = $this->findTemplate($theme, $app, $name); |