Use the themed Defaults everywhere
This commit is contained in:
parent
e8d6621a24
commit
2c988ecbf4
16 changed files with 21 additions and 24 deletions
|
@ -65,7 +65,7 @@ class PublicAuth extends AbstractBasic {
|
|||
$this->session = $session;
|
||||
|
||||
// setup realm
|
||||
$defaults = new \OC_Defaults();
|
||||
$defaults = new \OCP\Defaults();
|
||||
$this->realm = $defaults->getName();
|
||||
}
|
||||
|
||||
|
|
|
@ -78,7 +78,7 @@ class Auth extends AbstractBasic {
|
|||
$this->principalPrefix = $principalPrefix;
|
||||
|
||||
// setup realm
|
||||
$defaults = new \OC_Defaults();
|
||||
$defaults = new \OCP\Defaults();
|
||||
$this->realm = $defaults->getName();
|
||||
}
|
||||
|
||||
|
|
|
@ -38,7 +38,7 @@ class FedAuth extends AbstractBasic {
|
|||
$this->principalPrefix = 'principals/system/';
|
||||
|
||||
// setup realm
|
||||
$defaults = new \OC_Defaults();
|
||||
$defaults = new \OCP\Defaults();
|
||||
$this->realm = $defaults->getName();
|
||||
}
|
||||
|
||||
|
|
|
@ -35,7 +35,7 @@ use OC\Core\Controller\LostController;
|
|||
use OC\Core\Controller\TokenController;
|
||||
use OC\Core\Controller\TwoFactorChallengeController;
|
||||
use OC\Core\Controller\UserController;
|
||||
use OC_Defaults;
|
||||
use OCP\Defaults;
|
||||
use OCP\AppFramework\App;
|
||||
use OCP\Util;
|
||||
|
||||
|
@ -165,8 +165,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();
|
||||
|
|
|
@ -64,7 +64,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'];
|
||||
|
|
|
@ -38,7 +38,6 @@ use \OCP\IConfig;
|
|||
use OCP\IUserManager;
|
||||
use OCP\Mail\IMailer;
|
||||
use OCP\Security\ISecureRandom;
|
||||
use \OC_Defaults;
|
||||
use OCP\Security\StringUtils;
|
||||
|
||||
/**
|
||||
|
@ -54,8 +53,7 @@ class LostController extends Controller {
|
|||
protected $urlGenerator;
|
||||
/** @var IUserManager */
|
||||
protected $userManager;
|
||||
// FIXME: Inject a non-static factory of OC_Defaults for better unit-testing
|
||||
/** @var OC_Defaults */
|
||||
/** @var \OC_Defaults */
|
||||
protected $defaults;
|
||||
/** @var IL10N */
|
||||
protected $l10n;
|
||||
|
@ -77,7 +75,7 @@ class LostController extends Controller {
|
|||
* @param IRequest $request
|
||||
* @param IURLGenerator $urlGenerator
|
||||
* @param IUserManager $userManager
|
||||
* @param OC_Defaults $defaults
|
||||
* @param \OC_Defaults $defaults
|
||||
* @param IL10N $l10n
|
||||
* @param IConfig $config
|
||||
* @param ISecureRandom $secureRandom
|
||||
|
@ -90,7 +88,7 @@ class LostController extends Controller {
|
|||
IRequest $request,
|
||||
IURLGenerator $urlGenerator,
|
||||
IUserManager $userManager,
|
||||
OC_Defaults $defaults,
|
||||
\OC_Defaults $defaults,
|
||||
IL10N $l10n,
|
||||
IConfig $config,
|
||||
ISecureRandom $secureRandom,
|
||||
|
|
|
@ -812,7 +812,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);
|
||||
|
|
|
@ -26,8 +26,8 @@
|
|||
namespace OC\Console;
|
||||
|
||||
use OC_App;
|
||||
use OC_Defaults;
|
||||
use OCP\Console\ConsoleEvent;
|
||||
use OCP\Defaults;
|
||||
use OCP\IConfig;
|
||||
use OCP\IRequest;
|
||||
use Symfony\Component\Console\Application as SymfonyApplication;
|
||||
|
@ -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;
|
||||
|
|
|
@ -562,7 +562,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) {
|
||||
|
|
|
@ -426,7 +426,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());
|
||||
|
|
|
@ -29,7 +29,7 @@
|
|||
*/
|
||||
|
||||
namespace OC;
|
||||
use OC_Defaults;
|
||||
use OCP\Defaults;
|
||||
use OCP\ICacheFactory;
|
||||
use OCP\IConfig;
|
||||
use OCP\IURLGenerator;
|
||||
|
@ -222,7 +222,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);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -631,7 +631,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();
|
||||
|
||||
|
|
|
@ -51,7 +51,7 @@ class Defaults {
|
|||
* @since 6.0.0
|
||||
*/
|
||||
function __construct() {
|
||||
$this->defaults = new \OC_Defaults();
|
||||
$this->defaults = \OC::$server->getThemingDefaults();
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -227,7 +227,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');
|
||||
|
|
|
@ -29,7 +29,6 @@ use OCP\IRequest;
|
|||
use OCP\IL10N;
|
||||
use OCP\IConfig;
|
||||
use OCP\Mail\IMailer;
|
||||
use OCP\Mail\IMessage;
|
||||
|
||||
/**
|
||||
* @package OC\Settings\Controller
|
||||
|
|
|
@ -37,7 +37,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();
|
||||
|
|
Loading…
Reference in a new issue