Prepare Theme class for Sass

Signed-off-by: Maurício Meneghini Fauth <mauriciofauth@gmail.com>
This commit is contained in:
Maurício Meneghini Fauth 2018-09-29 14:59:21 -03:00
parent dbf4819b76
commit 59eef96b97
4 changed files with 11 additions and 28 deletions

View File

@ -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

View File

@ -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;
}

View File

@ -121,7 +121,7 @@ class ThemeManager
/**
* Returns the singleton Response object
*
* @return Response object
* @return ThemeManager object
*/
public static function getInstance()
{

View File

@ -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);
}