Jump to content
brian!

v8 "Login As Owner" link - open in new tab/window hook

Recommended Posts

in v7 and earlier, you could right-click on the "Login As Client" link and open it in a new tab - useful if you need to see both admin and client areas at the same time.

in v8, "Login As Owner" now uses a form and you can't right-click on it to open a new tab... *sighs* 🙄

so the simple hook below will open that link in a new tab by default...

<?php

# Login As Owner Open In New Tab Hook
# Written by brian!

function admin_login_as_owner_hook($vars) {

	if ($vars['filename'] == 'clientssummary' && isset($_GET["userid"])) {
		return '<script>$("#frmLoginAsOwner").prop("target","_blank");</script>';
	}
}
add_hook("AdminAreaFooterOutput", 1, "admin_login_as_owner_hook");

you could edit the clientssummary.tpl template too and just add the target link to the form code.

Share this post


Link to post
Share on other sites
18 hours ago, Manchester Web Hosting said:

@brian! this seems to be adjusted in the recent v8.0.2 and now you can click the login as owner in admin client summary screen and right click. Or am I looking at the wrong one??

I suspect you're looking at the right one - but what I see occurring is..

  • if I click on the link, it opens the client area and logs in in the same tab (useless if I need to see the admin area at the same time).
  • if I right-click on the link and open in new tab, then it opens the dashboard again in the new tab and not the logged in client area.

hence why I wrote the hook so that when I click the link, it opens the client area in a new tab.

Share this post


Link to post
Share on other sites
3 hours ago, brian! said:

I suspect you're looking at the right one - but what I see occurring is..

  • if I click on the link, it opens the client area and logs in in the same tab (useless if I need to see the admin area at the same time).
  • if I right-click on the link and open in new tab, then it opens the dashboard again in the new tab and not the logged in client area.

hence why I wrote the hook so that when I click the link, it opens the client area in a new tab.

Aha, you are indeed correct! i right clicked and opened in new tab yesterday BUt never actually checked the tab. I did just now and you are right it just shows the same page again.

Someone needs to give those guys a bafta OR grammy. The work they do is fantastic... maybe someday they should be nominated for a nobel prize?

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated