Author Topic: Display username in window title  (Read 1111 times)

Offline vitormfgoncalves

  • Newbie
  • *
  • Posts: 2
Display username in window title
« on: September 27, 2016, 07:21:14 AM »
Hi.

I'm trying to insert the username in the window title without success. I want the window title to be like: "username@domain.ltd :: My title"

I already tried to add <roundcube:var name='session:username' /> to /skins/larry/templates/mail.html and it appears for a second and then desapear when the page finishes to load.

The My title is already set in $config['product_name'].

As far I was able to understand the window title is refreshed somewhere else.

Any help will be appreciated.

Thanks!

Offline SKaero

  • Administrator
  • Hero Member
  • *****
  • Posts: 5,261
    • http://SKaero.com/
Re: Display username in window title
« Reply #1 on: September 27, 2016, 12:08:23 PM »
The page title is changed by the javascript so that email count and folder names can be added to the page title, I'm not sure there is a simple way to do what you want.

Offline vitormfgoncalves

  • Newbie
  • *
  • Posts: 2
Re: Display username in window title
« Reply #2 on: September 27, 2016, 12:15:55 PM »
I already found a solution for my case. I edited /program/include/rcmail_output_json.php and added the username variable on line 49:

Before:
Code: [Select]
$name = $this->config->get('product_name');After:
Code: [Select]
$name = $_SESSION['username'] .' :: '. $this->config->get('product_name');
Apparently, if it is changed by javascript it uses this file somehow...

It would be nice to have this option out of the box. Or perhaps someone make a plugin.

Greetings.