From 448a5a29db4db81ac7aa8644f60d62480bd638d8 Mon Sep 17 00:00:00 2001 From: Marcel Werk Date: Tue, 11 Mar 2014 15:46:55 +0100 Subject: [PATCH] Fixed multiple RTL issues --- .../files/lib/util/StyleUtil.class.php | 26 +++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/wcfsetup/install/files/lib/util/StyleUtil.class.php b/wcfsetup/install/files/lib/util/StyleUtil.class.php index a3677fca04..30090e4a21 100644 --- a/wcfsetup/install/files/lib/util/StyleUtil.class.php +++ b/wcfsetup/install/files/lib/util/StyleUtil.class.php @@ -46,6 +46,23 @@ final class StyleUtil { $contents = str_replace('border-right-width:', 'border-left-width:', $contents); $contents = str_replace('wcf-border-left-width:', 'border-right-width:', $contents); + // border-style + $contents = preg_replace('/border-style:\s*([^\s;\}]+)\s+([^\s;\}]+)\s+([^\s;\}]+)\s+([^\s;\}]+)/', 'border-style:\\1 \\4 \\3 \\2', $contents); + + // (border-left-style, border-right-style) + $contents = str_replace('border-left-style:', 'wcf-border-left-style:', $contents); + $contents = str_replace('border-right-style:', 'border-left-style:', $contents); + $contents = str_replace('wcf-border-left-style:', 'border-right-style:', $contents); + + // border-color + $contents = preg_replace('/border-color:\s*(rgba?\(.*?\))\s+(rgba?\(.*?\))\s+(rgba?\(.*?\))\s+(rgba?\(.*?\))/', 'border-color:\\1 \\4 \\3 \\2', $contents); + $contents = preg_replace('/border-color:\s*([^\s;\}]+)\s+([^\s;\}]+)\s+([^\s;\}]+)\s+([^\s;\}]+)/', 'border-color:\\1 \\4 \\3 \\2', $contents); + + // (border-left-color, border-right-color) + $contents = str_replace('border-left-color:', 'wcf-border-left-color:', $contents); + $contents = str_replace('border-right-color:', 'border-left-color:', $contents); + $contents = str_replace('wcf-border-left-color:', 'border-right-color:', $contents); + // clear $contents = preg_replace('/clear:\s*left/', 'wcf-clear:left', $contents); $contents = preg_replace('/clear:\s*right/', 'clear:left', $contents); @@ -72,6 +89,15 @@ final class StyleUtil { // text-shadow $contents = preg_replace('/text-shadow:\s*(\d)/', 'text-shadow:-\\1', $contents); + // border-radius + $contents = preg_replace('/border-radius:\s*([^\s;\}]+)\s+([^\s;\}]+)\s+([^\s;\}]+)\s+([^\s;\}]+)/', 'border-radius:\\2 \\1 \\4 \\3', $contents); + $contents = str_replace('border-top-left-radius:', 'wcf-border-top-left-radius:', $contents); + $contents = str_replace('border-top-right-radius:', 'border-top-left-radius:', $contents); + $contents = str_replace('wcf-border-top-left-radius:', 'border-top-right-radius:', $contents); + $contents = str_replace('border-bottom-left-radius:', 'wcf-border-bottom-left-radius:', $contents); + $contents = str_replace('border-bottom-right-radius:', 'border-bottom-left-radius:', $contents); + $contents = str_replace('wcf-border-bottom-left-radius:', 'border-bottom-right-radius:', $contents); + return $contents; } -- 2.20.1