Hi, I am writing a plugin so that the logout button text changes to "Logout <username>". Currently the way I am doing it is by creating a html span element with content $_SESSION["username"] (using html::span) in .php and then later making this html span element child of logout button in the .js file. However, I would like to know whether it is possible to change the logout button text in the .php file itself?
Regards, Rahul.
Hi, I am writing a plugin so that the logout button text changes to "Logout <username>". Currently the way I am doing it is by creating a html span element with content $_SESSION["username"] (using html::span) in .php and then later making this html span element child of logout button in the .js file. However, I would like to know whether it is possible to change the logout button text in the .php file itself?
Using the render_page hook you can change pretty much anything you want about the page before it is sent to the client. Example attached.
Phil
Thanks. This was the exact solution that I was looking for.
I have modified the script slightly to remove the dependency on label.
Regards, Rahul.
On Sunday 11 March 2012 02:58 PM, Phil Weir wrote:
Hi, I am writing a plugin so that the logout button text changes to "Logout <username>". Currently the way I am doing it is by creating a html span element with content $_SESSION["username"] (using html::span) in .php and then later making this html span element child of logout button in the .js file. However, I would like to know whether it is possible to change the logout button text in the .php file itself?
Using the render_page hook you can change pretty much anything you want about the page before it is sent to the client. Example attached.
Phil
Roundcube Development discussion mailing list dev@lists.roundcube.net http://lists.roundcube.net/mailman/listinfo/dev
Won't you have to change the skin/larry/includes/header.html template anyway, because that displays the username before the logout button?
If you're going to customize a skin, then this becomes simple, no?
<div class="topright">
<roundcube:button command="logout" label="logout"
class="button-logout" /> <span class="username"><roundcube:object name="username" /></span> </div>
On 2012-03-09 10:23, Rahul Amaram wrote:
Hi, I am writing a plugin so that the logout button text changes to "Logout <username>". Currently the way I am doing it is by creating a html span element with content $_SESSION["username"] (using html::span) in .php and then later making this html span element child of logout button in the .js file. However, I would like to know whether it is possible to change the logout button text in the .php file itself?
Regards, Rahul. _______________________________________________ Roundcube Development discussion mailing list dev@lists.roundcube.net http://lists.roundcube.net/mailman/listinfo/dev
<roundcube:object name="username" /> display the email id rather than the username. $_SESSION["username"] stores the username which the user entered while logging in.
Regards, Rahul.
On Monday 12 March 2012 02:47 PM, Ian Lewis wrote:
Won't you have to change the skin/larry/includes/header.html template anyway, because that displays the username before the logout button?
If you're going to customize a skin, then this becomes simple, no?
<div class="topright"> <roundcube:button command="logout" label="logout" class="button-logout" /> <span class="username"><roundcube:object name="username" /></span> </div>
On 2012-03-09 10:23, Rahul Amaram wrote:
Hi, I am writing a plugin so that the logout button text changes to "Logout <username>". Currently the way I am doing it is by creating a html span element with content $_SESSION["username"] (using html::span) in .php and then later making this html span element child of logout button in the .js file. However, I would like to know whether it is possible to change the logout button text in the .php file itself?
Regards, Rahul. _______________________________________________ Roundcube Development discussion mailing list dev@lists.roundcube.net http://lists.roundcube.net/mailman/listinfo/dev
Roundcube Development discussion mailing list dev@lists.roundcube.net http://lists.roundcube.net/mailman/listinfo/dev