summaryrefslogtreecommitdiffstats
path: root/lib/private/Mail
diff options
context:
space:
mode:
authorMorris Jobke <hey@morrisjobke.de>2017-04-07 15:42:43 -0500
committerMorris Jobke <hey@morrisjobke.de>2017-04-09 21:43:01 -0500
commit5b4adf66e51e21b3ecbd683397a362b60f792a50 (patch)
tree8bdc129ac9fd6575ee41be438ff667e49f7110a2 /lib/private/Mail
parentca9d25169dcdd2923a356e2a797d8704506a3787 (diff)
downloadnextcloud-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/private/Mail')
-rw-r--r--lib/private/Mail/EMailTemplate.php10
-rw-r--r--lib/private/Mail/IEMailTemplate.php8
-rw-r--r--lib/private/Mail/Mailer.php7
3 files changed, 14 insertions, 11 deletions
diff --git a/lib/private/Mail/EMailTemplate.php b/lib/private/Mail/EMailTemplate.php
index 7d3ca51c50e..c84af6331dc 100644
--- a/lib/private/Mail/EMailTemplate.php
+++ b/lib/private/Mail/EMailTemplate.php
@@ -25,7 +25,7 @@
namespace OC\Mail;
-use OCA\Theming\ThemingDefaults;
+use OCP\Defaults;
use OCP\IL10N;
use OCP\IURLGenerator;
@@ -38,7 +38,7 @@ use OCP\IURLGenerator;
* @package OC\Mail
*/
class EMailTemplate implements IEMailTemplate {
- /** @var ThemingDefaults */
+ /** @var Defaults */
protected $themingDefaults;
/** @var IURLGenerator */
protected $urlGenerator;
@@ -264,11 +264,11 @@ EOF;
EOF;
/**
- * @param ThemingDefaults $themingDefaults
+ * @param Defaults $themingDefaults
* @param IURLGenerator $urlGenerator
* @param IL10N $l10n
*/
- public function __construct(ThemingDefaults $themingDefaults,
+ public function __construct(Defaults $themingDefaults,
IURLGenerator $urlGenerator,
IL10N $l10n) {
$this->themingDefaults = $themingDefaults;
@@ -286,7 +286,7 @@ EOF;
}
$this->headerAdded = true;
- $logoUrl = $this->urlGenerator->getAbsoluteURL($this->themingDefaults->getLogo()) . '?v='. $this->themingDefaults->getCacheBusterCounter();
+ $logoUrl = $this->urlGenerator->getAbsoluteURL($this->themingDefaults->getLogo());
$this->htmlBody .= vsprintf($this->header, [$this->themingDefaults->getColorPrimary(), $logoUrl]);
}
diff --git a/lib/private/Mail/IEMailTemplate.php b/lib/private/Mail/IEMailTemplate.php
index 0d660a35516..baa29735988 100644
--- a/lib/private/Mail/IEMailTemplate.php
+++ b/lib/private/Mail/IEMailTemplate.php
@@ -23,6 +23,8 @@
namespace OC\Mail;
+use OCP\Defaults;
+
/**
* Interface IEMailTemplate
*
@@ -32,7 +34,7 @@ namespace OC\Mail;
*
* <?php
*
- * $emailTemplate = new EMailTemplate($this->defaults);
+ * $emailTemplate = new EMailTemplate($this->defaults, $this->urlGenerator, $this->l10n);
*
* $emailTemplate->addHeader();
* $emailTemplate->addHeading('Welcome aboard');
@@ -50,11 +52,11 @@ namespace OC\Mail;
*/
interface IEMailTemplate {
/**
- * @param \OCA\Theming\ThemingDefaults $themingDefaults
+ * @param Defaults $themingDefaults
* @param \OCP\IURLGenerator $urlGenerator
* @param \OCP\IL10N $l10n
*/
- public function __construct(\OCA\Theming\ThemingDefaults $themingDefaults,
+ public function __construct(Defaults $themingDefaults,
\OCP\IURLGenerator $urlGenerator,
\OCP\IL10N $l10n);
diff --git a/lib/private/Mail/Mailer.php b/lib/private/Mail/Mailer.php
index e704e8e3490..8a6b6fce899 100644
--- a/lib/private/Mail/Mailer.php
+++ b/lib/private/Mail/Mailer.php
@@ -22,6 +22,7 @@
namespace OC\Mail;
+use OCP\Defaults;
use OCP\IConfig;
use OCP\Mail\IMailer;
use OCP\ILogger;
@@ -51,17 +52,17 @@ class Mailer implements IMailer {
private $config;
/** @var ILogger */
private $logger;
- /** @var \OC_Defaults */
+ /** @var Defaults */
private $defaults;
/**
* @param IConfig $config
* @param ILogger $logger
- * @param \OC_Defaults $defaults
+ * @param Defaults $defaults
*/
function __construct(IConfig $config,
ILogger $logger,
- \OC_Defaults $defaults) {
+ Defaults $defaults) {
$this->config = $config;
$this->logger = $logger;
$this->defaults = $defaults;