本文整理汇总了C#中DotNetNuke.Entities.Portals.PortalAliasController类的典型用法代码示例。如果您正苦于以下问题:C# PortalAliasController类的具体用法?C# PortalAliasController怎么用?C# PortalAliasController使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
PortalAliasController类属于DotNetNuke.Entities.Portals命名空间,在下文中一共展示了PortalAliasController类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: TestFixtureSetUp
public override void TestFixtureSetUp()
{
base.TestFixtureSetUp();
var tc = new TabController();
var tab = tc.GetTabByName(_aboutUsPageName, PortalId);
_tabId = tab.TabID;
//Add Portal Aliases
var aliasController = new PortalAliasController();
TestUtil.ReadStream(String.Format("{0}", "Aliases"), (line, header) =>
{
string[] fields = line.Split(',');
var alias = aliasController.GetPortalAlias(fields[0], PortalId);
if (alias == null)
{
alias = new PortalAliasInfo
{
HTTPAlias = fields[0],
PortalID = PortalId
};
TestablePortalAliasController.Instance.AddPortalAlias(alias);
}
});
TestUtil.ReadStream(String.Format("{0}", "Users"), (line, header) =>
{
string[] fields = line.Split(',');
TestUtil.AddUser(PortalId, fields[0].Trim(), fields[1].Trim(), fields[2].Trim());
});
}
开发者ID:hungnt-me,项目名称:Dnn.Platform,代码行数:31,代码来源:FriendlyUrlTests.cs
示例2: CmdSwitchClick
protected void CmdSwitchClick(object sender, EventArgs e)
{
try
{
if ((!string.IsNullOrEmpty(SitesLst.SelectedValue)))
{
int selectedPortalID = int.Parse(SitesLst.SelectedValue);
var portalAliasCtrl = new PortalAliasController();
ArrayList portalAliases = portalAliasCtrl.GetPortalAliasArrayByPortalID(selectedPortalID);
if (((portalAliases != null) && portalAliases.Count > 0 && (portalAliases[0] != null)))
{
Response.Redirect(Globals.AddHTTP(((PortalAliasInfo) portalAliases[0]).HTTPAlias));
}
}
}
catch(ThreadAbortException)
{
//Do nothing we are not logging ThreadAbortxceptions caused by redirects
}
catch (Exception ex)
{
Exceptions.LogException(ex);
}
}
开发者ID:rcedev,项目名称:evans-software-solutions,代码行数:25,代码来源:SwitchSite.ascx.cs
示例3: 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;
}
开发者ID:huaminglee,项目名称:FlexFWD,代码行数:28,代码来源:RouteHandler.cs
示例4: BindData
private void BindData()
{
ArrayList arr;
PortalAliasController p = new PortalAliasController();
arr = p.GetPortalAliasArrayByPortalID( intPortalID );
dgPortalAlias.DataSource = arr;
dgPortalAlias.DataBind();
}
开发者ID:huayang912,项目名称:cs-dotnetnuke,代码行数:9,代码来源:PortalAlias.ascx.cs
示例5: GetData
/// <summary>
/// Gets the data to send to the Glimpse client.
/// </summary>
/// <param name="context">The context.</param>
/// <returns>Data to send the the Glimpse client.</returns>
public object GetData(HttpContextBase context)
{
try
{
// get variables we'll need to output
var portalSettings = PortalSettings.Current;
var tabCreatedByUser = UserController.GetUserById(-1, portalSettings.ActiveTab.CreatedByUserID);
var tabModifiedByUser = UserController.GetUserById(-1, portalSettings.ActiveTab.LastModifiedByUserID);
var portalAliases = new PortalAliasController().GetPortalAliasArrayByPortalID(portalSettings.PortalId)
.Cast<PortalAliasInfo>()
.Select(p => p.HTTPAlias);
var contextItems = new List<object[]> { new object[] { "Key", "Value" } };
foreach (var itemKey in context.Items.Keys)
contextItems.Add(new object[] { itemKey.ToString(), context.Items[itemKey].ToString() });
// add to data to send
var data = new List<object[]> { new object[] { "Property", "Value" } };
data.Add(new object[] { "PortalID", portalSettings.PortalId });
data.Add(new object[] { "Portal Name", portalSettings.PortalName });
data.Add(new object[] { "Portal Aliases", portalAliases.ToArray() });
data.Add(new object[] { "Portal SSL Enabled", portalSettings.SSLEnabled });
data.Add(new object[] { "Portal SSL Enforced", portalSettings.SSLEnforced });
data.Add(new object[] { "User ID", portalSettings.UserId });
data.Add(new object[] { "User Name", portalSettings.UserInfo.Username });
data.Add(new object[] { "User Roles", portalSettings.UserInfo.Roles });
data.Add(new object[] { "Tab ID", portalSettings.ActiveTab.TabID });
data.Add(new object[] { "Tab Name", portalSettings.ActiveTab.TabName });
data.Add(new object[] { "Tab Title", portalSettings.ActiveTab.Title });
data.Add(new object[] { "Tab Path", portalSettings.ActiveTab.TabPath });
data.Add(new object[] { "Tab SSL Enabled", portalSettings.ActiveTab.IsSecure });
data.Add(new object[] { "Tab Created By", (tabCreatedByUser == null) ? null : tabCreatedByUser.Username });
data.Add(new object[] { "Tab Created Date", portalSettings.ActiveTab.CreatedOnDate });
data.Add(new object[] { "Tab Modified By", (tabModifiedByUser == null) ? null : tabModifiedByUser.Username });
data.Add(new object[] { "Tab Modified Date", portalSettings.ActiveTab.LastModifiedOnDate });
data.Add(new object[] { "Tab Skin Path", portalSettings.ActiveTab.SkinPath });
data.Add(new object[] { "Tab Skin Source", portalSettings.ActiveTab.SkinSrc });
data.Add(new object[] { "Context Items", contextItems });
return data;
}
catch (Exception ex)
{
DotNetNuke.Services.Exceptions.Exceptions.LogException(ex);
return null;
}
}
开发者ID:JonHaywood,项目名称:DotNetNuke.Extensions.Glimpse,代码行数:51,代码来源:DNNGlimpsePlugin.cs
示例6: Page_Load
private void Page_Load(object sender, System.EventArgs e)
{
RotatorSettings rotatorSettings = new RotatorSettings();
rotatorSettings.Hosts = new System.Collections.Generic.List<System.Web.UI.WebControls.ListItem>();
PortalAliasController paCtrl = new PortalAliasController();
foreach (DictionaryEntry de in paCtrl.GetPortalAliases()) {
PortalAliasInfo paInfo = (PortalAliasInfo)de.Value;
rotatorSettings.Hosts.Add(new ListItem(paInfo.HTTPAlias, paInfo.HTTPAlias));
}
Control ctrlAct = LoadControl(TemplateSourceDirectory.TrimEnd('/') + "/RegCore/QuickStatusAndLink.ascx");
(ctrlAct as IRegCoreComponent).InitRegCore(IsAdmin, RotatorSettings.RegCoreServer, RotatorSettings.ProductName, RotatorSettings.ProductCode, RotatorSettings.ProductKey, RotatorSettings.Version, TemplateSourceDirectory.TrimEnd('/') + "/RegCore/", typeof(DynamicRotatorController));
this.pnlAdmin.Controls.Add(ctrlAct);
if (!rotatorSettings.IsActivated() || rotatorSettings.IsTrialExpired()) {
DynamicRotator.Visible = false;
}
}
开发者ID:dnnsharp,项目名称:DynamicRotator,代码行数:19,代码来源:Rotator.ascx.cs
示例7: BindData
/// <summary>
/// BindData fetches the data from the database and updates the controls
/// </summary>
/// <history>
/// [cnurse] 01/17/2005 documented
/// </history>
private void BindData()
{
if( Request.QueryString["paid"] != null )
{
PortalAliasInfo objPortalAliasInfo;
int intPortalAliasID = Convert.ToInt32( Request.QueryString["paid"] );
PortalAliasController p = new PortalAliasController();
objPortalAliasInfo = p.GetPortalAliasByPortalAliasID( intPortalAliasID );
ViewState.Add( "PortalAliasID", intPortalAliasID );
ViewState.Add( "PortalID", objPortalAliasInfo.PortalID );
if( ! UserInfo.IsSuperUser )
{
if( objPortalAliasInfo.PortalID != PortalSettings.PortalId )
{
UI.Skins.Skin.AddModuleMessage( this, "You do not have access to view this Portal Alias.", ModuleMessageType.RedError );
return;
}
}
txtAlias.Text = objPortalAliasInfo.HTTPAlias;
SetDeleteVisibility( objPortalAliasInfo.PortalID );
}
else if( Request.QueryString["pid"] != "" )
{
if( UserInfo.IsSuperUser )
{
ViewState.Add( "PortalID", Convert.ToInt32( Request.QueryString["pid"] ) );
}
SetDeleteVisibility( Convert.ToInt32( Request.QueryString["pid"] ) );
}
else
{
ViewState.Add( "PortalID", PortalSettings.PortalId );
SetDeleteVisibility( PortalSettings.PortalId );
}
}
开发者ID:huayang912,项目名称:cs-dotnetnuke,代码行数:45,代码来源:EditPortalAlias.ascx.cs
示例8: FormatPortalAliases
/// -----------------------------------------------------------------------------
/// <summary>
/// FormatExpiryDate formats the format name as an a tag
/// </summary>
/// <remarks>
/// </remarks>
/// <history>
/// [cnurse] 9/28/2004 Updated to reflect design changes for Help, 508 support
/// and localisation
/// </history>
/// -----------------------------------------------------------------------------
public string FormatPortalAliases(int portalID)
{
var str = new StringBuilder();
try
{
var objPortalAliasController = new PortalAliasController();
var arr = objPortalAliasController.GetPortalAliasArrayByPortalID(portalID);
PortalAliasInfo objPortalAliasInfo;
int i;
for (i = 0; i <= arr.Count - 1; i++)
{
objPortalAliasInfo = (PortalAliasInfo) arr[i];
var httpAlias = Globals.AddHTTP(objPortalAliasInfo.HTTPAlias);
var originalUrl = HttpContext.Current.Items["UrlRewrite:OriginalUrl"].ToString().ToLowerInvariant();
httpAlias = Globals.AddPort(httpAlias, originalUrl);
str.Append("<a href=\"" + httpAlias + "\">" + objPortalAliasInfo.HTTPAlias + "</a>" + "<BR>");
}
}
catch (Exception exc) //Module failed to load
{
Exceptions.ProcessModuleLoadException(this, exc);
}
return str.ToString();
}
开发者ID:sunsiz,项目名称:dnn6-chinese-language-pack,代码行数:38,代码来源:Portals.ascx.cs
示例9: DeleteAlias
/// -----------------------------------------------------------------------------
/// <summary>
/// DeleteAlias runs when a delete button is clicked
/// </summary>
/// <remarks>
/// </remarks>
/// <history>
/// [cnurse] 12/12/2008 Created
/// </history>
/// -----------------------------------------------------------------------------
private void DeleteAlias(object source, DataGridCommandEventArgs e)
{
var controller = new PortalAliasController();
//Get the index of the row to delete
int index = e.Item.ItemIndex;
//Remove the alias from the aliases collection
var portalAlias = (PortalAliasInfo) Aliases[index];
controller.DeletePortalAlias(portalAlias.PortalAliasID);
//Rebind the collection
_Aliases = null;
BindAliases();
}
开发者ID:rickfox,项目名称:Steves,代码行数:25,代码来源:PortalAliases.ascx.cs
示例10: AddCustomRedirectsToDictionary
private static void AddCustomRedirectsToDictionary(SharedDictionary<string, string> tabIndex,
Dictionary<string, DupKeyCheck> dupCheck,
string httpAlias,
TabInfo tab,
FriendlyUrlSettings settings,
FriendlyUrlOptions options,
ref string rewritePath,
out int tabPathDepth,
ref List<string> customHttpAliasesUsed,
bool isDeleted,
Guid parentTraceId)
{
tabPathDepth = 1;
var duplicateHandlingPreference = UrlEnums.TabKeyPreference.TabRedirected;
bool checkForDupUrls = settings.CheckForDuplicateUrls;
//697 : custom url rewrites with large number of path depths fail because of incorrect path depth calculation
int maxTabPathDepth = 1;
string newRewritePath = rewritePath;
string aliasCulture = null;
//get the culture for this alias
var primaryAliases = TestablePortalAliasController.Instance.GetPortalAliasesByPortalId(tab.PortalID).ToList();
if (primaryAliases.Count > 0)
{
aliasCulture = primaryAliases.GetCultureByPortalIdAndAlias(tab.PortalID, httpAlias);
}
foreach (var redirect in tab.TabUrls)
{
//allow for additional qs parameters
if (!String.IsNullOrEmpty(redirect.QueryString))
{
rewritePath += (redirect.QueryString.StartsWith("&")) ? redirect.QueryString : "&" + redirect.QueryString;
}
string redirectTabPath = redirect.Url;
string redirectedRewritePath = rewritePath;
//770 : allow for custom portal aliases
string redirectAlias = httpAlias;
if (redirect.PortalAliasId > 0)
{
//has a custom portal alias
var pac = new PortalAliasController();
PortalAliasInfo customAlias = pac.GetPortalAliasByPortalAliasID(redirect.PortalAliasId);
if (customAlias != null)
{
//this will be used to add the Url to the dictionary
redirectAlias = customAlias.HTTPAlias;
//add to the list of custom aliases used by the portal
if (customHttpAliasesUsed == null)
{
customHttpAliasesUsed = new List<string>();
}
if (!customHttpAliasesUsed.Contains(redirectAlias))
{
customHttpAliasesUsed.Add(redirectAlias);
}
}
}
//set the redirect status using the httpStatus
switch (redirect.HttpStatus)
{
case "301":
redirectedRewritePath = RedirectTokens.AddRedirectReasonToRewritePath(rewritePath,
ActionType.Redirect301,
RedirectReason.Custom_Redirect);
break;
case "302":
redirectedRewritePath = RedirectTokens.AddRedirectReasonToRewritePath(rewritePath,
ActionType.Redirect302,
RedirectReason.Custom_Redirect);
break;
case "404":
redirectedRewritePath = RedirectTokens.AddRedirectReasonToRewritePath(rewritePath,
ActionType.Output404,
RedirectReason.Custom_Redirect);
break;
case "200":
//when there is a 200, then replace the 'standard' path
newRewritePath = RedirectTokens.AddRedirectReasonToRewritePath(newRewritePath,
ActionType.CheckFor301,
RedirectReason.Custom_Redirect);
//672 : replacement urls have preference over all redirects, deleted tabs and standard urls
duplicateHandlingPreference = UrlEnums.TabKeyPreference.TabOK;
break;
}
//check the culture of the redirect to see if it either doesn't match the alias or needs to specify
//the language when requested
if (redirect.CultureCode != null)
{
if (redirect.CultureCode != "" && redirect.CultureCode != "Default")
{
//806 : specify duplicates where the alias culture doesn't match the redirect culture
//so that redirect to the best match between alias culture and redirect culture
//compare the supplied alias culture with the redirect culture
//856 : if alias culture == "" and a custom 301 redirect then redirects are forced
if (!string.IsNullOrEmpty(aliasCulture) && aliasCulture != redirect.CultureCode)
{
//the culture code and the specific culture alias don't match
//set 301 check status and set to delete if a duplicate is found
//.........这里部分代码省略.........
开发者ID:vsnobbert,项目名称:Dnn.Platform,代码行数:101,代码来源:TabIndexController.cs
示例11: Handle404OrException
private static void Handle404OrException(FriendlyUrlSettings settings, HttpContext context, Exception ex, UrlAction result, bool transfer, bool showDebug)
{
//handle Auto-Add Alias
if (result.Action == ActionType.Output404 && CanAutoAddPortalAlias())
{
//Need to determine if this is a real 404 or a possible new alias.
var portalId = Host.Host.HostPortalID;
if (portalId > Null.NullInteger)
{
//Get all the existing aliases
var aliases = TestablePortalAliasController.Instance.GetPortalAliasesByPortalId(portalId).ToList();
bool autoaddAlias;
bool isPrimary = false;
if (!aliases.Any())
{
autoaddAlias = true;
isPrimary = true;
}
else
{
autoaddAlias = true;
foreach (var alias in aliases)
{
if (result.DomainName.ToLowerInvariant().IndexOf(alias.HTTPAlias, StringComparison.Ordinal) == 0
&& result.DomainName.Length >= alias.HTTPAlias.Length)
{
autoaddAlias = false;
break;
}
}
}
if (autoaddAlias)
{
var portalAliasInfo = new PortalAliasInfo
{
PortalID = portalId,
HTTPAlias = result.RewritePath,
IsPrimary = isPrimary
};
TestablePortalAliasController.Instance.AddPortalAlias(portalAliasInfo);
context.Response.Redirect(context.Request.Url.ToString(), true);
}
}
}
if (context != null)
{
HttpRequest request = context.Request;
HttpResponse response = context.Response;
HttpServerUtility server = context.Server;
const string errorPageHtmlHeader = @"<html><head><title>{0}</title></head><body>";
const string errorPageHtmlFooter = @"</body></html>";
var errorPageHtml = new StringWriter();
CustomErrorsSection ceSection = null;
//876 : security catch for custom error reading
try
{
ceSection = (CustomErrorsSection) WebConfigurationManager.GetSection("system.web/customErrors");
}
// ReSharper disable EmptyGeneralCatchClause
catch (Exception)
// ReSharper restore EmptyGeneralCatchClause
{
//on some medium trust environments, this will throw an exception for trying to read the custom Errors
//do nothing
}
/* 454 new 404/500 error handling routine */
bool useDNNTab = false;
int errTabId = -1;
string errUrl = null;
string status = "";
bool isPostback = false;
if (settings != null)
{
if (request.RequestType == "POST")
{
isPostback = true;
}
if (result != null && ex != null)
{
result.DebugMessages.Add("Exception: " + ex.Message);
result.DebugMessages.Add("Stack Trace: " + ex.StackTrace);
if (ex.InnerException != null)
{
result.DebugMessages.Add("Inner Ex : " + ex.InnerException.Message);
result.DebugMessages.Add("Stack Trace: " + ex.InnerException.StackTrace);
}
else
{
result.DebugMessages.Add("Inner Ex : null");
}
}
string errRH;
string errRV;
//.........这里部分代码省略.........
开发者ID:rut5949,项目名称:Dnn.Platform,代码行数:101,代码来源:AdvancedUrlRewriter.cs
示例12: BuildUrlDictionary
/// <summary>
/// Returns a list of tab and redirects from the database, for the specified portal
/// Assumes that the dictionary should have any existing items replaced if the portalid is specified
/// and the portal tabs already exist in the dictionary.
/// </summary>
/// <param name="existingTabs"></param>
/// <param name="portalId"></param>
/// <param name="settings"></param>
/// <param name="customAliasTabs"></param>
/// <remarks>
/// Each dictionary entry in the return value is a complex data type of another dictionary that is indexed by the url culture. If there is
/// only one culture for the Url, it will be that culture.
/// </remarks>
/// <returns></returns>
private static SharedDictionary<int, SharedDictionary<string, string>> BuildUrlDictionary(SharedDictionary<int, SharedDictionary<string, string>> existingTabs,
int portalId,
FriendlyUrlSettings settings,
ref SharedDictionary<string, string> customAliasTabs)
{
//fetch tabs with redirects
var tabs = FriendlyUrlController.GetTabs(portalId, false, null, settings);
if (existingTabs == null)
{
existingTabs = new SharedDictionary<int, SharedDictionary<string, string>>();
}
if (customAliasTabs == null)
{
customAliasTabs = new SharedDictionary<string, string>();
}
//go through each tab in the found list
foreach (TabInfo tab in tabs.Values)
{
//check the custom alias tabs collection and add to the dictionary where necessary
foreach (var customAlias in tab.CustomAliases)
{
string key = tab.TabID.ToString() + ":" + customAlias.Key;
using (customAliasTabs.GetWriteLock()) //obtain write lock on custom alias Tabs
{
if (customAliasTabs.ContainsKey(key) == false)
{
customAliasTabs.Add(key, customAlias.Value);
}
}
}
foreach (TabUrlInfo redirect in tab.TabUrls)
{
if (redirect.HttpStatus == "200")
{
string url = redirect.Url;
//770 : add in custom alias into the tab path for the custom Urls
if (redirect.PortalAliasUsage != PortalAliasUsageType.Default && redirect.PortalAliasId > 0)
{
//there is a custom http alias specified for this portal alias
var pac = new PortalAliasController();
PortalAliasInfo alias = pac.GetPortalAliasByPortalAliasID(redirect.PortalAliasId);
if (alias != null)
{
string customHttpAlias = alias.HTTPAlias;
url = customHttpAlias + "::" + url;
}
}
string cultureKey = redirect.CultureCode.ToLower();
int tabid = tab.TabID;
using (existingTabs.GetWriteLock())
{
if (existingTabs.ContainsKey(tabid) == false)
{
var entry = new SharedDictionary<string, string>();
using (entry.GetWriteLock())
{
entry.Add(cultureKey, url);
}
//871 : use lower case culture code as key
existingTabs.Add(tab.TabID, entry);
}
else
{
SharedDictionary<string, string> entry = existingTabs[tabid];
//replace tab if existing but was retreieved from tabs call
if (tab.PortalID == portalId || portalId == -1)
{
using (entry.GetWriteLock())
{
if (entry.ContainsKey(cultureKey) == false)
{
//add the culture and set in parent dictionary
//871 : use lower case culture code as key
entry.Add(cultureKey, url);
existingTabs[tabid] = entry;
}
}
}
}
}
}
}
}
//.........这里部分代码省略.........
开发者ID:hungnt-me,项目名称:Dnn.Platform,代码行数:101,代码来源:CustomUrlDictController.cs
示例13: GetFormattedLink
protected string GetFormattedLink(object dataItem)
{
var returnValue = new StringBuilder();
if ((dataItem is TabInfo))
{
var tab = (TabInfo) dataItem;
if ((tab != null))
{
int index = 0;
TabCtrl.PopulateBreadCrumbs(ref tab);
foreach (TabInfo t in tab.BreadCrumbs)
{
if ((index > 0))
{
returnValue.Append(" > ");
}
if ((tab.BreadCrumbs.Count - 1 == index))
{
string url;
var objPortalAliasController = new PortalAliasController();
ArrayList arr = objPortalAliasController.GetPortalAliasArrayByPortalID(t.PortalID);
var objPortalAliasInfo = (PortalAliasInfo) arr[0];
url = Globals.AddHTTP(objPortalAliasInfo.HTTPAlias) + "/Default.aspx?tabId=" + t.TabID;
returnValue.AppendFormat("<a href=\"{0}\">{1}</a>", url, t.LocalizedTabName);
}
else
{
returnValue.AppendFormat("{0}", t.LocalizedTabName);
}
index = index + 1;
}
}
}
return returnValue.ToString();
}
开发者ID:sunsiz,项目名称:dnn6-chinese-language-pack,代码行数:35,代码来源:UsageDetails.ascx.cs
示例14: IsChildPortal
private bool IsChildPortal(PortalSettings ps, HttpContext context)
{
var isChild = false;
var aliasController = new PortalAliasController();
var arr = aliasController.GetPortalAliasArrayByPortalID(ps.PortalId);
var serverPath = Globals.GetAbsoluteServerPath(context.Request);
if (arr.Count > 0)
{
var portalAlias = (PortalAliasInfo)arr[0];
var portalName = Globals.GetPortalDomainName(ps.PortalAlias.HTTPAlias, Request, true);
if (portalAlias.HTTPAlias.IndexOf("/") > -1)
{
portalName = PortalController.GetPortalFolder(portalAlias.HTTPAlias);
}
if (!string.IsNullOrEmpty(portalName) && Directory.Exists(serverPath + portalName))
{
isChild = true;
}
}
return isChild;
}
开发者ID:hackoose,项目名称:cfi-team05,代码行数:22,代码来源:SitemapSettings.ascx.cs
示例15: BindAliases
private void BindAliases(PortalInfo portal)
{
var portalSettings = new PortalSettings(portal);
var portalAliasController = new PortalAliasController();
var aliases = portalAliasController.GetPortalAliasArrayByPortalID(portal.PortalID);
var portalAliasMapping = portalSettings.PortalAliasMappingMode.ToString().ToUpper();
if (String.IsNullOrEmpty(portalAliasMapping))
{
portalAliasMapping = "CANONICALURL";
}
portalAliasModeButtonList.Select(portalAliasMapping, false);
if (portalAliasMapping.ToUpperInvariant() == "NONE")
{
defaultAliasRow.Visible = false;
}
else
{
defaultAliasRow.Visible = true;
defaultAliasDropDown.DataSource = aliases;
defaultAliasDropDown.DataBind();
var defaultAlias = PortalController.GetPortalSetting("DefaultPortalAlias", portal.PortalID, "");
if (defaultAliasDropDown.Items.FindByValue(defaultAlias) != null)
{
defaultAliasDropDown.Items.FindByValue(defaultAlias).Selected = true;
}
}
//Auto Add Portal Alias
if (new PortalController().GetPortals().Count > 1)
{
chkAutoAddPortalAlias.Enabled = false;
chkAutoAddPortalAlias.Checked = false;
}
else
{
chkAutoAddPortalAlias.Checked = HostController.Instance.GetBoolean("AutoAddPortalAlias");
}
}
开发者ID:patonomatic,项目名称:VUWTC,代码行数:41,代码来源:SiteSettings.ascx.cs
示例16: BindAliases
private void BindAliases(PortalInfo portal)
{
var portalSettings = new PortalSettings(portal);
var portalAliasController = new PortalAliasController();
var aliases = portalAliasController.GetPortalAliasArrayByPortalID(portal.PortalID);
var portalAliasMapping = portalSettings.PortalAliasMappingMode.ToString().ToUpper();
if (String.IsNullOrEmpty(portalAliasMapping))
{
portalAliasMapping = "CANONICALURL";
}
portalAliasModeButtonList.Select(portalAliasMapping, false);
BindDefaultAlias(aliases);
//Auto Add Portal Alias
if (new PortalController().GetPortals().Count > 1)
{
chkAutoAddPortalAlias.Enabled = false;
chkAutoAddPortalAlias.Checked = false;
}
else
{
chkAutoAddPortalAlias.Checked = HostController.Instance.GetBoolean("AutoAddPortalAlias");
}
}
开发者ID:hackoose,项目名称:cfi-team05,代码行数:26,代码来源:SiteSettings.ascx.cs
示例17: BindMarketing
private void BindMarketing(PortalInfo portal)
{
//Load DocTypes
var searchEngines = new Dictionary<string, string>
{
{ "Google", "http://www.google.com/addurl?q=" + Globals.HTTPPOSTEncode(Globals.AddHTTP(Globals.GetDomainName(Request))) },
{ "Yahoo", "http://siteexplorer.search.yahoo.com/submit" },
{ "Microsoft", "http://search.msn.com.sg/docs/submit.aspx" }
};
cboSearchEngine.DataSource = searchEngines;
cboSearchEngine.DataBind();
var portalAliasController = new PortalAliasController();
var aliases = portalAliasController.GetPortalAliasArrayByPortalID(portal.PortalID);
if (PortalController.IsChildPortal(portal, Globals.GetAbsoluteServerPath(Request)))
{
txtSiteMap.Text = Globals.AddHTTP(Globals.GetDomainName(Request)) + @"/SiteMap.aspx?portalid=" + portal.PortalID;
}
else
{
if (aliases.Count > 0)
{
//Get the first Alias
var objPortalAliasInfo = (PortalAliasInfo)aliases[0];
txtSiteMap.Text = Globals.AddHTTP(objPortalAliasInfo.HTTPAlias) + @"/SiteMap.aspx";
}
else
{
txtSiteMap.Text = Globals.AddHTTP(Globals.GetDomainName(Request)) + @"/SiteMap.aspx";
}
}
optBanners.SelectedIndex = portal.BannerAdvertising;
if (UserInfo.IsSuperUser)
{
lblBanners.Visible = false;
}
else
{
optBanners.Enabled = portal.BannerAdvertising != 2;
lblBanners.Visible = portal.BannerAdvertising == 2;
}
}
开发者ID:hackoose,项目名称:cfi-team05,代码行数:43,代码来源:SiteSettings.ascx.cs
示例18: AddPortalAlias
/// <summary>
/// Creates a new portal alias
/// </summary>
/// <param name="PortalId">Id of the portal</param>
/// <param name="PortalAlias">Portal Alias to be created</param>
/// <history>
/// [cnurse] 01/11/2005 created
/// </history>
public void AddPortalAlias( int PortalId, string PortalAlias )
{
PortalAliasController objPortalAliasController = new PortalAliasController();
//Check if the Alias exists
PortalAliasI
|
请发表评论