Skip to content

Commit

Permalink
BUGFIX: Utility text-color classes
Browse files Browse the repository at this point in the history
Set the utility text-color classes to the h-tag if available.
  • Loading branch information
t3solution authored Aug 5, 2020
1 parent 13dba0c commit 1c50a72
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions Classes/Helper/ClassHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -230,9 +230,21 @@ public function getGeClass($data, $flexconf, $isVideo, $extConf)
public function getHeaderClass($data)
{
$header['class'] = $data['header_position'] ? ' text-'.$data['header_position'] : '';
$header['class'] .= $data['tx_t3sbootstrap_header_class'] ? ' '.$data['tx_t3sbootstrap_header_class'] : '';
$header['hClass'] = '';

if ( $data['tx_t3sbootstrap_header_class'] ) {
$textColors = explode(',','text-primary,text-secondary,text-danger,text-success,text-warning,text-info,text-light,text-dark,text-body,text-muted,text-white');
foreach ($textColors as $textColor) {
if (strpos($data['tx_t3sbootstrap_header_class'], $textColor) !== false) {
$header['hClass'] .= $textColor;
$data['tx_t3sbootstrap_header_class'] = trim(str_replace($textColor, '', $data['tx_t3sbootstrap_header_class']));
break;
}
}
}

$header['hClass'] = $data['tx_t3sbootstrap_header_display'] ? ' '.$data['tx_t3sbootstrap_header_display'] : '';
$header['class'] .= $data['tx_t3sbootstrap_header_class'] ? ' '.$data['tx_t3sbootstrap_header_class'] : '';
$header['hClass'] .= $data['tx_t3sbootstrap_header_display'] ? ' '.$data['tx_t3sbootstrap_header_display'] : '';

if ( $data['CType'] == 't3sbs_mediaobject' ) {
$header['hClass'] .= ' mt-0';
Expand Down

0 comments on commit 1c50a72

Please sign in to comment.