本文整理汇总了C#中DotNetNuke.Entities.Portals.PortalAliasController.GetPortalAliasByPortalID方法的典型用法代码示例。如果您正苦于以下问题:C# PortalAliasController.GetPortalAliasByPortalID方法的具体用法?C# PortalAliasController.GetPortalAliasByPortalID怎么用?C# PortalAliasController.GetPortalAliasByPortalID使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DotNetNuke.Entities.Portals.PortalAliasController
的用法示例。
在下文中一共展示了PortalAliasController.GetPortalAliasByPortalID方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GetDnnHttpHandler
public IHttpHandler GetDnnHttpHandler(RequestContext requestContext, int portal, int tab, string[] passThrough)
{
PortalController pcontroller = new PortalController();
PortalInfo pinfo = pcontroller.GetPortal(portal);
PortalAliasController pacontroller = new PortalAliasController();
PortalAliasCollection pacollection = pacontroller.GetPortalAliasByPortalID(portal);
//pacollection.
//PortalSettings psettings = new PortalSettings(pinfo);
PortalSettings psettings = new PortalSettings(tab, portal); // 64 is the stats tab. TODO: get by page name and not hardcoded id
foreach (string key in pacollection.Keys)
{
psettings.PortalAlias = pacollection[key];
}
TabController tcontroller = new TabController();
// psettings.ActiveTab = tcontroller.GetTab(57, 0, true); // 57 is the profile tab.
requestContext.HttpContext.Items["PortalSettings"] = psettings;
requestContext.HttpContext.Items["UrlRewrite:OriginalUrl"] = requestContext.HttpContext.Request.RawUrl;
//UserInfo uinfo = requestContext.HttpContext.User == null ? new UserInfo() : UserController.GetUserByName(psettings.PortalId, requestContext.HttpContext.User.Identity.Name);
UserInfo uinfo = requestContext.HttpContext.User == null ? new UserInfo() : UserController.GetCachedUser(psettings.PortalId, requestContext.HttpContext.User.Identity.Name);
requestContext.HttpContext.Items["UserInfo"] = uinfo;
foreach (string s in passThrough)
{
requestContext.HttpContext.Items[s] = requestContext.RouteData.Values[s];
}
IHttpHandler page = BuildManager.CreateInstanceFromVirtualPath(VirtualPath, typeof(DotNetNuke.Framework.PageBase)) as IHttpHandler;
return page;
}
示例2: SetDeleteVisibility
/// <summary>
/// SetDeleteVisibility determines whether the Delete button should be displayed
/// </summary>
/// <history>
/// [cnurse] 01/17/2005 documented
/// </history>
private void SetDeleteVisibility( int PortalID )
{
PortalAliasCollection colPortalAlias;
PortalAliasController p = new PortalAliasController();
colPortalAlias = p.GetPortalAliasByPortalID( PortalID );
//Disallow delete if there is only one portal alias
if( colPortalAlias.Count <= 1 )
{
cmdDelete.Visible = false;
}
}
示例3: OnSaveClick
protected void OnSaveClick(object sender, EventArgs e)
{
const bool redirect = true;
try
{
// get content
var htmlContent = GetLatestHTMLContent();
var pac = new PortalAliasController();
var aliases = from PortalAliasInfo pa in pac.GetPortalAliasByPortalID(PortalSettings.PortalId).Values select pa.HTTPAlias;
var content = txtContent.Text;
if (Request.QueryString["nuru"] == null)
{
content = HtmlUtils.AbsoluteToRelativeUrls(content, aliases);
}
htmlContent.Content = content;
var draftStateID = _workflowStateController.GetFirstWorkflowStateID(WorkflowID);
var publishedStateID = _workflowStateController.GetLastWorkflowStateID(WorkflowID);
switch (CurrentWorkflowType)
{
case WorkflowType.DirectPublish:
_htmlTextController.UpdateHtmlText(htmlContent, _htmlTextController.GetMaximumVersionHistory(PortalId));
break;
case WorkflowType.ContentStaging:
if (chkPublish.Checked)
{
//if it's already published set it to draft
if (htmlContent.StateID == publishedStateID)
{
htmlContent.StateID = draftStateID;
}
else
{
htmlContent.StateID = publishedStateID;
//here it's in published mode
}
}
else
{
//if it's already published set it back to draft
if ((htmlContent.StateID != draftStateID))
{
htmlContent.StateID = draftStateID;
}
}
_htmlTextController.UpdateHtmlText(htmlContent, _htmlTextController.GetMaximumVersionHistory(PortalId));
break;
}
}
catch (Exception exc)
{
Exceptions.LogException(exc);
UI.Skins.Skin.AddModuleMessage(Page, "Error occurred: ", exc.Message, ModuleMessage.ModuleMessageType.RedError);
return;
}
// redirect back to portal
if (redirect)
{
Response.Redirect(Globals.NavigateURL(), true);
}
}