| Mei Ying [MVP] 2005-05-30, 8:47 pm |
| Hi
How about placing the buttons in the Web Author Console instead? It's easier
and you'll still have it on every template that needs it.
About the AddShiftReference error, check out this article in the FAQ:
http://download.microsoft.com/downl...6a/MCMS+2002+-+(complete)+FAQ.htm#21B7B163-820E-439C-9D36-24A94BB15B30
--
regards
Mei Ying
---
Blog: http://meiyinglim.blogspot.com
Book: http://www.packtpub.com/book/mcms
Contact: meiyinglim@hotmail.com
---
"kkit@indiatimes.com" wrote:
> hi all,
>
> i have added two buttons in the cms toolbar. which are enabled only
> when we are inside a placeholder while i want them to be enabled all
> the time if you are in AuthoringMode.
>
> To add the buttons i have
> 1) set g_bBackCompatToolbarHooks = True
>
> 2) added the following code in function InitializeToolbar of
> ActiveXEditing.vbs file.
>
> call edit_toolbar.AddSeperator
>
> call format_toolbar.AddSeperator
> format_toolbar.AddButton "Search", "", "Search.gif", "Search Text"
>
> call format_toolbar.AddSeperator
> format_toolbar.AddButton "Resource", "", "Resoucre.gif", "Resource
> Report"
>
> call format_toolbar.AddSeperator
>
> 3) appended the file ActiveXEditing.vbs with the following code
> Sub OnToolbarInitialize( ByVal pToolbarInterface)
> End Sub
>
> Sub OnToolbarStateInitialize( ByVal strPlaceholderName, ByVal pState )
> pState.Item("Search").Allowed = True
> pState.Item("Resource").Allowed = True
> End Sub
>
> Sub OnToolbarUpdate( ByVal pActiveHtmlEditor, ByVal bEditingSource )
> pActiveHtmlEditor.ToolbarState.Item("Search").Enabled = True
> pActiveHtmlEditor.ToolbarState.Item("Resource").Enabled = True
> End Sub
>
> Sub OnToolbarEvent( ByVal pActiveHtmlEditor, ByVal bstrId, ByVal pItem,
> ByVal bEditingSource )
> Select Case bstrId
> Case "Search"
> 'Call search window
> dim temp
> temp = document.open("/UtilTool/SearchReplace.aspx","","toolbar=no,
> menubar=no, location=no, directories=no")
> Case "Resource"
> window.showModalDialog("/UtilTool/ResolveResourcePath.aspx?GUID=" &
> url)
> End Select
> End Sub
>
> Problems:
> 1) These buttons are enabled only when you click inside a placeholder.
> but as per requirement we have to keep them enabled irrespective of
> cursor's position (inside or outside placeholder)
>
> 2) on a different machine the same modifications were giving script
> errors (type mismatch of AddShiftContentReference and
> InitializeToolbar) once you enter into the authoring mode and was not
> loading the toolbar at all.
>
> Regards,
> Krishna
>
>
|