NetTalk Central

Author Topic: Set global menu position  (Read 3078 times)

terryd

  • Hero Member
  • *****
  • Posts: 759
    • View Profile
    • Davcomm
    • Email
Set global menu position
« on: August 28, 2013, 12:36:33 AM »
On my Webserver procedure window I have created a settings sheet where I set the default Theme and Email settings. I write these away to an xml file and read them on startup in the Webserver init embed point.

With the themes I have set a global value in the Nettalk object Settings\Styles\Files Theme field.
I have given certain users access to the RuntimeSettings NetWebForm. Using this they can try the different themes select one they like, set in in the setting sheet and on reboot they have that theme.
I would like to do the same with Menu positions.

I have created a global variable MenuPosition. I read the xml file in the Webserver init embed.

What is the best place (if possible) to set the menu based on the MenuPosition Global Variable. I see on the header extension advanced tab there is a runtime setting word '_menu_' where I could substitute the MenuPosition variable  but I didn't try to fiddle with this in case it had unexpected consequences.
Terry Davidson
Windows 10 64 bit/Windows7 64bit
Clarion 9.1.11529/Clarion10 12567
Nettalk 913
Nettalk 1015
StringTheory267/Winevent515/XFiles298/MessageBox239/Cryptonite186

kevin plummer

  • Hero Member
  • *****
  • Posts: 1195
    • View Profile
    • Production Accounting and Software Payroll
Re: Set global menu position
« Reply #1 on: August 28, 2013, 05:13:42 AM »
Hi Terry, I allow users to set pick the theme from a drop list on a settings form. When they log in I set the Theme. I decided not to allow them to change the menu but I think the code would work.

    p_web.SetValue('_theme_',L:Theme)
    p_web.ChangeTheme()
    p_web.SetValue('_menu_',L:MenuType)
    !p_web.ChangeMenu()

terryd

  • Hero Member
  • *****
  • Posts: 759
    • View Profile
    • Davcomm
    • Email
Re: Set global menu position
« Reply #2 on: September 01, 2013, 10:43:44 PM »
Hi Kevin
Thanks for the reply.
Looking at my situation I don't really want the user who logs into the system to change the position, I want to allow the web administrator to use the runtime settings to decide on a theme and menu position that will suit the company since it represents the company to the outside world.
The particular package I want to apply this to is very generic and this would allow the customer to customise  without me having to code changes.
Terry Davidson
Windows 10 64 bit/Windows7 64bit
Clarion 9.1.11529/Clarion10 12567
Nettalk 913
Nettalk 1015
StringTheory267/Winevent515/XFiles298/MessageBox239/Cryptonite186

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: Set global menu position
« Reply #3 on: September 02, 2013, 02:46:17 AM »
you could add code in the header procedure to set loc:MenuPos and loc:MenuStyle to whatever you've allowed the user to set it to.

cheers
Bruce