Topic-icon Logout button to text

Active Subscriptions:

None
10 years 6 months ago #37495 by Andyt78
Hi thanks for this extension, I have installed SCLogin v3.1.2 some days ago and I'm really happy with it. I have read on the changelog v3.1.0 that you “Add option for text logout (instead of button)”. Where can I find the option to change it?
The topic has been locked.
Support Specialist
10 years 6 months ago #37500 by alzander
Replied by alzander on topic Logout button to text
Ah... that line item is a little confusing. The Logout button that shows right now can't be changed (with a setting at least.. I can help you do so, if you want with a little code though).

The changelog note actually refers to the ability to create a direct logout link from a menu item, if you're using the "User Menu" option in SCLogin. If you're using a User Menu, then you can create a menu item of type "External Link" and use the url of "sclogout". Once you do that, the logout menu item in the User Menu will be a direct logout link instead of a link to the logout page where the user has to click another logout button.

I hope that helps explain, but if not, let me know.

Thanks,
Alex
The topic has been locked.
Active Subscriptions:

None
10 years 6 months ago #37569 by Andyt78
Replied by Andyt78 on topic Logout button to text
Ok, thanks. I tried the "User Menu" solution but it's not exactly whath I expected. If it’s possible I would to go with your code proposal.
The topic has been locked.
Support Specialist
10 years 6 months ago #37594 by alzander
Replied by alzander on topic Logout button to text
No problem. To make the logout button a link instead of button, edit the /modules/mod_sclogin/tmpl/logout.php file. Around line 29, you'll see the following block:
<form action="<?php echo JRoute::_('index.php', true, $params->get('usesecure'));?>" method="post" id="sclogin-form">
                <div class="logout-button" id="scLogoutButton">
                    <input type="submit" name="Submit" class="button btn btn-primary" value="<?php echo JText::_('JLOGOUT');?>" />
                    <input type="hidden" name="option" value="com_users" />
                    <input type="hidden" name="task" value="user.logout" />
                    <input type="hidden" name="return" value="<?php echo $jLogoutUrl;?>" />
                    <?php echo JHtml::_('form.token')?>
                </div>
            </form>
Replace that entire block with:
<?php echo '<a href="'.JRoute::_('index.php?option=com_users&'.JSession::getFormToken() .'=1&task=user.logout&return='.$jLogoutUrl, true, $useSecure) . '">'.JText::_('JLOGOUT').'</a>'; ?>
I hope that helps,
Alex
The topic has been locked.
Active Subscriptions:

None
10 years 6 months ago #37618 by Andyt78
Replied by Andyt78 on topic Logout button to text
Hey, great job! It works. Thanks for support!
The topic has been locked.
Support Specialist
10 years 6 months ago #37634 by alzander
Replied by alzander on topic Logout button to text
No problem! It's what we're here for, and I'm glad we could get that going for you. If you need anything else, just let me know.

Finally, if you haven't already, please consider leaving a rating and review for SCLogin, or our support, on the Joomla Extension Directory. It certainly isn't required, but is very appreciated:
extensions.joomla.org/extensions/access-...authentication/24054

Thanks,
Alex
The topic has been locked.