forked from lkucharczyk/mediawiki-PortableInfobox
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Display images when group layout is horizontal
Remove the restriction to only show data nodes in a horizontal layout. Instead have it special case headers only, and then generically attempt to use a pre-rendered 'value' that data nodes have or ask for the node to be rendered to be displayed. Should handle issue lkucharczyk#48
- Loading branch information
Alex
committed
Dec 2, 2021
1 parent
4bd3503
commit 00b5056
Showing
1 changed file
with
8 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -266,21 +266,22 @@ private function createHorizontalGroupData( array $groupData ) { | |
|
||
foreach ( $groupData as $item ) { | ||
$data = $item['data']; | ||
$type = $item['type']; | ||
|
||
if ( $item['type'] === 'data' ) { | ||
if ( $type === 'header' ) { | ||
$horizontalGroupData['header'] = $data['value']; | ||
$horizontalGroupData['inlineStyles'] = $this->inlineStyles; | ||
}else{ | ||
This comment has been minimized.
Sorry, something went wrong. |
||
$horizontalGroupData['data'][] = [ | ||
'label' => $data['label'], | ||
'value' => $data['value'], | ||
'source' => $item['data']['source'] ?? "", | ||
'item-name' => $item['data']['item-name'] | ||
'value' => $data['value'] ?? $this->renderItem($type,$data), | ||
This comment has been minimized.
Sorry, something went wrong.
winstonsung
|
||
'source' => $data['source'] ?? "", | ||
'item-name' => $data['item-name'] | ||
]; | ||
|
||
if ( !empty( $data['label'] ) ) { | ||
$horizontalGroupData['renderLabels'] = true; | ||
} | ||
} elseif ( $item['type'] === 'header' ) { | ||
$horizontalGroupData['header'] = $data['value']; | ||
$horizontalGroupData['inlineStyles'] = $this->inlineStyles; | ||
} | ||
} | ||
|
||
|
Coding conventions: