cosmocode / dokuwiki-plugin-oauth

Generic oAuth1 and oAuth2 plugin for DokuWiki
http://www.dokuwiki.org/plugin:oauth
30 stars 78 forks source link

Configuring loginButton text #124

Closed sknolin closed 2 years ago

sknolin commented 2 years ago

I'm attempting to set the text that's on the loginbutton.

I see there's a lang.php setting here for $lang['loginButton'] but that does not affect this for me.

The Adapter.php sets it via $this->getLabel()

    public function loginButton()
    {
        global $ID;

        $attr = buildAttributes([
            'href' => wl($ID, array('oauthlogin' => $this->getServiceID()), false, '&'),
            'class' => 'plugin_oauth_' . $this->getServiceID(),
            'style' => 'background-color: ' . $this->getColor(),
        ]);

        return '<a ' . $attr . '>' . $this->getSvgLogo() . '<span>' . $this->getLabel() . '</span></a> ';
    }

getLabel does getServiceID - which in my case is 'keycloak'. That's descriptive but users don't know about what the backend is.

Am I looking in the wrong place for this?

Thank you.

splitbrain commented 2 years ago

Are you writing your own adapter? Then yes, implementing getLabel() is the right way to define the text of the login button.

sknolin commented 2 years ago

No, not writing my own adapter, I simply want to set that text. What does the lang.php entry here do?

$lang['loginButton'] = 'Log in with ';//... i.e. Google (on SingleAuth)

I can of course just hack some text into the loginButton function but was trying to avoid that.

Thanks again!

splitbrain commented 2 years ago

You should report your problem at the adapter plugin's bug tracker.