本文整理汇总了C#中DotNetNuke.Entities.Tabs.TabController.MoveTabBefore方法的典型用法代码示例。如果您正苦于以下问题:C# TabController.MoveTabBefore方法的具体用法?C# TabController.MoveTabBefore怎么用?C# TabController.MoveTabBefore使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DotNetNuke.Entities.Tabs.TabController
的用法示例。
在下文中一共展示了TabController.MoveTabBefore方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: MoveTab
private bool MoveTab(TabInfo tab, TabInfo targetTab, Position position)
{
//Validate Tab Path
if (targetTab == null || !IsValidTabPath(tab, Globals.GenerateTabPath((targetTab == null) ? Null.NullInteger : targetTab.TabID, tab.TabName)))
{
return false;
}
var tabController = new TabController();
switch (position)
{
case Position.Above:
tabController.MoveTabBefore(tab, targetTab.TabID);
break;
case Position.Below:
tabController.MoveTabAfter(tab, targetTab.TabID);
break;
}
ShowSuccessMessage(string.Format(Localization.GetString("TabMoved", LocalResourceFile), tab.TabName));
return true;
}
示例2: SaveTabInfoObject
//.........这里部分代码省略.........
if ((tab.TabPermissions.Count == 0 && tab.PortalID != Null.NullInteger))
{
//Give admin full permission
ArrayList permissions = PermissionController.GetPermissionsByTab();
foreach (PermissionInfo permission in permissions)
{
TabPermissionInfo newTabPermission = new TabPermissionInfo();
newTabPermission.PermissionID = permission.PermissionID;
newTabPermission.PermissionKey = permission.PermissionKey;
newTabPermission.PermissionName = permission.PermissionName;
newTabPermission.AllowAccess = true;
newTabPermission.RoleID = PortalSettings.Current.AdministratorRoleId;
tab.TabPermissions.Add(newTabPermission);
}
}
PortalSettings _PortalSettings = PortalController.GetCurrentPortalSettings();
if (_PortalSettings.ContentLocalizationEnabled)
{
Locale defaultLocale = LocaleController.Instance.GetDefaultLocale(tab.PortalID);
tab.CultureCode = defaultLocale.Code;
}
else
{
tab.CultureCode = Null.NullString;
}
if ((location == TabRelativeLocation.AFTER && (relativeToTab != null)))
{
tab.TabID = tabCtrl.AddTabAfter(tab, relativeToTab.TabID);
}
else if ((location == TabRelativeLocation.BEFORE && (relativeToTab != null)))
{
tab.TabID = tabCtrl.AddTabBefore(tab, relativeToTab.TabID);
}
else
{
tab.TabID = tabCtrl.AddTab(tab);
}
if (_PortalSettings.ContentLocalizationEnabled)
{
tabCtrl.CreateLocalizedCopies(tab);
}
tabCtrl.UpdateTabSetting(tab.TabID, "CacheProvider", "");
tabCtrl.UpdateTabSetting(tab.TabID, "CacheDuration", "");
tabCtrl.UpdateTabSetting(tab.TabID, "CacheIncludeExclude", "0");
tabCtrl.UpdateTabSetting(tab.TabID, "IncludeVaryBy", "");
tabCtrl.UpdateTabSetting(tab.TabID, "ExcludeVaryBy", "");
tabCtrl.UpdateTabSetting(tab.TabID, "MaxVaryByCount", "");
}
else
{
tabCtrl.UpdateTab(tab);
if ((location == TabRelativeLocation.AFTER && (relativeToTab != null)))
{
tabCtrl.MoveTabAfter(tab, relativeToTab.TabID);
}
else if ((location == TabRelativeLocation.BEFORE && (relativeToTab != null)))
{
tabCtrl.MoveTabBefore(tab, relativeToTab.TabID);
}
}
}
catch (Exception ex)
{
DnnLog.Error(ex);
if (ex.Message.StartsWith("Page Exists"))
{
throw new DotNetNukeException(ex.Message, DotNetNukeErrorCode.PageExists);
}
}
// create the page from a template
if ((!string.IsNullOrEmpty(templateMapPath)))
{
XmlDocument xmlDoc = new XmlDocument();
try
{
xmlDoc.Load(templateMapPath);
TabController.DeserializePanes(xmlDoc.SelectSingleNode("//portal/tabs/tab/panes"), tab.PortalID, tab.TabID, PortalTemplateModuleAction.Ignore, new Hashtable());
//save tab permissions
DeserializeTabPermissions(xmlDoc.SelectNodes("//portal/tabs/tab/tabpermissions/permission"), tab);
}
catch (Exception ex)
{
Exceptions.LogException(ex);
throw new DotNetNukeException("Unable to process page template.", ex, DotNetNukeErrorCode.DeserializePanesFailed);
}
}
//todo: reload tab from db or send back tabid instead?
return tab.TabID;
}