* @param string $filename
* @param integer $packageID
* @param StyleEditor $style
+ * @param boolean $skipFontDownload
* @return StyleEditor
*/
- public static function import($filename, $packageID = 1, StyleEditor $style = null) {
+ public static function import($filename, $packageID = 1, StyleEditor $style = null, $skipFontDownload = false) {
// open file
$tar = new Tar($filename);
}
}
- // download google fonts
- $fontManager = FontManager::getInstance();
- $family = $style->getVariable('wcfFontFamilyGoogle');
- try {
- $fontManager->downloadFamily($family);
- }
- catch (FontDownloadFailed $e) {
- // ignore
+ if (!$skipFontDownload) {
+ // download google fonts
+ $fontManager = FontManager::getInstance();
+ $family = $style->getVariable('wcfFontFamilyGoogle');
+ try {
+ $fontManager->downloadFamily($family);
+ }
+ catch (FontDownloadFailed $e) {
+ // ignore
+ }
}
$tar->close();
$styleEditor = StyleHandler::getInstance()->getStyleByName($this->installation->getPackageName(), false);
// import style
- $style = StyleEditor::import($filename, $this->installation->getPackageID(), $styleEditor);
+ $style = StyleEditor::import($filename, $this->installation->getPackageID(), $styleEditor, !PACKAGE_ID);
// set style as default
if (isset($this->instruction['attributes']['default'])) {
}
// add google fonts
- if (!empty($variables['wcfFontFamilyGoogle'])) {
+ if (!empty($variables['wcfFontFamilyGoogle']) && PACKAGE_ID) {
$cssFile = FontManager::getInstance()->getCssFilename(substr($variables['wcfFontFamilyGoogle'], 1, -1));
if (is_readable($cssFile)) {
$content .= file_get_contents($cssFile);