It's kind of in 2 parts - the relevant ascx(s) inherit from portalmodulebase , which is our base object for portal functionality. Within that you can see a check for the necessary permissions, and code such as
_actions.Add(GetNextActionID, Localization.GetString(ModuleActionType.DeleteModule, Localization.GlobalResourceFile), ModuleActionType.DeleteModule, ModuleConfiguration.ModuleID.ToString,
"action_delete.gif", "", "confirm('" + DotNetNuke.UI.Utilities.ClientAPI.GetSafeJSString(Localization.GetString("DeleteModule.Confirm")) + "')", False, SecurityAccessLevel.Admin, True, False)
This is picked up in \Library\Components\Skins\ActionBase.vb
Case
Delete(action)
ModuleActionType.DeleteModule
However, this code only marks the module as being sent to the recycle bin (i.e. a "soft" delete). The actual code to delete a module looks like this:
\Website\admin\Tabs\RecycleBin.ascx.vb
Dim objEventLog As New Services.Log.EventLog.EventLogController' delete module
Dim objModules As New ModuleControllerDim objModule As ModuleInfo = objModules.GetModule(intModuleId, Null.NullInteger)If Not objModule Is Nothing Then
objModules.DeleteModule(objModule.ModuleID)
objEventLog.AddLog(objModule, PortalSettings, UserId,
"", Services.Log.EventLog.EventLogController.EventLogType.MODULE_DELETED)End If