Use the themed Defaults everywhere

This commit is contained in:
Joas Schilling 2016-07-15 09:22:44 +02:00
parent b73e46f471
commit 06ac822b71
No known key found for this signature in database
GPG Key ID: E166FD8976B3BAC8
12 changed files with 13 additions and 13 deletions

View File

@ -98,7 +98,7 @@ class ServerFactory {
$server->setBaseUri($baseUri);
// Load plugins
$defaults = new \OC_Defaults();
$defaults = new \OCP\Defaults();
$server->addPlugin(new \OCA\DAV\Connector\Sabre\MaintenancePlugin($this->config));
$server->addPlugin(new \OCA\DAV\Connector\Sabre\BlockLegacyClientPlugin($this->config));
$server->addPlugin(new \Sabre\DAV\Auth\Plugin($authBackend, $defaults->getName()));

View File

@ -123,8 +123,8 @@ class Application extends App {
$container->registerService('UserFolder', function(SimpleContainer $c) {
return $c->query('ServerContainer')->getUserFolder();
});
$container->registerService('Defaults', function() {
return new \OC_Defaults;
$container->registerService('Defaults', function(SimpleContainer $c) {
return $c->query('ServerContainer')->getThemingDefaults();
});
$container->registerService('Mailer', function(SimpleContainer $c) {
return $c->query('ServerContainer')->getMailer();

View File

@ -63,7 +63,7 @@ class Install extends Command {
// validate the environment
$server = \OC::$server;
$setupHelper = new Setup($this->config, $server->getIniWrapper(),
$server->getL10N('lib'), new \OC_Defaults(), $server->getLogger(),
$server->getL10N('lib'), $server->getThemingDefaults(), $server->getLogger(),
$server->getSecureRandom());
$sysInfo = $setupHelper->getSystemInfo(true);
$errors = $sysInfo['errors'];

View File

@ -911,7 +911,7 @@ class OC {
if (!$systemConfig->getValue('installed', false)) {
\OC::$server->getSession()->clear();
$setupHelper = new OC\Setup(\OC::$server->getConfig(), \OC::$server->getIniWrapper(),
\OC::$server->getL10N('lib'), new \OC_Defaults(), \OC::$server->getLogger(),
\OC::$server->getL10N('lib'), \OC::$server->getThemingDefaults(), \OC::$server->getLogger(),
\OC::$server->getSecureRandom());
$controller = new OC\Core\Controller\SetupController($setupHelper);
$controller->run($_POST);

View File

@ -51,7 +51,7 @@ class Application {
* @param IRequest $request
*/
public function __construct(IConfig $config, EventDispatcherInterface $dispatcher, IRequest $request) {
$defaults = new OC_Defaults;
$defaults = \OC::$server->getThemingDefaults();
$this->config = $config;
$this->application = new SymfonyApplication($defaults->getName(), \OC_Util::getVersionString());
$this->dispatcher = $dispatcher;

View File

@ -510,7 +510,7 @@ class Server extends ServerContainer implements IServerContainer {
return new Mailer(
$c->getConfig(),
$c->getLogger(),
new \OC_Defaults()
$c->getThemingDefaults()
);
});
$this->registerService('OcsClient', function (Server $c) {

View File

@ -415,7 +415,7 @@ class Setup {
}
$setupHelper = new \OC\Setup($config, \OC::$server->getIniWrapper(),
\OC::$server->getL10N('lib'), new \OC_Defaults(), \OC::$server->getLogger(),
\OC::$server->getL10N('lib'), \OC::$server->getThemingDefaults(), \OC::$server->getLogger(),
\OC::$server->getSecureRandom());
$htaccessContent = file_get_contents($setupHelper->pathToHtaccess());

View File

@ -218,7 +218,7 @@ class URLGenerator implements IURLGenerator {
* @return string url to the online documentation
*/
public function linkToDocs($key) {
$theme = new OC_Defaults();
$theme = \OC::$server->getThemingDefaults();
return $theme->buildDocLinkToKey($key);
}
}

View File

@ -625,7 +625,7 @@ class OC_Util {
$webServerRestart = false;
$setup = new \OC\Setup($config, \OC::$server->getIniWrapper(), \OC::$server->getL10N('lib'),
new \OC_Defaults(), \OC::$server->getLogger(), \OC::$server->getSecureRandom());
\OC::$server->getThemingDefaults(), \OC::$server->getLogger(), \OC::$server->getSecureRandom());
$urlGenerator = \OC::$server->getURLGenerator();

View File

@ -51,7 +51,7 @@ class Defaults {
* @since 6.0.0
*/
function __construct() {
$this->defaults = new \OC_Defaults();
$this->defaults = \OC::$server->getThemingDefaults();
}
/**

View File

@ -214,7 +214,7 @@ class Application extends App {
return $c->query('ServerContainer')->getMailer();
});
$container->registerService('Defaults', function(IContainer $c) {
return new \OC_Defaults;
return $c->query('ServerContainer')->getThemingDefaults();
});
$container->registerService('DefaultMailAddress', function(IContainer $c) {
return Util::getDefaultEmailAddress('no-reply');

View File

@ -36,7 +36,7 @@
OC_Util::checkLoggedIn();
$defaults = new OC_Defaults(); // initialize themable default strings and urls
$defaults = \OC::$server->getThemingDefaults();
$certificateManager = \OC::$server->getCertificateManager();
$config = \OC::$server->getConfig();
$urlGenerator = \OC::$server->getURLGenerator();