Skip to content

Commit

Permalink
simplify
Browse files Browse the repository at this point in the history
  • Loading branch information
TranTheTrung authored Jun 9, 2021
1 parent cb395cb commit 51e53ba
Showing 1 changed file with 4 additions and 18 deletions.
22 changes: 4 additions & 18 deletions skins/Timeless/includes/TimelessTemplate.php
Original file line number Diff line number Diff line change
Expand Up @@ -179,9 +179,6 @@ protected function getPortlet( $name, $content, $msg = null, $setOptions = [] )
'id' => 'p-' . $name,
'class' => [ 'mw-portlet', 'emptyPortlet' => !$content ],
'extra-classes' => '',
'body-id' => null,
'body-class' => 'mw-portlet-body',
'body-extra-classes' => '',
// wrapper for individual list items
'text-wrapper' => [ 'tag' => 'span' ],
// option to stick arbitrary stuff at the beginning of the ul
Expand Down Expand Up @@ -245,27 +242,16 @@ protected function getPortlet( $name, $content, $msg = null, $setOptions = [] )
'dir' => $this->get( 'dir' )
];

$bodyDivOptions = [
'class' => $this->mergeClasses( $options['body-class'], $options['body-extra-classes'] )
];
if ( is_string( $options['body-id'] ) ) {
$bodyDivOptions['id'] = $options['body-id'];
}

if ( $name == 'navigation' ) {
$html = Html::rawElement( 'div', $divOptions,
Html::rawElement( 'div', $bodyDivOptions,
$contentText .
$this->getAfterPortlet( $name )
)
$contentText .
$this->getAfterPortlet( $name )
);
} else {
$html = Html::rawElement( 'div', $divOptions,
Html::rawElement( 'h3', $labelOptions, $msgString ) .
Html::rawElement( 'div', $bodyDivOptions,
$contentText .
$this->getAfterPortlet( $name )
)
$contentText .
$this->getAfterPortlet( $name )
);
}

Expand Down

0 comments on commit 51e53ba

Please sign in to comment.