Skip to content

Commit

Permalink
fix for login link
Browse files Browse the repository at this point in the history
  • Loading branch information
thaider committed Jun 14, 2021
1 parent 43ca2e4 commit d524825
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 9 deletions.
5 changes: 5 additions & 0 deletions includes/Hooks.php
Expand Up @@ -790,6 +790,11 @@ static function renderButtons( $buttons, $options = [] ) {
}

$button['class'] = implode( ' ', array_unique( $button['class'] ) );
if( isset( $button['links'] ) ) {
foreach( $button['links'] as &$link ) {
$link['class'] = $button['class'];
}
}

// set attributes
$allowed_attributes = [
Expand Down
21 changes: 12 additions & 9 deletions includes/TweekiTemplate.php
Expand Up @@ -595,9 +595,9 @@ protected function renderNavigation( $elements, $context = '' ) {
$divideditems['login']['links'][0]['text'] = wfMessage( 'tweeki-login' )->plain();
return [ $divideditems['login'] ];
}
if ( array_key_exists( 'anonlogin', $divideditems ) ) {
$divideditems['anonlogin']['links'][0]['text'] = wfMessage( 'tweeki-login' )->plain();
return [ $divideditems['anonlogin'] ];
if ( array_key_exists( 'login-private', $divideditems ) ) {
$divideditems['login-private']['links'][0]['text'] = wfMessage( 'tweeki-login' )->plain();
return [ $divideditems['login-private'] ];
}
if (count($items) > 0) {
return [[
Expand Down Expand Up @@ -629,7 +629,7 @@ protected function renderNavigation( $elements, $context = '' ) {
if ( array_key_exists( 'login', $divideditems ) ) {
return [ [ 'special' => 'LOGIN-EXT' ] ];
}
if ( array_key_exists( 'anonlogin', $divideditems ) ) {
if ( array_key_exists( 'login-private', $divideditems ) ) {
return [ [ 'special' => 'LOGIN-EXT' ] ];
}
if (count($items) > 0) {
Expand All @@ -649,9 +649,9 @@ protected function renderNavigation( $elements, $context = '' ) {
$items['login']['links'][0]['text'] = wfMessage( 'tweeki-login' )->plain();
return [ $items['login'] ];
}
if ( array_key_exists( 'anonlogin', $items ) ) {
$items['anonlogin']['links'][0]['text'] = wfMessage( 'tweeki-login' )->plain();
return [ $items['anonlogin'] ];
if ( array_key_exists( 'login-private', $items ) ) {
$items['login-private']['links'][0]['text'] = wfMessage( 'tweeki-login' )->plain();
return [ $items['login-private'] ];
}
return [];
break;
Expand Down Expand Up @@ -1253,14 +1253,17 @@ public function renderLoginExt( $skin, $context ) {
$this->getSkin()->getUser()->setCookies();

$dropdown['class'] = ' dropdown-toggle';
if( strpos( $context, 'navbar' ) === 0 ) {
$dropdown['class'] .= ' nav-link';
}
$dropdown['data-toggle'] = 'dropdown';
$dropdown['text'] = $this->getMsg( 'tweeki-login' )->text();
$dropdown['html'] = $dropdown['text'] . ' <b class="caret"></b>';
$dropdown['href'] = '#';
$dropdown['type'] = 'button';
$dropdown['id'] = 'n-login-ext';
$renderedDropdown = TweekiHooks::makeLink( $dropdown);
$wrapperclass = ( $context == 'footer' ) ? 'dropup' : 'nav';
$wrapperclass = ( $context == 'footer' ) ? 'dropup' : 'nav-item dropdown';

echo '<li class="' . $wrapperclass . '">
' . $renderedDropdown . '
Expand Down Expand Up @@ -1289,7 +1292,7 @@ public function renderLoginExt( $skin, $context ) {
] );
echo '</div>
<div class="form-group">
<button type="submit" name="wpLoginAttempt" tabindex="103" id="wpLoginAttempt2" class="pull-right btn btn-default btn-block">
<button type="submit" name="wpLoginAttempt" tabindex="103" id="wpLoginAttempt2" class="float-right btn btn-secondary btn-block">
' . $this->getMsg( 'pt-login-button' )->text() . '
</button>
</div>
Expand Down

3 comments on commit d524825

@krabina
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This fix does not work for me: I have now and "Anmelden / Registrieren" displayed in the navbar, but it is not cklickable.

@krabina
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It does work though in the footer.

@krabina
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And another thing: hovering over the Anmelden/Registrieren shows "Du musst dich anmelden, um dieses Wiki zu nutzen. [alt-shift-o]" even when the language is set to de-formal.

Please sign in to comment.