|
|
 |
 |
 |
mainResponder.adminSite.website.addIns
Frontier 9 introduced the admin site to replace the controlpanel, however controlpanel addins were not carried forward. This patch (4 changes) allows most controlpanel addins to work within the admin site without change.
| |
«addins : 02/09/16, 12:42:35 by DAB |
| |
«support conrolpanel add-ins as extra menu in admin |
| |
local (pta = html.getPageTableAddress ()) |
| |
local (bgcolor1 = pta^.trbg1, bgcolor2 = pta^.trbg2, ctitems) |
| |
local (htmltext = "", indentlevel = 0) |
| |
htmltext = htmltext + (string.filledString ("\t", indentlevel) + s + "\r\n"); |
| |
on addRow (itemname, itemvalue, linktext="", linkurl="") |
| |
widthstring = " width=\"200\"" |
| |
add ("<tr bgcolor=\"" + bgcolor + "\">"); indentlevel++ |
| |
add ("<td valign=\"top\" style=\"padding-right: 15px;\"" + widthstring + ">" + itemname + "</td>") |
| |
add ("<td valign=\"top\">" + itemvalue + "</td>") |
| |
link = html.getlink (linktext, linkurl) |
| |
add ("<td valign=\"top\" align=\"right\">" + link + " </td>") |
| |
add ("</tr>"); indentlevel-- |
| |
add ("<h4>" + s + "</h4>") |
| |
add ("<table cellpadding=\"3\" cellspacing=\"0\" border=\"0\" width=\"100%\">"); indentlevel++ |
| |
ctitems = 0 //reset the bgcolor |
| |
add ("</table>"); indentlevel-- |
| |
local (command = "view", message = "") |
| |
if defined (pta^.searchArgTable.command) |
| |
command = pta^.searchArgTable.command |
| |
if defined (pta^.postArgs.command) |
| |
command = pta^.postArgs.command |
| |
case command //handle admin commands |
| |
if sizeof(config.mainresponder.controlpanel.wizards) > 0 |
| |
addHeader ("The following Add-ins are installed on this server:") |
| |
for adrWizard in @config.mainresponder.controlpanel.wizards |
| |
«while typeOf (adrWizard^) == addressType //de-reference, possibly |
| |
addRow (html.getLink (nameOf (adrWizard^), "addIns" + "?command=" + nameOf (adrWizard^)), "") |
| |
add ("</table>"); indentlevel-- |
| |
add("No controlpanel addins found (config.mainresponder.controlpanel.wizards)") |
| |
adrWizard = @config.mainresponder.controlpanel.wizards.[command] |
| |
while typeOf (adrWizard^) == addressType //de-reference, possibly |
| |
bundle //set up a dummy navigator so afterCompile callbacks don't overwrite the real navigator |
| |
new (tableType, @dummyNavigator) |
| |
dummyNavigator.outline = "" |
| |
pta^.navigator = @dummyNavigator |
| |
webserver.util.setCookie (pta, "wizard", command) |
| |
local (actionUrl = "http://" + pta^.host + pta^.uri + "?command=" + command) |
| |
local (htext = prefsSuite.browser (flIncludeTitle:false, inputPanel:1, action:actionUrl, separatorColor:gainsboro, separatorTextColor:black)) |
| |
htext = string.replaceAll (htext, "popupWindow$", "popupWindow$" + command + ",") |
Relative to Frontier version 9.7b10
|