diff --git a/.editorconfig b/.editorconfig index c1f1fab907..b3c4664854 100644 --- a/.editorconfig +++ b/.editorconfig @@ -7,11 +7,8 @@ end_of_line = lf insert_final_newline = true trim_trailing_whitespace = true charset = utf-8 - -[*.{js,php,twig,phtml,json,css}] indent_style = space indent_size = 4 -[{*.sql,package.json,.travis.yml}] -indent_style = space +[{*.{sql,scss,css},package.json,.travis.yml}] indent_size = 2 diff --git a/libraries/classes/Theme.php b/libraries/classes/Theme.php index 2351eb7131..7eb5dbf727 100644 --- a/libraries/classes/Theme.php +++ b/libraries/classes/Theme.php @@ -378,31 +378,18 @@ class Theme { $success = true; - /* Variables to be used by the themes: */ - $theme = $this; - if ($GLOBALS['text_dir'] === 'ltr') { - $right = 'right'; - $left = 'left'; + $file = $GLOBALS['text_dir'] === 'rtl' ? '/css/theme-rtl.css' : '/css/theme.css'; + $path = $this->getPath() . $file; + $fallback = './themes/' . ThemeManager::FALLBACK_THEME . $file; + + if (is_readable($path)) { + include $path; + } elseif (is_readable($fallback)) { + include $fallback; } else { - $right = 'left'; - $left = 'right'; + $success = false; } - foreach ($this->_cssFiles as $file) { - $path = $this->getPath() . "/css/$file.css.php"; - $fallback = "./themes/" - . ThemeManager::FALLBACK_THEME . "/css/$file.css.php"; - - if (is_readable($path)) { - echo "\n/* FILE: " , $file , ".css.php */\n"; - include $path; - } elseif (is_readable($fallback)) { - echo "\n/* FILE: " , $file , ".css.php */\n"; - include $fallback; - } else { - $success = false; - } - } return $success; } diff --git a/libraries/classes/ThemeManager.php b/libraries/classes/ThemeManager.php index 86ffda0549..89ee24d2b0 100644 --- a/libraries/classes/ThemeManager.php +++ b/libraries/classes/ThemeManager.php @@ -121,7 +121,7 @@ class ThemeManager /** * Returns the singleton Response object * - * @return Response object + * @return ThemeManager object */ public static function getInstance() { diff --git a/test/classes/ThemeTest.php b/test/classes/ThemeTest.php index 5c578859ea..6c47e0094d 100644 --- a/test/classes/ThemeTest.php +++ b/test/classes/ThemeTest.php @@ -148,7 +148,6 @@ class ThemeTest extends PmaTestCase $out = ob_get_contents(); ob_end_clean(); $this->assertTrue($ret); - $this->assertContains('FILE: navigation.css.php', $out); $this->assertContains('.ic_b_bookmark', $out); }