From: Matthias Schmidt Date: Sun, 14 Oct 2012 19:58:28 +0000 (+0200) Subject: Fixes style editor X-Git-Tag: 2.0.0_Beta_1~870^2~8^2^2~1 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=d95ca476ed2710bfd8a38afa61bd2007006939ff;p=GitHub%2FWoltLab%2FWCF.git Fixes style editor Fixes `wcf\data\style\StyleEditor::resetCache()`, removes obsolete imports and obsolete methods. --- diff --git a/wcfsetup/install/files/lib/data/style/StyleEditor.class.php b/wcfsetup/install/files/lib/data/style/StyleEditor.class.php index 230cbd0748..c9a6fee229 100644 --- a/wcfsetup/install/files/lib/data/style/StyleEditor.class.php +++ b/wcfsetup/install/files/lib/data/style/StyleEditor.class.php @@ -1,7 +1,5 @@ $variables */ public function setVariables(array $variables = array()) { + debug($variables); // delete old variables $sql = "DELETE FROM wcf".WCF_N."_style_variable_value WHERE styleID = ?"; @@ -825,7 +823,7 @@ class StyleEditor extends DatabaseObjectEditor implements IEditableCachedObject * @see wcf\data\IEditableCachedObject::resetCache() */ public static function resetCache() { - CacheHandler::getInstance()->clear(WCF_DIR.'cache', 'cache.icon-*-*.php'); + CacheHandler::getInstance()->clear(WCF_DIR.'cache', 'cache.styles.php'); } /** @@ -839,34 +837,4 @@ class StyleEditor extends DatabaseObjectEditor implements IEditableCachedObject $thumbnail = $adapter->createThumbnail(Style::PREVIEW_IMAGE_MAX_WIDTH, Style::PREVIEW_IMAGE_MAX_HEIGHT); $adapter->writeImage($thumbnail, $filename); } - - private static $variables = array(); - private static function parseAdditionalStyles(&$variables) { - self::$variables = $variables; - // fix images location - if (!empty(self::$variables['global.images.location']) && !FileUtil::isURL(self::$variables['global.images.location']) && substr(self::$variables['global.images.location'], 0, 1) != '/') { - self::$variables['global.images.location'] = '../'.self::$variables['global.images.location']; - } - // fix images location - if (!empty(self::$variables['global.icons.location']) && !FileUtil::isURL(self::$variables['global.icons.location']) && substr(self::$variables['global.icons.location'], 0, 1) != '/') { - self::$variables['global.icons.location'] = '../'.self::$variables['global.icons.location']; - } - - // parse additional styles - if (!empty($variables['user.additional.style.input1.use'])) { - $variables['user.additional.style.input1.use'] = preg_replace_callback('/\$([a-z0-9_\-\.]+)\$/', array('self', 'parseAdditionalStylesCallback'), $variables['user.additional.style.input1.use']); - } - if (!empty($variables['user.additional.style.input2.use'])) { - $variables['user.additional.style.input2.use'] = preg_replace_callback('/\$([a-z0-9_\-\.]+)\$/', array('self', 'parseAdditionalStylesCallback'), $variables['user.additional.style.input2.use']); - } - } - - private static function parseAdditionalStylesCallback($match) { - if (isset(self::$variables[$match[1]])) { - return self::$variables[$match[1]]; - } - else { - return $match[0]; - } - } }