summaryrefslogtreecommitdiffstats
path: root/apps/theming/lib/Controller/ThemingController.php
diff options
context:
space:
mode:
Diffstat (limited to 'apps/theming/lib/Controller/ThemingController.php')
-rw-r--r--apps/theming/lib/Controller/ThemingController.php27
1 files changed, 27 insertions, 0 deletions
diff --git a/apps/theming/lib/Controller/ThemingController.php b/apps/theming/lib/Controller/ThemingController.php
index 8d9869b84a7..0db4dfe0627 100644
--- a/apps/theming/lib/Controller/ThemingController.php
+++ b/apps/theming/lib/Controller/ThemingController.php
@@ -294,6 +294,8 @@ class ThemingController extends Controller {
color: ' . $color . ';
}
';
+ $responseCss .= sprintf('.nc-theming-main-background {background-color: %s}' . "\n", $color);
+ $responseCss .= sprintf('.nc-theming-main-text {color: %s}' . "\n", $color);
}
$logo = $this->config->getAppValue($this->appName, 'logoMime');
@@ -325,6 +327,9 @@ class ThemingController extends Controller {
$responseCss .= '#header .icon-caret { background-image: url(\'' . \OC::$WEBROOT . '/core/img/actions/caret-dark.svg\'); }' . "\n";
$responseCss .= '.searchbox input[type="search"] { background: transparent url(\'' . \OC::$WEBROOT . '/core/img/actions/search.svg\') no-repeat 6px center; color: #000; }' . "\n";
$responseCss .= '.searchbox input[type="search"]:focus,.searchbox input[type="search"]:active,.searchbox input[type="search"]:valid { color: #000; border: 1px solid rgba(0, 0, 0, .5); }' . "\n";
+ $responseCss .= '.nc-theming-contrast {color: #000000}' . "\n";
+ } else {
+ $responseCss .= '.nc-theming-contrast {color: #ffffff}' . "\n";
}
$response = new DataDownloadResponse($responseCss, 'style', 'text/css');
@@ -332,4 +337,26 @@ class ThemingController extends Controller {
$response->cacheFor(3600);
return $response;
}
+ /**
+ * @NoCSRFRequired
+ * @PublicPage
+ *
+ * @return DataDownloadResponse
+ */
+ public function getJavascript() {
+ $responseJS = '(function() {
+ OCA.Theming = {
+ name: ' . json_encode($this->template->getName()) . ',
+ url: ' . json_encode($this->template->getBaseUrl()) . ',
+ slogan: ' . json_encode($this->template->getSlogan()) . ',
+ color: ' . json_encode($this->template->getMailHeaderColor()) . ',
+ inverted: ' . json_encode($this->util->invertTextColor($this->template->getMailHeaderColor())) . ',
+ };
+})();';
+ $response = new Http\DataDisplayResponse($responseJS);
+ $response->addHeader("Content-type","text/javascript");
+ $response->addHeader('Expires', date(\DateTime::RFC2822, $this->timeFactory->getTime()));
+ $response->cacheFor(3600);
+ return $response;
+ }
}