{event name='javascriptInclude'}
<!-- Icons -->
-<link rel="icon" href="{@$__wcf->getFavicon()}" type="image/x-icon">
-<link rel="apple-touch-icon" href="{@$__wcf->getPath()}images/apple-touch-icon.png">
-
-<!-- theme color (mobile Chrome) -->
+<link rel="apple-touch-icon" sizes="180x180" href="{$__wcf->getStyleHandler()->getStyle()->getFaviconAppleTouchIcon()}">
+<link rel="manifest" href="{@$__wcf->getStyleHandler()->getStyle()->getFaviconManifest()}">
+<link rel="shortcut icon" href="{@$__wcf->getFavicon()}">
+<meta name="msapplication-config" content="{@$__wcf->getStyleHandler()->getStyle()->getFaviconBrowserconfig()}">
<meta name="theme-color" content="{$__wcf->getStyleHandler()->getStyle()->getVariable('wcfHeaderBackground')}">
<script data-relocate="true">
--- /dev/null
+<?xml version="1.0" encoding="utf-8"?>
+<browserconfig>
+ <msapplication>
+ <tile>
+ <square150x150logo src="/abc/test/mstile-150x150.png"/>
+ <TileColor>#3a6d9c</TileColor>
+ </tile>
+ </msapplication>
+</browserconfig>
--- /dev/null
+{
+ "name": "",
+ "icons": [
+ {
+ "src": "/abc/test/android-chrome-192x192.png",
+ "sizes": "192x192",
+ "type": "image/png"
+ },
+ {
+ "src": "/abc/test/android-chrome-256x256.png",
+ "sizes": "256x256",
+ "type": "image/png"
+ }
+ ],
+ "theme_color": "#ffffff",
+ "background_color": "#ffffff",
+ "display": "standalone"
+}
\ No newline at end of file
return WCF::getPath() . 'images/default-logo-small.png';
}
+
+ public function getFaviconAppleTouchIcon() {
+ return $this->getFaviconPath('apple-touch-icon.png');
+ }
+
+ public function getFaviconManifest() {
+ return $this->getFaviconPath('manifest.json');
+ }
+
+ public function getFaviconBrowserconfig() {
+ return $this->getFaviconPath('browserconfig.xml');
+ }
+
+ public function getRelativeFavicon() {
+ return $this->getFaviconPath('favicon.ico', false);
+ }
+
+ protected function getFaviconPath($filename, $absolutePath = true) {
+ $path = 'images/favicon/'. ($this->getDecoratedObject()->hasFavicon ? $this->getDecoratedObject()->styleID : 'default') . ".{$filename}";
+ if ($absolutePath) {
+ return WCF::getPath() . $path;
+ }
+
+ return $path;
+ }
}
* @property-read string $imagePath path (relative to `WCF_DIR`) to the images used by the style or empty if style has no special image path
* @property-read string $packageName package identifier used to export the style as a package or empty (thus style cannot be exported as package)
* @property-read integer $isTainted is `0` if the original declarations of an imported or installed style are not and cannot be altered, otherwise `1`
+ * @property-read integer $hasFavicon is `0` if the default favicon data should be used
*/
class Style extends DatabaseObject {
/**
public function getFavicon() {
$activeApplication = ApplicationHandler::getInstance()->getActiveApplication();
$wcf = ApplicationHandler::getInstance()->getWCF();
+ $favicon = StyleHandler::getInstance()->getStyle()->getRelativeFavicon();
if ($activeApplication->domainName !== $wcf->domainName) {
- if (file_exists(WCF_DIR.'images/favicon.ico')) {
- $favicon = file_get_contents(WCF_DIR.'images/favicon.ico');
+ if (file_exists(WCF_DIR.$favicon)) {
+ $favicon = file_get_contents(WCF_DIR.$favicon);
return 'data:image/x-icon;base64,' . base64_encode($favicon);
}
}
- return self::getPath() . 'images/favicon.ico';
+ return self::getPath() . $favicon;
}
/**
authorURL VARCHAR(255) NOT NULL DEFAULT '',
imagePath VARCHAR(255) NOT NULL DEFAULT '',
packageName VARCHAR(255) NOT NULL DEFAULT '',
- isTainted TINYINT(1) NOT NULL DEFAULT 0
+ isTainted TINYINT(1) NOT NULL DEFAULT 0,
+ hasFavicon TINYINT(1) NOT NULL DEFAULT 0
);
DROP TABLE IF EXISTS wcf1_style_variable;