Skip to content

Commit

Permalink
### Version 1.8.0-dev ###
Browse files Browse the repository at this point in the history
<strong>Neu:</strong>
* Multidomainfähigkeit: Es können nun pro in YRewrite angelegter Domain verschiedene Profile für das Backend  angelegt werden. Unterschiedliche Domains können nun also auch im Backend unterschiedlich aussehen.
 Beispiel: Wenn man als Redaxo-User*in im Backend unter <code>domain1.de/redaxo</code> eingeloggt ist, so kann dieses Backend ein anderes Branding bekommen als z.B. <code>domain2.de/redaxo</code>.
Es werden auch die Backend-Favicons entsprechend des Profils gefärbt und der Frontend-Link im Header über be_style/customizer wird ebenfalls angepasst.
* Favicon-Einstellungen pro Domain werden nun übersichtlicher in Tabs dargestellt.

<strong>Fixed:</strong>
* Logo des Projekts wird bei Installation im Unterordner jetzt korrekt angezeigt [@aeberhard](https://github.com/aeberhard)
#31
  • Loading branch information
danspringer committed Oct 11, 2022
1 parent b9e0fac commit 1314d04
Show file tree
Hide file tree
Showing 10 changed files with 604 additions and 179 deletions.
18 changes: 18 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,10 @@ Folgende Optionen für den Hintergrund des Login-Screens stehen zur Verfügung:
* Farbverlauf aus Primärfarbe und Sekundärfarbe
* Das Standard-Hintergrundbild von REDAXO

### Multidomainfähigkeit mit YRewrite ###
Wenn in YRewrite mehrere Domains angelegt sind, hat man im Backend Branding Addon die Möglichkeit, auch das Backend der jeweiligen Domain individuell darzustellen.
Hierzu aktiviert man unter <code>Backend Branding > Konfiguration</code> die <strong>Domainprofile</strong>. Anschließend stehen unter Backend Branding für die verfügbaren Domains unterschiedliche Profile für das Backend zur Verfügung.
So kann ein Backend für Domain A (<code>domain-a.de/redaxo</code>) anders aussehen als ein Backend von Domain B (<code>domain-b.de/redaxo</code>), obwohl beides unter einer REDAXO-Installation läuft.

### Backend individualisieren ###
Das AddOn bietet die Möglichkeit, das Aussehen von REDAXO im Backend anzupassen, um es so stärker individualisieren zu können. Dies eignet sich, um bei Kundenprojekten näher an der CI zu sein oder um unterschiedliche REDAXo-Installationen optisch leichter unterscheiden zu können.<br>
Expand All @@ -46,6 +50,20 @@ Um die Favicons im Template einzubinden wird folgender PHP-Code im <code>head</c

Last Changes
-------
### Version 1.8.0 ###

=== 11.10.2022 ===

<strong>Neu:</strong>
* Multidomainfähigkeit: Es können nun pro in YRewrite angelegter Domain verschiedene Profile für das Backend angelegt werden. Unterschiedliche Domains können nun also auch im Backend unterschiedlich aussehen.
Beispiel: Wenn man als Redaxo-User*in im Backend unter <code>domain1.de/redaxo</code> eingeloggt ist, so kann dieses Backend ein anderes Branding bekommen als z.B. <code>domain2.de/redaxo</code>.
Es werden auch die Backend-Favicons entsprechend des Profils gefärbt und der Frontend-Link im Header über be_style/customizer wird ebenfalls angepasst.
* Favicon-Einstellungen pro Domain werden nun übersichtlicher in Tabs dargestellt.

<strong>Fixed:</strong>
* Logo des Projekts wird bei Installation im Unterordner jetzt korrekt angezeigt [@aeberhard](https://github.com/aeberhard)
https://github.com/danspringer/be_branding/issues/31

### Version 1.7.1 ###

=== 12.08.2022 ===
Expand Down
82 changes: 45 additions & 37 deletions boot.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,15 @@

// Im Backend
if (rex::isBackend()) {


if ($this->getConfig('file')) {
// Wenn nicht eingeloggt und Backend Logo einbinden
// Login-Screen hat kein Fragment für < R5.12, deshalb per Output-Filter
if (!rex::getUser()) {
rex_extension::register('OUTPUT_FILTER', function (rex_extension_point $ep) {
$suchmuster = array('<section class="rex-page-main-inner" id="rex-js-page-main">');
$ersetzen = array('<img src="' . be_branding::checkExtension($this->getConfig('file')) . '" class="img-responsive center-block" style="padding: 10px 0px 15px 0px; width: 370px;"/></a><section class="rex-page-main-inner" id="rex-js-page-main">');
$ersetzen = array('<img src="' . be_branding::checkExtension($this->getConfig('file'. be_branding::getCurrentBeDomainId(true) )) . '" class="img-responsive center-block" style="padding: 10px 0px 15px 0px; width: 370px;"/></a><section class="rex-page-main-inner" id="rex-js-page-main">');
$ep->setSubject(str_replace($suchmuster, $ersetzen, $ep->getSubject()));
}, rex_extension::LATE);
} // EoF if rex::isBackend() && !rex::getUser()
Expand All @@ -45,12 +46,12 @@

// SVGs abfangen
if ($this->getConfig('file2')) {
$imgSrc = be_branding::checkExtension($this->getConfig('file2'));
$imgSrc = be_branding::checkExtension($this->getConfig('file2'. be_branding::getCurrentBeDomainId(true)));
}

// Text und Bild vorhanden
if ($this->getConfig('textarea') != "" && $this->getConfig('file2') != "") {
$html_text = $this->getConfig('textarea');
if ($this->getConfig('textarea') != "" && $this->getConfig('file2'. be_branding::getCurrentBeDomainId(true)) != "") {
$html_text = $this->getConfig('textarea'. be_branding::getCurrentBeDomainId(true));
if ($this->getConfig('editor') == 'markitup markdown') {
$html_text = markitup::parseOutput('markdown', $html_text);
} elseif ($this->getConfig('editor') == 'markitup textile') {
Expand All @@ -60,7 +61,7 @@
$img_col = '<div class="col-md-6"><p><img src="' . $imgSrc . '" class="img-responsive" /></p></div>';
}
// Nur Text, kein Bild vorhanden
if ($this->getConfig('textarea') != "" && $this->getConfig('file2') == "") {
if ($this->getConfig('textarea') != "" && $this->getConfig('file2'. be_branding::getCurrentBeDomainId(true)) == "") {
$html_text = $this->getConfig('textarea');
if ($this->getConfig('editor') == 'markitup') {
$html_text = markitup::parseOutput('markdown', $html_text);
Expand All @@ -69,15 +70,15 @@
$img_col = '';
}
// Nur Bild, kein Text vorhanden
if ($this->getConfig('textarea') == "" && $this->getConfig('file2') != "") {
if ($this->getConfig('textarea') == "" && $this->getConfig('file2'. be_branding::getCurrentBeDomainId(true)) != "") {
$text_col = '';
$img_col = '<div class="col-md-12"><p><img src="' . $imgSrc . '" class="img-responsive" /></p></div>';
}

$html_append = '
<section class="rex-page-section">
<div class="panel panel-default">
<header class="panel-heading"><div class="panel-title">' . $this->getConfig('agency') . '</div></header>
<header class="panel-heading"><div class="panel-title">' . $this->getConfig('agency'. be_branding::getCurrentBeDomainId(true)) . '</div></header>
<div class="panel-body">
<div class="row">
' . $text_col . '
Expand All @@ -97,20 +98,20 @@
}

//Farben für das REDAXO-Logo anpassen
if ($this->getConfig('color1') && $this->getConfig('color2')) {
if ($this->getConfig('color1'. be_branding::getCurrentBeDomainId(true)) && $this->getConfig('color2'. be_branding::getCurrentBeDomainId(true))) {
rex_extension::register('OUTPUT_FILTER', function (rex_extension_point $ep) {
$suchmuster = '</head>';
$ersetzen = '<style>
.rex-nav-top .navbar{
background-color: ' . $this->getConfig('color1') . ' !important;
background-color: ' . $this->getConfig('color1'. be_branding::getCurrentBeDomainId(true)) . ' !important;
}
.rex-redaxo-logo path.rex-redaxo-logo-r,
.rex-redaxo-logo path.rex-redaxo-logo-e,
.rex-redaxo-logo path.rex-redaxo-logo-d,
.rex-redaxo-logo path.rex-redaxo-logo-cms{fill: ' . $this->getConfig('color2') . ' !important;}
.rex-redaxo-logo path.rex-redaxo-logo-cms{fill: ' . $this->getConfig('color2'. be_branding::getCurrentBeDomainId(true)) . ' !important;}
.rex-nav-meta .text-muted {color: ' . $this->getConfig('color2') . ' !important;}
.rex-nav-meta .text-muted {color: ' . $this->getConfig('color2'. be_branding::getCurrentBeDomainId(true)) . ' !important;}
.rex-redaxo-logo path.rex-redaxo-logo-a,
.rex-redaxo-logo path.rex-redaxo-logo-x,
Expand All @@ -122,52 +123,52 @@
if(rex_addon::get('watson')->isAvailable()){
$ersetzen .= '
.watson-btn svg {
color: ' . $this->getConfig('color2') . ';
color: ' . $this->getConfig('color2'. be_branding::getCurrentBeDomainId(true)) . ';
padding-top: 8px;
}';
}
# Bissle Farbe im Login Screen ab REX 5.12
if (rex_string::versionCompare(rex::getVersion(), '5.12', '>=')) {

$panel_bg = rex_addon::get('be_branding')->getConfig('color1');
if (rex_addon::get('be_branding')->getConfig('color1')) {
$panel_bg = rex_addon::get('be_branding')->getConfig('color1'. be_branding::getCurrentBeDomainId(true));
if (rex_addon::get('be_branding')->getConfig('color1'. be_branding::getCurrentBeDomainId(true))) {
$panel_bg = str_replace(', 1)', ', 0.8)', $panel_bg);
}

$rex_page_login = '
#rex-page-login {
background-color: ' . $this->getConfig('color2') . ' !important;
background-color: ' . $this->getConfig('color2'. be_branding::getCurrentBeDomainId(true)) . ' !important;
}
';

// Wenn eigenes BG-Bild
if (rex_addon::get('be_branding')->getConfig('login_bg') && rex_addon::get('be_branding')->getConfig('login_bg_setting') == "own_bg") {
if (rex_addon::get('be_branding')->getConfig('login_bg'. be_branding::getCurrentBeDomainId(true)) && rex_addon::get('be_branding')->getConfig('login_bg_setting'. be_branding::getCurrentBeDomainId(true)) == "own_bg") {
$rex_page_login = '
#rex-page-login {
background-color: ' . $this->getConfig('color2') . ' !important;
background-color: ' . $this->getConfig('color2'. be_branding::getCurrentBeDomainId(true)) . ' !important;
}
@media (max-width: 991px) {
#rex-page-login {
background-image: url("' . rex_media_manager::getUrl('be_branding_login_2100_jpg', rex_addon::get('be_branding')->getConfig('login_bg')) . '");
background-image: url("' . rex_media_manager::getUrl('be_branding_login_2100_jpg', rex_addon::get('be_branding')->getConfig('login_bg'. be_branding::getCurrentBeDomainId(true))) . '");
background-size: cover;
}
}';
}

// Wenn REDAXO-Standard
if (rex_addon::get('be_branding')->getConfig('login_bg_setting') == "redaxo_standard_bg") {
if (rex_addon::get('be_branding')->getConfig('login_bg_setting'. be_branding::getCurrentBeDomainId(true)) == "redaxo_standard_bg") {
$rex_page_login = '
#rex-page-login {
background-color: ' . $this->getConfig('color2') . ' !important;
background-color: ' . $this->getConfig('color2'. be_branding::getCurrentBeDomainId(true)) . ' !important;
}
';
}

// Wenn Primärfarbe
if (rex_addon::get('be_branding')->getConfig('login_bg_setting') == "primary_bg") {
if (rex_addon::get('be_branding')->getConfig('login_bg_setting'. be_branding::getCurrentBeDomainId(true)) == "primary_bg") {
$rex_page_login = '
#rex-page-login {
background-color: ' . $this->getConfig('color1') . ' !important;
background-color: ' . $this->getConfig('color1'. be_branding::getCurrentBeDomainId(true)) . ' !important;
}
';
// Panel in transp. wess, damit man es noch sieht
Expand All @@ -177,23 +178,23 @@
}

// Wenn Sekundärfarbe
if (rex_addon::get('be_branding')->getConfig('login_bg_setting') == "secondary_bg") {
if (rex_addon::get('be_branding')->getConfig('login_bg_setting'. be_branding::getCurrentBeDomainId(true)) == "secondary_bg") {
$rex_page_login = '
#rex-page-login {
background-color: ' . $this->getConfig('color2') . ' !important;
background-color: ' . $this->getConfig('color2'. be_branding::getCurrentBeDomainId(true)) . ' !important;
}
';
}

// Wenn Verlauf
if (rex_addon::get('be_branding')->getConfig('login_bg_setting') == "gradient_bg") {
if (rex_addon::get('be_branding')->getConfig('login_bg_setting'. be_branding::getCurrentBeDomainId(true)) == "gradient_bg") {
$rex_page_login = '
#rex-page-login {
background: ' . $this->getConfig('color2') . ';
background: -moz-linear-gradient(71deg, ' . $this->getConfig('color1') . ') 0%, ' . $this->getConfig('color2') . ' 100%);
background: -webkit-linear-gradient(71deg, ' . $this->getConfig('color1') . ' 0%, ' . $this->getConfig('color2') . ' 100%);
background: linear-gradient(71deg, ' . $this->getConfig('color1') . ' 0%, ' . $this->getConfig('color2') . ' 100%);
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr="' . be_branding::rgba2hex($this->getConfig('color1')) . '",endColorstr="' . be_branding::rgba2hex($this->getConfig('color2')) . '",GradientType=1);
background: ' . $this->getConfig('color2'. be_branding::getCurrentBeDomainId(true)) . ';
background: -moz-linear-gradient(71deg, ' . $this->getConfig('color1'. be_branding::getCurrentBeDomainId(true)) . ') 0%, ' . $this->getConfig('color2') . ' 100%);
background: -webkit-linear-gradient(71deg, ' . $this->getConfig('color1'. be_branding::getCurrentBeDomainId(true)) . ' 0%, ' . $this->getConfig('color2') . ' 100%);
background: linear-gradient(71deg, ' . $this->getConfig('color1'. be_branding::getCurrentBeDomainId(true)) . ' 0%, ' . $this->getConfig('color2'. be_branding::getCurrentBeDomainId(true)) . ' 100%);
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr="' . be_branding::rgba2hex($this->getConfig('color1'. be_branding::getCurrentBeDomainId(true))) . '",endColorstr="' . be_branding::rgba2hex($this->getConfig('color2'. be_branding::getCurrentBeDomainId(true))) . '",GradientType=1);
}
';
}
Expand All @@ -206,12 +207,12 @@
#rex-form-login .rex-redaxo-logo path.rex-redaxo-logo-r,
#rex-form-login .rex-redaxo-logo path.rex-redaxo-logo-e,
#rex-form-login .rex-redaxo-logo path.rex-redaxo-logo-d,
#rex-form-login .rex-redaxo-logo path.rex-redaxo-logo-cms{fill: ' . $this->getConfig('color2') . ' !important;}
#rex-form-login .rex-redaxo-logo path.rex-redaxo-logo-cms{fill: ' . $this->getConfig('color2'. be_branding::getCurrentBeDomainId(true)) . ' !important;}
#rex-page-login .panel-default {
background-color: ' . $panel_bg . ';
border: 0;
color: ' . $this->getConfig('color2') . ';
color: ' . $this->getConfig('color2'. be_branding::getCurrentBeDomainId(true)) . ';
border-radius: 5px;}
#rex-page-login .form-control {
Expand All @@ -224,23 +225,30 @@
#rex-page-login .input-group-addon,
#rex-page-login .input-group-btn .btn-view {
background-color: ' . $panel_bg . ' !important;
color: ' . $this->getConfig('color2') . ' !important;
color: ' . $this->getConfig('color2'. be_branding::getCurrentBeDomainId(true)) . ' !important;
border: none !important;
}
#rex-page-login .btn-primary {
background-color: ' . $this->getConfig('color2') . ' !important;
color: ' . $this->getConfig('color1') . ' !important;
border-color:' . $this->getConfig('color1') . ' !important;
background-color: ' . $this->getConfig('color2'. be_branding::getCurrentBeDomainId(true)) . ' !important;
color: ' . $this->getConfig('color1'. be_branding::getCurrentBeDomainId(true)) . ' !important;
border-color:' . $this->getConfig('color1'. be_branding::getCurrentBeDomainId(true)) . ' !important;
}
';
} // End Rex 5.12

$ersetzen .= '#rex-page-login .rex-page-main:before{border-color: ' . $this->getConfig('color1') . ' transparent transparent transparent !important; top: -1px !important;}
$ersetzen .= '#rex-page-login .rex-page-main:before{border-color: ' . $this->getConfig('color1'. be_branding::getCurrentBeDomainId(true)) . ' transparent transparent transparent !important; top: -1px !important;}
</style></head>';
$ep->setSubject(str_replace($suchmuster, $ersetzen, $ep->getSubject()));
}, rex_extension::LATE);
} // EoF Farben

// Fuer den Customizer den PageName und Link im Header auf die aktuelle Domain ändern
if (rex_plugin::get('be_style','customizer')->getConfig('showlink') && $this->getConfig('domainprofiles_enabled')) {
rex_view::setJsProperty(
'customizer_showlink',
'<h1 class="be-style-customizer-title"><a href="'. be_branding::getDomainById(be_branding::getCurrentBeDomainId(false))['domain'] .'" target="_blank" rel="noreferrer noopener"><span class="be-style-customizer-title-name">' . be_branding::getDomainById(be_branding::getCurrentBeDomainId(false))['domain'] . '</span><i class="fa fa-external-link"></i></a></h1>'
);
}

} // EoF if rex Backend
12 changes: 6 additions & 6 deletions fragments/core/login_background.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,14 @@
$login_bg_2100_jpg = rex_url::pluginAssets('be_style', 'redaxo', 'images/jr-korpa-9XngoIpxcEo-unsplash_2100.jpg');
$login_bg_3300_jpg = rex_url::pluginAssets('be_style', 'redaxo', 'images/jr-korpa-9XngoIpxcEo-unsplash_3300.jpg');

