<pip name="packageIcon">wcf\system\package\plugin\PackageIconPackageInstallationPlugin</pip>
<pip name="sitemap">wcf\system\package\plugin\SitemapPackageInstallationPlugin</pip>
<pip name="acpSearchProvider">wcf\system\package\plugin\ACPSearchProviderPackageInstallationPlugin</pip>
+ <pip name="style">wcf\system\package\plugin\StylePackageInstallationPlugin</pip>
</import>
</data>
<?php
namespace wcf\data\style;
-use wcf\system\package\PackageArchive;
-
use wcf\data\package\Package;
use wcf\data\template\group\TemplateGroup;
use wcf\data\template\group\TemplateGroupEditor;
use wcf\system\io\File;
use wcf\system\io\Tar;
use wcf\system\io\TarWriter;
+use wcf\system\package\PackageArchive;
use wcf\system\style\StyleCompiler;
use wcf\system\Regex;
use wcf\system\WCF;
// scale preview image
if (!empty($parameters['image']) && $parameters['image'] != $this->image) {
- self::scalePreviewImage(WCF_DIR.$parameters['image']);
+ self::scalePreviewImage($parameters['image']);
}
}
$tar->extract($index, $filename);
@chmod($filename, 0777);
- $style->update(array('image' => $filename));
+ if (file_exists($filename)) {
+ $style->update(array('image' => $filename));
+ }
}
}
unset($string);
// create variable list
- $string = "<?xml version=\"1.0\" encoding=\"UTF-8\" ?>\n<styleVariable xmlns=\"http://www.woltlab.com\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:schemaLocation=\"http://www.woltlab.com http://www.woltlab.com/XSD/maelstrom/styleVariable.xsd\">\n";
+ $string = "<?xml version=\"1.0\" encoding=\"UTF-8\" ?>\n<variables xmlns=\"http://www.woltlab.com\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:schemaLocation=\"http://www.woltlab.com http://www.woltlab.com/XSD/maelstrom/styleVariable.xsd\">\n";
// get variables
$sql = "SELECT variable.variableName, value.variableValue
*/
public static function scalePreviewImage($filename) {
$adapter = ImageHandler::getInstance()->getAdapter();
- $adapter->load($filename);
+ $adapter->loadFile($filename);
$thumbnail = $adapter->createThumbnail(Style::PREVIEW_IMAGE_MAX_WIDTH, Style::PREVIEW_IMAGE_MAX_HEIGHT);
$adapter->writeImage($thumbnail, $filename);
}