Welcome to the Question2Answer Q&A. There's also a demo if you just want to try it out.
0 votes
5.3k views
in Plugins by
edited

I use qa-external-users.php for Drupal 7 and want to get these links open in a new window with target="_blank":

 

return array(
'login' => '../user/login',
'register' => '../user/register',
'logout' => '../user/logout',
);
 
I looked in the code and found thise function in qa-app-format.php:
 
function qa_insert_login_links($htmlmessage, $topage=null, $params=null)
/*
Return $htmlmessage with ^1...^6 substituted for links to log in or register or confirm email and come back to $topage with $params
*/
{
require_once QA_INCLUDE_DIR.'qa-app-users.php';
 
$userlinks=qa_get_login_links(qa_path_to_root(), isset($topage) ? qa_path($topage, $params, '') : null);
 
return strtr(
$htmlmessage,
 
array(
'^1' => empty($userlinks['login']) ? '' : '<A HREF="'.qa_html($userlinks['login']).'">',
'^2' => empty($userlinks['login']) ? '' : '</A>',
'^3' => empty($userlinks['register']) ? '' : '<A HREF="'.qa_html($userlinks['register']).'">',
'^4' => empty($userlinks['register']) ? '' : '</A>',
'^5' => empty($userlinks['confirm']) ? '' : '<A HREF="'.qa_html($userlinks['confirm']).'">',
'^6' => empty($userlinks['confirm']) ? '' : '</A>',
)
);
}

Any Idea how to get target="_blank" in the url? i added it but nothing happend ...

Found a solution in qa-page.php:

 

if (!empty($userlinks['logout']))
$qa_content['navigation']['user']['logout']=array(
'url' => qa_html(@$userlinks['logout']),
'label' => qa_lang_html('main/nav_logout'),
                    'target' => '_blank',
);

Please log in or register to answer this question.

...