Author |
|
webkingashu Newbie
Joined: 13 March 2014 Location: India
Online Status: Offline Posts: 13
|
Posted: 13 March 2014 at 11:32pm | IP Logged
|
|
|
Hi,
Wonderful software.
I need a help, i just want to add a static link inside webmail.
It is such that when users logs in and click on the settings link at top right, a left pane opens with some "COMMON" and "Email" settings etc.
Now i just want a third item (which is a static link) to appear that will take to some of my stuff in a new tab.
The Problem is i cant find out where to add my two lined of href code. Please refer to the specific file where i am suppose to add this.
Thanks
|
Back to Top |
|
|
Igor AfterLogic Support
Joined: 24 June 2008 Location: United States
Online Status: Offline Posts: 6104
|
Posted: 14 March 2014 at 12:19am | IP Logged
|
|
|
The file in question is templates/views/Settings/SettingsViewModel.html. Be sure to purge cache to apply changes - not only the browser cache, but also data/cache content.
--
Regards,
Igor, AfterLogic Support
|
Back to Top |
|
|
webkingashu Newbie
Joined: 13 March 2014 Location: India
Online Status: Offline Posts: 13
|
Posted: 14 March 2014 at 12:56am | IP Logged
|
|
|
Oh Yes!! The cache thing. I edited the same file last night but changes did not reflected, thus posted the question. Well cache solution worked like the charm.
Can i ask , if i happen to retrive the logged in user's username, and store into some php variable, can i write the code in the same html file? Also are there any variables available for this ??
Thing is now i want to change my link with some information in query string like
http://blahbla.com/refer.php?email=john&domain=mydomain.com
It means the logged in user was john@mydomain.com
So is there any straight method to retrive the username , as once available i can play with this.
Thanks
|
Back to Top |
|
|
Igor AfterLogic Support
Joined: 24 June 2008 Location: United States
Online Status: Offline Posts: 6104
|
Posted: 14 March 2014 at 1:04am | IP Logged
|
|
|
There's no simple way through that one, you would need to modify JavaScript code of view model, add a variable specific to that template, and use the variable in the template. I'm not saying that's a rocket science, but you need to know your way through JavaScript and such to succeed there.
--
Regards,
Igor, AfterLogic Support
|
Back to Top |
|
|
webkingashu Newbie
Joined: 13 March 2014 Location: India
Online Status: Offline Posts: 13
|
Posted: 14 March 2014 at 1:11am | IP Logged
|
|
|
Ok .. I have decided to dig in.
Are there some codex type documentation available? Or i have to proceed with trial and error.
All i want is to create a js variable for SettingsViewModel.html file, and get the username value stored in this variable.
So you gotta some more time you can guide in, any way i'll repost the complete solution once i end up.
Thanks for such help.
|
Back to Top |
|
|
Igor AfterLogic Support
Joined: 24 June 2008 Location: United States
Online Status: Offline Posts: 6104
|
Posted: 14 March 2014 at 3:12am | IP Logged
|
|
|
To add the variable, you'll need to modify static/js/app.js file, locate the following function around line 22500:
Code:
function CSettingsViewModel()
{ |
|
|
and right after the opening brace, insert the following:
Code:
this.currentEmail = AppData.Accounts.getEmail(); |
|
|
Now in templates/views/Settings/SettingsViewModel.html file, add the code to display URL containing the email address as query string parameter:
Code:
<a data-bind="attr: {'src': 'http://blahbla.com/refer.php?email=' + currentEmail}">Click Here</a> |
|
|
The app.js file, however, isn't used by default - its minified version app.min.js is used. To change that, add the following item to data/settings/config.php file:
Code:
'labs.use-app-min-js' => false, |
|
|
Hope this helps! And don't forget to purge those caches
--
Regards,
Igor, AfterLogic Support
|
Back to Top |
|
|