本文整理汇总了C#中DotNetNuke.Entities.Tabs.TabController.DeleteTab方法的典型用法代码示例。如果您正苦于以下问题:C# TabController.DeleteTab方法的具体用法?C# TabController.DeleteTab怎么用?C# TabController.DeleteTab使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DotNetNuke.Entities.Tabs.TabController
的用法示例。
在下文中一共展示了TabController.DeleteTab方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: MustNotHavePage
private void MustNotHavePage(string pageName)
{
var controller = new TabController();
TabInfo page = controller.GetTabByName(pageName, 0);
if (page != null)
{
controller.DeleteTab(page.TabID, page.PortalID);
}
}
示例2: PageDesignersMustNotExist
public void PageDesignersMustNotExist()
{
var tabController = new TabController();
var tab = tabController.GetTabByName("Designers", 0);
if (tab != null)
{
tabController.DeleteTab(tab.TabID, 0);
Config.Touch();
}
}
示例3: DeleteTab
private void DeleteTab(TabInfo tab, bool deleteDescendants)
{
var eventLogController = new EventLogController();
var tabController = new TabController();
var moduleController = new ModuleController();
//get tab modules before deleting page
var tabModules = moduleController.GetTabModules(tab.TabID);
//hard delete the tab
tabController.DeleteTab(tab.TabID, tab.PortalID, deleteDescendants);
//delete modules that do not have other instances
foreach (var kvp in tabModules)
{
//check if all modules instances have been deleted
var delModule = moduleController.GetModule(kvp.Value.ModuleID, Null.NullInteger, false);
if (delModule == null || delModule.TabID == Null.NullInteger)
{
moduleController.DeleteModule(kvp.Value.ModuleID);
}
}
eventLogController.AddLog(tab, PortalSettings, UserId, "", EventLogController.EventLogType.TAB_DELETED);
}
示例4: RemoveHostPage
public static void RemoveHostPage(string pageName)
{
DnnInstallLogger.InstallLogInfo(Localization.Localization.GetString("LogStart", Localization.Localization.GlobalResourceFile) + "RemoveHostPage:" + pageName);
var controller = new TabController();
TabInfo skinsTab = controller.GetTabByName(pageName, Null.NullInteger);
if (skinsTab != null)
{
controller.DeleteTab(skinsTab.TabID, Null.NullInteger);
}
}
示例5: RemoveAdminPages
public static void RemoveAdminPages(string tabPath)
{
DnnInstallLogger.InstallLogInfo(Localization.Localization.GetString("LogStart", Localization.Localization.GlobalResourceFile) + "RemoveAdminPages:" + tabPath);
var portalController = new PortalController();
var tabController = new TabController();
ArrayList portals = portalController.GetPortals();
foreach (PortalInfo portal in portals)
{
int tabID = TabController.GetTabByTabPath(portal.PortalID, tabPath, Null.NullString);
if ((tabID != Null.NullInteger))
{
tabController.DeleteTab(tabID, portal.PortalID);
}
}
}
示例6: UpgradeToVersion710
//.........这里部分代码省略.........
//Add Pages under Advanced Features Tab
AddProfessionalPreviewPage(advancedFeaturesTabID,
"//Host//ProfessionalFeatures//AdvancedUrlManagement",
"ProfessionalPreview",
"Advanced URL Management",
"Manage web servers in a web farm.",
"~/Icons/Sigma/AdvancedUrlMngmt_16x16.png",
"~/Icons/Sigma/AdvancedUrlMngmt_32x32.png");
// Add File Content Type
var typeController = new ContentTypeController();
var contentTypeFile = (from t in typeController.GetContentTypes() where t.ContentType == "File" select t).SingleOrDefault();
if (contentTypeFile == null)
{
typeController.AddContentType(new ContentType { ContentType = "File" });
}
var fileContentType = (from t in typeController.GetContentTypes() where t.ContentType == "File" select t).SingleOrDefault();
//only perform following for an existing installation upgrading
if (Globals.Status == Globals.UpgradeStatus.Upgrade)
{
UpdateFoldersForParentId();
ImportDocumentLibraryCategories();
ImportDocumentLibraryCategoryAssoc(fileContentType);
}
//Add 404 Log
var logController = new LogController();
var logTypeInfo = new LogTypeInfo
{
LogTypeKey = EventLogController.EventLogType.PAGE_NOT_FOUND_404.ToString(),
LogTypeFriendlyName = "HTTP Error Code 404 Page Not Found",
LogTypeDescription = "",
LogTypeCSSClass = "OperationFailure",
LogTypeOwner = "DotNetNuke.Logging.EventLogType"
};
logController.AddLogType(logTypeInfo);
//Add LogType
var logTypeConf = new LogTypeConfigInfo
{
LoggingIsActive = true,
LogTypeKey = EventLogController.EventLogType.PAGE_NOT_FOUND_404.ToString(),
KeepMostRecent = "100",
NotificationThreshold = 1,
NotificationThresholdTime = 1,
NotificationThresholdTimeType = LogTypeConfigInfo.NotificationThresholdTimeTypes.Seconds,
MailFromAddress = Null.NullString,
MailToAddress = Null.NullString,
LogTypePortalID = "*"
};
logController.AddLogTypeConfigInfo(logTypeConf);
UninstallPackage("DotNetNuke.SearchInput");
//enable password strength meter for new installs only
HostController.Instance.Update("EnableStrengthMeter", Globals.Status == Globals.UpgradeStatus.Install ? "Y" : "N");
//Add IP filter log type
var logTypeFilterInfo = new LogTypeInfo
{
LogTypeKey = EventLogController.EventLogType.IP_LOGIN_BANNED.ToString(),
LogTypeFriendlyName = "HTTP Error Code 403.6 forbidden ip address rejected",
LogTypeDescription = "",
LogTypeCSSClass = "OperationFailure",
LogTypeOwner = "DotNetNuke.Logging.EventLogType"
};
logController.AddLogType(logTypeFilterInfo);
//Add LogType
var logTypeFilterConf = new LogTypeConfigInfo
{
LoggingIsActive = true,
LogTypeKey = EventLogController.EventLogType.IP_LOGIN_BANNED.ToString(),
KeepMostRecent = "100",
NotificationThreshold = 1,
NotificationThresholdTime = 1,
NotificationThresholdTimeType = LogTypeConfigInfo.NotificationThresholdTimeTypes.Seconds,
MailFromAddress = Null.NullString,
MailToAddress = Null.NullString,
LogTypePortalID = "*"
};
logController.AddLogTypeConfigInfo(logTypeFilterConf);
var tabController = new TabController();
int tabID = TabController.GetTabByTabPath(Null.NullInteger, "//Host//SearchAdmin", Null.NullString);
if (tabID > Null.NullInteger)
tabController.DeleteTab(tabID, Null.NullInteger);
var modDef = ModuleDefinitionController.GetModuleDefinitionByFriendlyName("Search Admin");
if (modDef != null)
AddAdminPages("Search Admin", "Manage search settings associated with DotNetNuke's search capability.", "~/Icons/Sigma/Search_16x16_Standard.png", "~/Icons/Sigma/Search_32x32_Standard.png", true, modDef.ModuleDefID, "Search Admin", "");
CopyGettingStartedStyles();
}
示例7: RemoveModule
private static int RemoveModule(string desktopModuleName, string tabName, int parentId, bool removeTab)
{
DnnInstallLogger.InstallLogInfo(Localization.Localization.GetString("LogStart", Localization.Localization.GlobalResourceFile) + "RemoveModule:" + desktopModuleName);
var tabController = new TabController();
var moduleController = new ModuleController();
TabInfo tab = tabController.GetTabByName(tabName, Null.NullInteger, parentId);
int moduleDefId = 0;
int count = 0;
//Get the Modules on the Tab
if (tab != null)
{
foreach (KeyValuePair<int, ModuleInfo> kvp in moduleController.GetTabModules(tab.TabID))
{
var module = kvp.Value;
if (module.DesktopModule.FriendlyName == desktopModuleName)
{
//Delete the Module from the Modules list
moduleController.DeleteTabModule(module.TabID, module.ModuleID, false);
moduleDefId = module.ModuleDefID;
}
else
{
count += 1;
}
}
//If Tab has no modules optionally remove tab
if (count == 0 && removeTab)
{
tabController.DeleteTab(tab.TabID, tab.PortalID);
}
}
return moduleDefId;
}
示例8: DeleteTab
public void DeleteTab(TabInfo t)
{
PortalSettings portalSettings = new PortalSettings();
int portalId = portalSettings.PortalId;
if (t != null)
{
TabController tc = new TabController();
if (t != null)
{
if (t.Modules != null)
{
foreach (ModuleInfo mod in t.Modules)
{
ModuleController moduleC = new ModuleController();
moduleC.DeleteModule(mod.ModuleID);
moduleC.DeleteModuleSettings(mod.ModuleID);
}
}
tc.DeleteTab(t.TabID, portalId);
tc.DeleteTabSettings(t.TabID);
DataCache.ClearModuleCache(t.TabID);
}
}
}
示例9: RemoveAdminPages
public static void RemoveAdminPages(string tabPath)
{
var portalController = new PortalController();
var tabController = new TabController();
ArrayList portals = portalController.GetPortals();
foreach (PortalInfo portal in portals)
{
int tabID = TabController.GetTabByTabPath(portal.PortalID, tabPath, Null.NullString);
if ((tabID != Null.NullInteger))
{
tabController.DeleteTab(tabID, portal.PortalID);
}
}
}
示例10: MustNotHaveTestPages
public void MustNotHaveTestPages()
{
var tabController = new TabController();
var tabId = Null.NullInteger;
tabId = TabController.GetTabByTabPath(PortalId, "//TestA", Null.NullString);
if (tabId != Null.NullInteger)
{
tabController.DeleteTab(tabId, PortalId);
}
tabId = TabController.GetTabByTabPath(PortalId, "//TestB", Null.NullString);
if (tabId != Null.NullInteger)
{
tabController.DeleteTab(tabId, PortalId);
}
}
示例11: DeleteTab
/// <summary>
/// Deletes a tab
/// </summary>
/// <param name="objTab">The tab to be deleted</param>
/// <remarks>
/// Adds a log entry for the action to the EventLog
/// </remarks>
/// <history>
/// [VMasanas] 18/08/2004 Created
/// 19/09/2004 Remove skin deassignment. BLL takes care of this.
/// 30/09/2004 Change logic so log is only added when tab is actually deleted
/// 28/02/2005 Remove modules when deleting pages
/// </history>
private void DeleteTab(TabInfo objTab, bool deleteDescendants)
{
var objEventLog = new EventLogController();
var objTabs = new TabController();
var objModules = new ModuleController();
//get tab modules before deleting page
var dicTabModules = objModules.GetTabModules(objTab.TabID);
//hard delete the tab
objTabs.DeleteTab(objTab.TabID, objTab.PortalID, deleteDescendants);
//delete modules that do not have other instances
foreach (var kvp in dicTabModules)
{
//check if all modules instances have been deleted
var objDelModule = objModules.GetModule(kvp.Value.ModuleID, Null.NullInteger, false);
if (objDelModule == null || objDelModule.TabID == Null.NullInteger)
{
objModules.DeleteModule(kvp.Value.ModuleID);
}
}
objEventLog.AddLog(objTab, PortalSettings, UserId, "", EventLogController.EventLogType.TAB_DELETED);
}
示例12: RemoveCoreModule
/// <summary>
/// RemoveCoreModule removes a Core Module from the system
/// </summary>
/// <remarks>
/// </remarks>
/// <param name="DesktopModuleName">The Friendly Name of the Module to Remove</param>
/// <param name="ParentTabName">The Name of the parent Tab/Page for this module</param>
/// <param name="TabName">The Name to tab that contains the Module</param>
/// <param name="TabRemove">A flag to determine whether to remove the Tab if it has no
/// other modules</param>
private static void RemoveCoreModule(string DesktopModuleName, string ParentTabName, string TabName, bool TabRemove)
{
TabController objTabs = new TabController();
ModuleController objModules = new ModuleController();
int intIndex;
int intModuleDefId = 0;
int intDesktopModuleId;
//Find and remove the Module from the Tab
switch (ParentTabName)
{
case "Host":
//TODO - when we have a need to remove a Host Module
break;
case "Admin":
PortalController objPortals = new PortalController();
ArrayList arrPortals = objPortals.GetPortals();
//Iterate through the Portals to remove the Module from the Tab
for (int intPortal = 0; intPortal < arrPortals.Count; intPortal++)
{
PortalInfo objPortal = (PortalInfo)(arrPortals[intPortal]);
int ParentId = objPortal.AdminTabId;
TabInfo objTab = objTabs.GetTabByName(TabName, objPortal.PortalID, ParentId);
int intCount = 0;
//Get the Modules on the Tab
foreach (KeyValuePair<int, ModuleInfo> kvp in objModules.GetTabModules(objTab.TabID))
{
ModuleInfo objModule = kvp.Value;
if (objModule.FriendlyName == DesktopModuleName)
{
//Delete the Module from the Modules list
objModules.DeleteModule(objModule.ModuleID);
intModuleDefId = objModule.ModuleDefID;
}
else
{
intCount += 1;
}
}
//If Tab has no modules optionally remove tab
if (intCount == 0 & TabRemove)
{
objTabs.DeleteTab(objTab.TabID, objTab.PortalID);
}
}
break;
}
//Delete all the Module Controls for this Definition
ModuleControlController objModuleControls = new ModuleControlController();
ArrayList arrModuleControls = objModuleControls.GetModuleControls(intModuleDefId);
for (intIndex = 0; intIndex <= arrModuleControls.Count - 1; intIndex++)
{
ModuleControlInfo objModuleControl = (ModuleControlInfo)arrModuleControls[intIndex];
objModuleControls.DeleteModuleControl(objModuleControl.ModuleControlID);
}
//Get the Module Definition
ModuleDefinitionController objModuleDefinitions = new ModuleDefinitionController();
ModuleDefinitionInfo objModuleDefinition;
objModuleDefinition = objModuleDefinitions.GetModuleDefinition(intModuleDefId);
intDesktopModuleId = objModuleDefinition.DesktopModuleID;
//Delete the Module Definition
objModuleDefinitions.DeleteModuleDefinition(intModuleDefId);
//Delete the Desktop Module Control
DesktopModuleController objDesktopModules = new DesktopModuleController();
objDesktopModules.DeleteDesktopModule(intDesktopModuleId);
}
示例13: DeleteTab
/// <summary>
/// Deletes a tab
/// </summary>
/// <param name="intTabid">TabId of the tab to be deleted</param>
/// <remarks>
/// Adds a log entry for the action to the EventLog
/// </remarks>
/// <history>
/// [VMasanas] 18/08/2004 Created
/// 19/09/2004 Remove skin deassignment. BLL takes care of this.
/// 30/09/2004 Change logic so log is only added when tab is actually deleted
/// 28/02/2005 Remove modules when deleting pages
/// </history>
private void DeleteTab( int intTabid )
{
EventLogController objEventLog = new EventLogController();
// delete tab
TabController objTabs = new TabController();
ModuleController objModules = new ModuleController();
TabInfo objTab = objTabs.GetTab( intTabid );
if( objTab != null )
{
//save tab modules before deleting page
ArrayList arrTabModules = objModules.GetPortalTabModules( objTab.PortalID, objTab.TabID );
// hard delete the tab
objTabs.DeleteTab( objTab.TabID, objTab.PortalID );
// check if it's deleted
TabInfo objTabDeleted = objTabs.GetTab( intTabid );
if( objTabDeleted == null )
{
//delete modules that do not have other instances
foreach( ModuleInfo objmodule in arrTabModules )
{
// check if all modules instances have been deleted
ModuleInfo objDelModule = objModules.GetModule( objmodule.ModuleID, Null.NullInteger );
if( objDelModule == null || objDelModule.TabID == Null.NullInteger )
{
objModules.DeleteModule( objmodule.ModuleID );
}
}
objEventLog.AddLog( objTab, PortalSettings, UserId, "", EventLogController.EventLogType.TAB_DELETED );
}
else
{
// should be a parent tab
UI.Skins.Skin.AddModuleMessage( this, string.Format( Localization.GetString( "ParentTab.ErrorMessage", this.LocalResourceFile ), objTab.TabName ), ModuleMessageType.YellowWarning );
}
}
}
示例14: RemoveHostPage
public static void RemoveHostPage(string pageName)
{
var controller = new TabController();
TabInfo skinsTab = controller.GetTabByName(pageName, Null.NullInteger);
if (skinsTab != null)
{
controller.DeleteTab(skinsTab.TabID, Null.NullInteger);
}
}
示例15: DeleteTab
private void DeleteTab(string tabName)
{
var tc = new TabController();
var tab = tc.GetTabByName(tabName, PortalId);
if (tab != null)
{
tc.DeleteTab(tab.TabID, PortalId);
}
}