Bläddra i källkod

Fix: dir=rtl (#6221)

* Update layout.phtml

* Update simple.phtml

* Update contentSelectorPreview.phtml
maTh 2 år sedan
förälder
incheckning
1c0b8a7dcd
3 ändrade filer med 16 tillägg och 5 borttagningar
  1. 3 2
      app/layout/layout.phtml
  2. 3 2
      app/layout/simple.phtml
  3. 10 1
      app/views/feed/contentSelectorPreview.phtml

+ 3 - 2
app/layout/layout.phtml

@@ -3,8 +3,9 @@
 	/** @var FreshRSS_View $this */
 	FreshRSS::preLayout();
 	$class = '';
+	$dir = '';
 	if (_t('gen.dir') === 'rtl') {
-		echo ' dir="rtl"';
+		$dir = ' dir="rtl"';
 		$class = 'rtl ';
 	}
 	if (FreshRSS_Context::userConf()->darkMode !== 'no') {
@@ -12,7 +13,7 @@
 	}
 ?>
 <!DOCTYPE html>
-<html lang="<?= FreshRSS_Context::userConf()->language ?>" xml:lang="<?= FreshRSS_Context::userConf()->language ?>" class="<?= $class ?>">
+<html lang="<?= FreshRSS_Context::userConf()->language ?>"<?= $dir ?> xml:lang="<?= FreshRSS_Context::userConf()->language ?>" class="<?= $class ?>">
 	<head>
 		<meta charset="UTF-8" />
 		<meta name="viewport" content="width=device-width, initial-scale=1.0, viewport-fit=cover" />

+ 3 - 2
app/layout/simple.phtml

@@ -3,8 +3,9 @@
 	/** @var FreshRSS_View $this */
 	FreshRSS::preLayout();
 	$class = '';
+	$dir = '';
 	if (_t('gen.dir') === 'rtl') {
-		echo ' dir="rtl"';
+		$dir = ' dir="rtl"';
 		$class = 'rtl ';
 	}
 	if (FreshRSS_Context::userConf()->darkMode !== 'no') {
@@ -12,7 +13,7 @@
 	}
 ?>
 <!DOCTYPE html>
-<html lang="<?= FreshRSS_Context::userConf()->language ?>" xml:lang="<?= FreshRSS_Context::userConf()->language ?>" class="<?= $class ?>">
+<html lang="<?= FreshRSS_Context::userConf()->language ?>"<?= $dir ?> xml:lang="<?= FreshRSS_Context::userConf()->language ?>" class="<?= $class ?>">
 	<head>
 		<meta charset="UTF-8" />
 		<meta name="viewport" content="width=device-width, initial-scale=1.0, viewport-fit=cover" />

+ 10 - 1
app/views/feed/contentSelectorPreview.phtml

@@ -2,9 +2,18 @@
 	declare(strict_types=1);
 	/** @var FreshRSS_View $this */
 	FreshRSS::preLayout();
+	$class = '';
+	$dir = '';
+	if (_t('gen.dir') === 'rtl') {
+		$dir = ' dir="rtl"';
+		$class = 'rtl ';
+	}
+	if (FreshRSS_Context::userConf()->darkMode !== 'no') {
+		$class .= 'darkMode_' . FreshRSS_Context::userConf()->darkMode;
+	}
 ?>
 <!DOCTYPE html>
-<html class="preview_background" lang="<?= FreshRSS_Context::userConf()->language ?>" xml:lang="<?= FreshRSS_Context::userConf()->language ?>">
+<html class="preview_background" lang="<?= FreshRSS_Context::userConf()->language ?>"<?= $dir ?> xml:lang="<?= FreshRSS_Context::userConf()->language ?>" class="<?= $class ?>">
 	<head>
 		<?= FreshRSS_View::headStyle() ?>
 		<script src="<?= Minz_Url::display('/scripts/preview.js?' . @filemtime(PUBLIC_PATH . '/scripts/preview.js')) ?>"></script>