Skip to main content
1-Visitor
May 1, 2015
Question

Customized Menu Removed after Initiating the "set stylesheet=" command

  • May 1, 2015
  • 2 replies
  • 2218 views

Arbortext Editor 5.4 M110

Background:

  • Menu customization is implemented using ACL and loaded at runtime from the [editor root]\custom\editinit\ folder.
  • The menus are not visible unless a document with the designated doctype is opened.
  • I am new to Arbortext Editor development.

Context:

  • Attempting to write ACL service that will allow content authors to change the FOSI style sheet form the current document "edit" window.
  • Using the ACL command "set stylesheet=fosiname.fos"

Issue:

When the "set stylesheet" command it initiated, the custom menus are removed.

Any idea what is happening? Or what I need to do to reload the menus?

Thank you in advance

2 replies

12-Amethyst
May 4, 2015

Have you reviewed the menuloadhook?

12-Amethyst
May 4, 2015

Here is an example;

package testmenuhook

function testmenuhook_addmenus(win=0,filename="")

{

# add some menus to the Tools button

if (menu_exists('.Tools') && !menu_exists('.Tools.Export_XML'))

{

menu_add .Tools. "" -separator

menu_add .Tools. "Export XML" -cmd {eval "here's export_xml"}

menu_add .Tools. "Import XML" -cmd {eval "here's import_xml"}

}

}

12-Amethyst
May 4, 2015

missed the last 3 lines resubmitting.

Here is an example;

package testmenuhook

function testmenuhook_addmenus(win=0,filename="")

{

# add some menus to the Tools button

if (menu_exists('.Tools') && !menu_exists('.Tools.Export_XML'))

{

menu_add .Tools. "" -separator

menu_add .Tools. "Export XML" -cmd {eval "here's export_xml"}

menu_add .Tools. "Import XML" -cmd {eval "here's import_xml"}

}

}

#set up menus

add_hook("menuloadhook","testmenuhook::testmenuhook_addmenus")

testmenuhook_addmenus()

1-Visitor
May 4, 2015

Hi Tim,

First let me thank you for responding to my question. Now to answer your question.

Not sure what you mean by;

>"Have you reviewed the menuloadhook?"

Background:

The custom menus established with the "menu_add" method and with the "add_hook" method is currently in the ACL stored in location "[editor root]\custom\editinit\" and is loaded at startup. I am writing a different tool that is also stored in this ACL file that allows the end-user to change the FOSI style sheet using the "set stylesheet=" command. When this command is submitted, the custom menus established with the "menu_add" method and with the "add_hook" method are removed.

Questions:

  1. Are you suggesting I need to reload the menus with the "menu_add" method and "add_hook" method after submitting the "set stylesheet=" command?
  2. Is this common practice?
  3. Is there a way to reload the ACL in the "[editor root]\custom\editinit\" folder?

Thank you in advance