本文整理汇总了C#中DotNetNuke.Entities.Modules.ModuleController.GetAllTabsModules方法的典型用法代码示例。如果您正苦于以下问题:C# ModuleController.GetAllTabsModules方法的具体用法?C# ModuleController.GetAllTabsModules怎么用?C# ModuleController.GetAllTabsModules使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DotNetNuke.Entities.Modules.ModuleController
的用法示例。
在下文中一共展示了ModuleController.GetAllTabsModules方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: AddTab
public int AddTab( TabInfo objTab, bool AddAllTabsModules )
{
int intTabId;
objTab.TabPath = Globals.GenerateTabPath( objTab.ParentId, objTab.TabName );
intTabId = DataProvider.Instance().AddTab( objTab.PortalID, objTab.TabName, objTab.IsVisible, objTab.DisableLink, objTab.ParentId, objTab.IconFile, objTab.Title, objTab.Description, objTab.KeyWords, objTab.Url, objTab.SkinSrc, objTab.ContainerSrc, objTab.TabPath, objTab.StartDate, objTab.EndDate, objTab.RefreshInterval, objTab.PageHeadText );
TabPermissionController objTabPermissionController = new TabPermissionController();
if( objTab.TabPermissions != null )
{
TabPermissionCollection objTabPermissions = objTab.TabPermissions;
foreach( TabPermissionInfo objTabPermission in objTabPermissions )
{
objTabPermission.TabID = intTabId;
if( objTabPermission.AllowAccess )
{
objTabPermissionController.AddTabPermission( objTabPermission );
}
}
}
if( !( Null.IsNull( objTab.PortalID ) ) )
{
UpdatePortalTabOrder( objTab.PortalID, intTabId, objTab.ParentId, 0, 0, objTab.IsVisible, true );
}
else // host tab
{
ArrayList arrTabs = GetTabsByParentId( objTab.ParentId, objTab.PortalID );
UpdateTabOrder( objTab.PortalID, intTabId, ( arrTabs.Count*2 ) - 1, 1, objTab.ParentId );
}
if( AddAllTabsModules )
{
ModuleController objmodules = new ModuleController();
ArrayList arrMods = objmodules.GetAllTabsModules( objTab.PortalID, true );
foreach( ModuleInfo objModule in arrMods )
{
objmodules.CopyModule( objModule.ModuleID, objModule.TabID, intTabId, "", true );
}
}
ClearCache( objTab.PortalID );
return intTabId;
}
示例2: RestoreTab
/// <summary>
/// Restores the tab.
/// </summary>
/// <param name="tab">The obj tab.</param>
/// <param name="portalSettings">The portal settings.</param>
public void RestoreTab(TabInfo tab, PortalSettings portalSettings)
{
if (tab.DefaultLanguageTab != null)
{
//We are trying to restore the child, so recall this function with the master language's tab id
RestoreTab(tab.DefaultLanguageTab, portalSettings);
return;
}
tab.IsDeleted = false;
UpdateTab(tab);
//Restore any localized children
foreach (TabInfo localizedtab in tab.LocalizedTabs.Values)
{
localizedtab.IsDeleted = false;
UpdateTab(localizedtab);
}
var eventLogController = new EventLogController();
eventLogController.AddLog(tab, portalSettings, portalSettings.UserId, "",
EventLogController.EventLogType.TAB_RESTORED);
var moduleController = new ModuleController();
ArrayList allTabsModules = moduleController.GetAllTabsModules(tab.PortalID, true);
foreach (ModuleInfo objModule in allTabsModules)
{
moduleController.CopyModule(objModule, tab, Null.NullString, true);
}
ClearCache(tab.PortalID);
}
示例3: AddAllTabsModules
private static void AddAllTabsModules(TabInfo tab)
{
var objmodules = new ModuleController();
var portalSettings = new PortalSettings(tab.TabID, tab.PortalID);
foreach (ModuleInfo allTabsModule in objmodules.GetAllTabsModules(tab.PortalID, true))
{
//[DNN-6276]We need to check that the Module is not implicitly deleted. ie If all instances are on Pages
//that are all "deleted" then even if the Module itself is not deleted, we would not expect the
//Module to be added
var canAdd =
(from ModuleInfo allTabsInstance in objmodules.GetModuleTabs(allTabsModule.ModuleID) select new TabController().GetTab(allTabsInstance.TabID, tab.PortalID, false)).Any(
t => !t.IsDeleted) && (!portalSettings.ContentLocalizationEnabled || allTabsModule.CultureCode == tab.CultureCode);
if (canAdd)
{
objmodules.CopyModule(allTabsModule, tab, Null.NullString, true);
}
}
}
示例4: cmdRestoreTab_Click
/// <summary>
/// Restores selected tabs in the listbox
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
/// <remarks>
/// Adds a log entry for each restored tab to the EventLog
/// Redirects to same page after restoring so the menu can be refreshed with restored tabs.
/// This will not restore deleted modules for selected tabs, only the tabs are restored.
/// </remarks>
/// <history>
/// [VMasanas] 18/08/2004 Added support for multiselect listbox
/// 30/09/2004 Child tabs cannot be restored until their parent is restored first.
/// Change logic so log is only added when tab is actually restored
/// </history>
protected void cmdRestoreTab_Click( Object sender, ImageClickEventArgs e )
{
ListItem item;
bool errors = false;
foreach( ListItem tempLoopVar_item in lstTabs.Items )
{
item = tempLoopVar_item;
if( item.Selected )
{
EventLogController objEventLog = new EventLogController();
TabController objTabs = new TabController();
TabInfo objTab = objTabs.GetTab( int.Parse( item.Value ) );
if( objTab != null )
{
if( Null.IsNull( objTab.ParentId ) && lstTabs.Items.FindByValue( objTab.ParentId.ToString() ) != null )
{
UI.Skins.Skin.AddModuleMessage( this, string.Format( Localization.GetString( "ChildTab.ErrorMessage", this.LocalResourceFile ), objTab.TabName ), ModuleMessageType.YellowWarning );
errors = true;
}
else
{
objTab.IsDeleted = false;
objTabs.UpdateTab( objTab );
objEventLog.AddLog( objTab, PortalSettings, UserId, "", EventLogController.EventLogType.TAB_RESTORED );
ModuleController objmodules = new ModuleController();
ArrayList arrMods = objmodules.GetAllTabsModules( objTab.PortalID, true );
foreach( ModuleInfo objModule in arrMods )
{
objmodules.CopyModule( objModule.ModuleID, objModule.TabID, objTab.TabID, "", true );
}
}
}
}
}
if( ! errors )
{
Response.Redirect( Globals.NavigateURL() );
}
else
{
BindData();
}
}