当前文件路径:DNN/Library/Controls/Help.vb 
1
'
2
' DotNetNuke?- http://www.dotnetnuke.com
3
' Copyright (c) 2002-2008
4
' by DotNetNuke Corporation
5
'
6
' Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
7
' documentation files (the "Software"), to deal in the Software without restriction, including without limitation
8
' the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and
9
' to permit persons to whom the Software is furnished to do so, subject to the following conditions:
10
'
11
' The above copyright notice and this permission notice shall be included in all copies or substantial portions
12
' of the Software.
13
'
14
' THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED
15
' TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
16
' THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
17
' CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
18
' DEALINGS IN THE SOFTWARE.
19
'
20
Imports System.IO
21
Imports DotNetNuke.Entities.Modules
22
Imports DotNetNuke.Entities.Modules.Actions
23
24
Namespace DotNetNukeNamespace DotNetNuke.UI.UserControls
25
26
Public MustInherit Class HelpClass Help
27
28
Inherits DotNetNuke.Entities.Modules.PortalModuleBase
29
30
Controls#Region "Controls"
31
32
Protected lblHelp As System.Web.UI.WebControls.Label
33
Protected WithEvents cmdCancel As System.Web.UI.WebControls.LinkButton
34
Protected cmdHelp As System.Web.UI.WebControls.HyperLink
35
36
#End Region
37
38
Private Members#Region "Private Members"
39
Private _key As String
40
#End Region
41
42
Event Handlers#Region "Event Handlers"
43
44
/**/''' -----------------------------------------------------------------------------
45
''' <summary>
46
''' Page_Load runs when the control is loaded.
47
''' </summary>
48
''' <remarks>
49
''' </remarks>
50
''' <history>
51
''' </history>
52
''' -----------------------------------------------------------------------------
53
Private Sub Page_Load()Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.Load
54
55
Dim FriendlyName As String = ""
56
57
Dim objModules As New ModuleController
58
Dim objModule As ModuleInfo = objModules.GetModule(ModuleId, TabId, False)
59
If Not objModule Is Nothing Then
60
FriendlyName = objModule.FriendlyName
61
End If
62
63
Dim ModuleControlId As Integer = Null.NullInteger
64
65
If Not (Request.QueryString("ctlid") Is Nothing) Then
66
ModuleControlId = Int32.Parse(Request.QueryString("ctlid"))
67
End If
68
69
Dim objModuleControl As ModuleControlInfo = ModuleControlController.GetModuleControl(ModuleControlId)
70
If Not objModuleControl Is Nothing Then
71
Dim FileName As String = Path.GetFileName(objModuleControl.ControlSrc)
72
Dim LocalResourceFile As String = objModuleControl.ControlSrc.Replace(FileName, Services.Localization.Localization.LocalResourceDirectory & "/" & FileName)
73
If Services.Localization.Localization.GetString(ModuleActionType.HelpText, LocalResourceFile) <> "" Then
74
lblHelp.Text = Services.Localization.Localization.GetString(ModuleActionType.HelpText, LocalResourceFile)
75
End If
76
_key = objModuleControl.ControlKey
77
78
Dim helpUrl As String = GetOnLineHelp(objModuleControl.HelpURL, ModuleConfiguration)
79
If Not Null.IsNull(helpUrl) Then
80
cmdHelp.NavigateUrl = FormatHelpUrl(helpUrl, PortalSettings, FriendlyName)
81
cmdHelp.Visible = True
82
Else
83
cmdHelp.Visible = False
84
End If
85
End If
86
87
If Page.IsPostBack = False Then
88
If Not Request.UrlReferrer Is Nothing Then
89
ViewState("UrlReferrer") = Convert.ToString(Request.UrlReferrer)
90
Else
91
ViewState("UrlReferrer") = ""
92
End If
93
End If
94
95
End Sub
96
97
/**/''' -----------------------------------------------------------------------------
98
''' <summary>
99
''' cmdCancel_Click runs when the cancel Button is clicked
100
''' </summary>
101
''' <remarks>
102
''' </remarks>
103
''' <history>
104
''' </history>
105
''' -----------------------------------------------------------------------------
106
Private Sub cmdCancel_Click()Sub cmdCancel_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdCancel.Click
107
Try
108
Response.Redirect(Convert.ToString(Viewstate("UrlReferrer")), True)
109
Catch exc As Exception 'Module failed to load
110
ProcessModuleLoadException(Me, exc)
111
End Try
112
End Sub
113
114
#End Region
115
116
End Class
117
118
End Namespace