Specifications
To o l b a r s 95
The name getDynamicContent() is a misnomer because this function should be used even if the
list of entries in the menu is fixed. For example, the Menus/MM/Text_Size.htm file is not a
dynamic menu; it is designed to be called from each one of a set of static menu items. By adding
a
getDynamicContent() function that simply returns the list of possible font sizes, however, the
same command file can also be used for a toolbar pop-up menu. Toolbar items ignore
underscores in the strings in a returned array so you can reuse menu command files. In the menu
command file, Dreamweaver ignores the
getDynamicContent() function because the menu item
is not marked as dynamic.
Arguments
None.
Returns
Dreamweaver expects an array of strings with which to populate the menu.
Example
function getDynamicContent()
{
var items = new Array;
var filename = dw.getConfigurationPath() + "/Toolbars/MM/AddressList.xml";
var location = MMNotes.localURLToFilePath(filename);
if (DWfile.exists(location))
{
var addressData = DWfile.read(location);
var addressDOM = dw.getDocumentDOM(dw.getConfigurationPath() +
’/Shared/MM/Cache/empty.htm’);
addressDOM.documentElement.outerHTML = addressData;
var addressNodes = addressDOM.getElementsByTagName("url");
if (addressNodes.length)
{
for (var i=0; i < addressNodes.length ; i++ )
{
items[i] = addressNodes[i].address + ";id=’" +
addressNodes[i].address + "’";
}
}
}
return items;
getMenuID()
Description
Only valid for menu buttons. Dreamweaver calls getMenuID() to get the ID of the menu that
should appear when the user clicks the button.
Arguments
None.
Returns
Dreamweaver expects a string that contains a menu ID, which is defined in menus.xml.