Hello Adam,
I have rewritten your include_CuteEditor.asp file, so i can simple add custombuttons to my configuration file!
Below an example: First configuration file:
<item type="linebreak" />
<item type="g_start" />
<item type="custombutton" name="link" command="StyleIT_MaakLink('strStyleITContent');" imagename="link" />
<item type="image" name="Unlink" />
<item type="custombutton" name="afbeelding" command="StyleIT_MaakAfbeeldingEenvoudig(500, 'ja', 150, 2,'strStyleITContent');" imagename="image" />
<item type="separator" />
<item type="g_end" />
And the code, i have changed the function: GetToolbarFromItemList(d_list)
Public function GetToolbarFromItemList(d_list)
dim scriptname,cfgfilename,doc,temp
dim node,selectednode,optionnodelist,errobj
dim selectednodes,s
s=""
cfgfilename = Server.MapPath(GetURL("Configuration/AutoConfigure/full.config"))
' Create an object to hold the XML
set doc = server.CreateObject("Microsoft.XMLDOM")
' For ASP, wait until the XML is all ready before continuing
doc.async = False
' Load the XML file or return an error message and stop the script
if not Doc.Load(cfgfilename) then
Response.Write "Failed to load the Configure file.<br>"
Response.End
end if
' Make sure that the interpreter knows that we are using XPath as our selection language
doc.setProperty "SelectionLanguage", "XPath"
'set selectednode= doc.selectSingleNode("/toolbars")
Dim Nodes
set Nodes = doc.DocumentElement.selectNodes("//toolbars/*")
Dim ToolbarStrings
Dim i
If BrowserType="Gecko" Then
d_list = d_list & ",zoom"
End If
If BrowserType="Safari" Then
d_list = d_list & ",zoom,find,tofullpage,fromfullpage,linktree,inserttemplate,modifytable,insertrowtop,insertrowbottom,insertcolumnleft,insertcolumnright,deletecell,deleterow,deletecolumn,insertcell,editrow,editcell"
d_list = d_list & ",mergeright,mergebottom,horsplitcell,versplitcell,blockdirltr,blockdirrtl,insertorderedlist,insertunorderedlist,indent,outdent,imagemap,insertanchor,documentpropertypage,absoluteposition"
d_list = d_list & ",bringforward,bringbackward,cssclass,cssstyle"
End If
ToolbarStrings = Split(s_templateitemlist,",")
For i = 0 to Ubound(Split(s_templateitemlist,","))
dim itemname
itemname = Trim(ToolbarStrings(i))
dim disable_toolbarstrings, j,found
found = false
disable_toolbarstrings = Split(d_list,",")
for j = 0 to Ubound(disable_toolbarstrings)
if lcase(itemname) = lcase(trim(disable_toolbarstrings(j))) then
found = true
Exit for
end if
next
if found = false then
Select Case lcase(itemname)
case "g_start":
s = s & AddToolbarGroupStart
case "g_end":
s = s & AddToolbarGroupEnd
case "separator":
s = s & AddToolbarSeparator
case "linebreak":
s = s & AddToolbarLineBreak
case "table":
' s = s & AddToolbarLineBreak
case "forecolor":
s = s & AddToolbarForeColor
case "backcolor":
s = s & AddToolbarBackColor
case "dropdown":
' s = s & AddToolbarLineBreak
case "holder":
' s = s & AddToolbarLineBreak
Case else
Dim objNode,objType,objName,objImgName,objVisible,v, objCommand
For Each objNode in Nodes
With objNode.Attributes
set objType = .GetNamedItem("type")
set objName = .GetNamedItem("name")
set objVisible = .GetNamedItem("Visible")
v = "true"
If not objVisible is nothing then
v = objVisible.Text
End If
If not objName is nothing AND lcase(v) <> "false" then
if lcase(objName.Text) = lcase(itemname) then
If lcase(objType.Text) = "image" then
dim n,t
n = objName.Text
set objImgName = .GetNamedItem("imagename")
If not objImgName is nothing then
t = .GetNamedItem("imagename").Text
else
t = n
End If
s = s & AddToolbarItem(n,ProcessThemeWebPath(t & ".gif"), n,20,20)
ElseIf (LCase(objType.Text) = "custombutton") Then
Dim strTitle,strImageURL
n = objName.Text
Set objImgName = .GetNamedItem("imagename")
If (Not objImgName Is Nothing) Then
strImageURL = .GetNamedItem("imagename").Text
Else
strImageURL = strTitle
End If
Set objCommand = .GetNamedItem("command")
s = s & AddCustomToolbarItem(objCommand.Text, ProcessThemeWebPath(strImageURL & ".gif"), strTitle)
Else
Dim objCmd
set objCmd = .GetNamedItem("command")
s = s & AddToolbarDropDown(objName.Text,objCmd.Text)
End If
end if
End if
End With
Next
End Select
end if
Next
GetToolbarFromItemList = s
End function
I have added de following function:
Public Function AddCustomToolbarItem(strCommand, strImageURL, strTitle)
AddCustomToolbarItem = "<img title="""&G_Str(strTitle)&""" class=""CuteEditorButton"" onclick="""&strCommand&""" src='"&strImageURL&"' border=0 />"
End Function
Possible you could use this, to fix some incompatibility .........