return $finalIconFile;
}
+ /**
+ * @param $app app name
+ * @return string path to app icon / logo
+ */
private function getAppIcon($app) {
$appPath = \OC_App::getAppPath($app);
return $icon;
}
+ $icon = $this->config->getSystemValue('datadirectory', \OC::$SERVERROOT . '/data/') . '/themedinstancelogo';
+ if(file_exists($icon)) {
+ return $icon;
+ }
return \OC::$SERVERROOT . '/core/img/logo.svg';
}
+ /**
+ * @param $app app name
+ * @param $image relative path to image in app folder
+ * @return string absolute path to image
+ */
private function getAppImage($app, $image) {
- // TODO: add support for images in core/img/
$appPath = \OC_App::getAppPath($app);
if($app==="core") {
}
}
+ /**
+ * replace black with white and white with black
+ *
+ * @param $svg content of a svg file
+ * @return string
+ */
private function svgInvert($svg) {
$svg = preg_replace('/#(f{3,6})/i', '#REPLACECOLOR', $svg);
$svg = preg_replace('/#(0{3,6})/i', '#ffffff', $svg);
return $svg;
}
+ /**
+ * replace default color with a custom one
+ *
+ * @param $svg content of a svg file
+ * @param $color color to match
+ * @return string
+ */
private function colorizeSvg($svg, $color) {
$svg = preg_replace('/#0082c9/i', $color, $svg);
return $svg;