if(rex_addon::get('be_branding')->getConfig('login_bg') && rex_addon::get('be_branding')->getConfig('login_bg_setting') == "own_bg") {
if(rex_addon::get('be_branding')->getConfig('login_bg'.be_branding::getCurrentBeDomainId(true)) && rex_addon::get('be_branding')->getConfig('login_bg_setting'.be_branding::getCurrentBeDomainId(true)) == "own_bg") {
$fileType = 'webp';
$login_bg_2100_webp = rex_media_manager::getUrl('be_branding_login_2100_webp', rex_addon::get('be_branding')->getConfig('login_bg'));
$login_bg_3300_webp = rex_media_manager::getUrl('be_branding_login_3300_webp', rex_addon::get('be_branding')->getConfig('login_bg'));
$login_bg_2100_jpg = rex_media_manager::getUrl('be_branding_login_2100_jpg', rex_addon::get('be_branding')->getConfig('login_bg'));
$login_bg_3300_jpg = rex_media_manager::getUrl('be_branding_login_3300_jpg', rex_addon::get('be_branding')->getConfig('login_bg'));
$login_bg_2100_webp = rex_media_manager::getUrl('be_branding_login_2100_webp', rex_addon::get('be_branding')->getConfig('login_bg'.be_branding::getCurrentBeDomainId(true)));
$login_bg_3300_webp = rex_media_manager::getUrl('be_branding_login_3300_webp', rex_addon::get('be_branding')->getConfig('login_bg'.be_branding::getCurrentBeDomainId(true)));
$login_bg_2100_jpg = rex_media_manager::getUrl('be_branding_login_2100_jpg', rex_addon::get('be_branding')->getConfig('login_bg'.be_branding::getCurrentBeDomainId(true)));
$login_bg_3300_jpg = rex_media_manager::getUrl('be_branding_login_3300_jpg', rex_addon::get('be_branding')->getConfig('login_bg'.be_branding::getCurrentBeDomainId(true)));
}
if(rex_addon::get('be_branding')->getConfig('login_bg_setting') == "own_bg" || rex_addon::get('be_branding')->getConfig('login_bg_setting') == "redaxo_standard_bg") {
if(rex_addon::get('be_branding')->getConfig('login_bg_setting'.be_branding::getCurrentBeDomainId(true)) == "own_bg" || rex_addon::get('be_branding')->getConfig('login_bg_setting'.be_branding::getCurrentBeDomainId(true)) == "redaxo_standard_bg") {
?>
<picture class="rex-background">
<source
Expand Down
2 changes: 1 addition & 1 deletion fragments/core/navigation.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<div>
<?php
if (rex_addon::get('be_branding')->getConfig('file')) {
echo '<img src="' . be_branding::checkExtension(rex_addon::get('be_branding')->getConfig('file')) . '" class="img-responsive center-block" style="padding: 20px 10px 5px 10px; width: 100%;"/></a>';
echo '<img src="' . be_branding::checkExtension(rex_addon::get('be_branding')->getConfig('file'.be_branding::getCurrentBeDomainId(true))) . '" class="img-responsive center-block" style="padding: 20px 10px 5px 10px; width: 100%;"/></a>';
}
echo $this->navigation;
?>
Expand Down
Loading

0 comments on commit 1314d04

Please sign in to comment.