Re: How to integrate CuteEditor for .NET with the DotNetNuke 2.0?

  •  10-07-2004, 11:00 AM

    Re: How to integrate CuteEditor for .NET with the DotNetNuke 2.0?

    Goodness, it really is so simple I thought I'd just go ahead and post the code that's needed. Of course this needs to be in a new project with references to DNN and CuteEditor, etc.... standard provider stuff: Keep in mind this is really basic and there is more to do if you want to take advantage of other options but should give you a good start.

    Here goes:

    Imports System.IO
    Imports System.Web
    Imports DotNetNuke
    Imports CuteEditor

    Namespace DotNetNuke.HtmlEditor
    Public Class CuteEditorProvider
    Inherits HtmlEditorProvider

    Dim cntlFtb As New CuteEditor.Editor

    Private Const ProviderType As String = "htmlEditor"

    Private _providerConfiguration As ProviderConfiguration = ProviderConfiguration.GetProviderConfiguration(ProviderType)
    Private _providerPath As String


    Public Sub New()

    Dim _portalSettings As PortalSettings = CType(HttpContext.Current.Items("PortalSettings"), PortalSettings)

    ' Read the configuration specific information for this provider
    Dim objProvider As Provider = CType(_providerConfiguration.Providers(_providerConfiguration.DefaultProvider), Provider)

    _providerPath = objProvider.Attributes("providerPath")

    'initialize the control
    cntlFtb.ImageGalleryPath = _portalSettings.UploadDirectory
    cntlFtb.MediaGalleryPath = _portalSettings.UploadDirectory
    cntlFtb.FilesPath = "Providers/HtmlEditorProviders/CuteEditorProvider/CuteEditor_files/"

    'cntlFtb.HelperFilesParameter = "tabid=" & _portalSettings.ActiveTab.TabId.ToString
    'cntlFtb.ButtonPath = "Providers/HtmlEditorProviders/FtbHtmlEditorProvider/Ftb/images/"
    cntlFtb.ID = "CuteEditorCntrl"
    cntlFtb.AutoConfigure = AutoConfigure.Default

    cntlFtb.Enabled = True

    'assign the initialized control as the HtmlEditorControl
    Me.HtmlEditorControl = cntlFtb
    End Sub


    Public ReadOnly Property ProviderPath() As String
    Get
    Return _providerPath
    End Get
    End Property


    'The Text, Width, and Height properties are retrieved and set by
    'typing the HtmlEditorControl Web.UI.Control to FreeTextBoxControls.FreeTextBox
    'and accessing the FreeTextBox properties Text, Width, and Height
    Public Overrides Property Text() As String
    Get
    Text = CType(Me.HtmlEditorControl, CuteEditor.Editor).Text
    End Get
    Set(ByVal Value As String)
    CType(Me.HtmlEditorControl, CuteEditor.Editor).Text = Value
    End Set
    End Property

    Public Overrides Property Width() As System.Web.UI.WebControls.Unit
    Get
    Width = CType(Me.HtmlEditorControl, CuteEditor.Editor).Width
    End Get
    Set(ByVal Value As System.Web.UI.WebControls.Unit)
    CType(Me.HtmlEditorControl, CuteEditor.Editor).Width = Value
    End Set
    End Property

    Public Overrides Property Height() As System.Web.UI.WebControls.Unit
    Get
    Width = CType(Me.HtmlEditorControl, CuteEditor.Editor).Height
    End Get
    Set(ByVal Value As System.Web.UI.WebControls.Unit)
    CType(Me.HtmlEditorControl, CuteEditor.Editor).Height = Value
    End Set
    End Property

    End Class
    End Namespace




    Tom Lucas

    DNN Resources

    Need DNN Support and Services?
    We can help!
    Click here.
View Complete Thread