public static TabInfo LocaliseTab(TabInfo tab, int portalId) { var culture = DNNAbstract.GetCurrentCulture(); Dictionary<int, EaloTabInfo> ealoTabs; if (!ealoTabLookup.TryGetValue(culture, out ealoTabs)) { ealoTabs = Tabs.GetAllTabsAsDictionary(culture, true); lock (ealoTabLookup) { if (!ealoTabLookup.ContainsKey(culture)) { ealoTabLookup.Add(culture, ealoTabs); } } } EaloTabInfo ealoTab; if (ealoTabs.TryGetValue(tab.TabID, out ealoTab)) { if (ealoTab.EaloTabName != null) { tab.TabName = ealoTab.EaloTabName.StringTextOrFallBack; } if (ealoTab.EaloTitle != null) { tab.Title = ealoTab.EaloTitle.StringTextOrFallBack; } } return tab; }
public static TabInfo LocaliseTab(TabInfo tab, int portalId) { var culture = DNNAbstract.GetCurrentCulture(); Dictionary <int, EaloTabInfo> ealoTabs; if (!ealoTabLookup.TryGetValue(culture, out ealoTabs)) { ealoTabs = Tabs.GetAllTabsAsDictionary(culture, true); lock (ealoTabLookup) { if (!ealoTabLookup.ContainsKey(culture)) { ealoTabLookup.Add(culture, ealoTabs); } } } EaloTabInfo ealoTab; if (ealoTabs.TryGetValue(tab.TabID, out ealoTab)) { if (ealoTab.EaloTabName != null) { tab.TabName = ealoTab.EaloTabName.StringTextOrFallBack; } if (ealoTab.EaloTitle != null) { tab.Title = ealoTab.EaloTitle.StringTextOrFallBack; } } return(tab); }
public PageDetails(DotNetNuke.Entities.Tabs.TabInfo dnnTab) { if (dnnTab == null) { this.Id = -1; } else { this.PortalId = dnnTab.PortalID; this.Id = dnnTab.TabID; this.Name = dnnTab.TabName; this.Title = dnnTab.Title; this.Description = dnnTab.Description; this.Theme = dnnTab.SkinSrc; this.Container = dnnTab.ContainerSrc; this.Visible = dnnTab.IsVisible; this.Secure = dnnTab.IsSecure; this.Urls = new List <GenericListItem>(); this.Urls.Add(new GenericListItem() { Name = dnnTab.FullUrl, Value = dnnTab.FullUrl }); foreach (var tabUrl in dnnTab.TabUrls) { var newGenericItem = new GenericListItem(); newGenericItem.Name = tabUrl.SeqNum.ToString(); newGenericItem.Value = tabUrl.Url; this.Urls.Add(newGenericItem); } } this.AllPages = new List <GenericListItem>(); }
public PageModel(DotNetNuke.Entities.Tabs.TabInfo tab) : base(tab) { Container = tab.ContainerSrc; Url = tab.Url; Keywords = tab.KeyWords; Description = tab.Description; }
private static void AddUniqueUrlToIndex(string furlKey, ref string qsKey, string qsValue, int portalId, Hashtable queryStringIndex, FriendlyUrlOptions options, bool addSuffixIfDuplicateFound, out string suffix) { DotNetNuke.Entities.Tabs.TabController tc = new DotNetNuke.Entities.Tabs.TabController(); bool duplicate = false; suffix = "";//can hold a de-duplicating suffix int suffixCounter = 1; bool furlKeyUsed = false; do { duplicate = false;//always start in the assumption that this is not a duplicate DotNetNuke.Entities.Tabs.TabInfo matchingTab = tc.GetTabByName(qsKey, portalId); if (matchingTab != null) { duplicate = true; } else if (portalId >= 0) { matchingTab = tc.GetTabByName(qsKey, -1); //host tabs if (matchingTab != null) { duplicate = true; } } if (duplicate == false) { //try and add to index if (queryStringIndex.ContainsKey(qsKey) == false) { queryStringIndex.Add(qsKey, qsValue); } else { duplicate = true; } } if (duplicate == true) { if (furlKeyUsed == false) { furlKeyUsed = true; suffix = options.PunctuationReplacement + furlKey; qsKey += suffix; } else { suffix += suffixCounter.ToString(); qsKey += suffix; } } }while (duplicate == true && addSuffixIfDuplicateFound == true); }
protected void gvTeamsView_OnRowCommand(object sender, GridViewCommandEventArgs e) { int team_ID = 0; int.TryParse(e.CommandArgument.ToString(), out team_ID); if (e.CommandName.Equals("teamName")) { tInfo1 = tabs1.GetTabByName("Teams", PortalId); Response.Redirect(Globals.NavigateURL(tInfo1.TabID, "", "mctl=" + "conTeamAllDetail", "TeamID=" + team_ID)); } }
private void BindControls() { ArrayList tabs = DotNetNuke.Common.Globals.GetPortalTabs(PortalSettings.DesktopTabs, false, true, false, true); for (int i = 0; i < tabs.Count; i++) { DotNetNuke.Entities.Tabs.TabInfo tab = (DotNetNuke.Entities.Tabs.TabInfo)tabs[i]; ddlDesktopListID.Items.Add(new ListItem(tab.TabName, tab.TabID.ToString())); ddlDesktopViewID.Items.Add(new ListItem(tab.TabName, tab.TabID.ToString())); } }
public PageModelBase(DotNetNuke.Entities.Tabs.TabInfo tab) { this.Name = tab.TabName; this.ParentId = tab.ParentId; this.Path = tab.TabPath; this.TabId = tab.TabID; this.Skin = tab.SkinSrc; this.Title = tab.Title; this.IncludeInMenu = tab.IsVisible; this.IsDeleted = tab.IsDeleted; }
public override string FriendlyUrl(TabInfo tab, string path, string pageName, string portalAlias) { string friendlyPath = path; string matchString = ""; //Call GetFriendlyAlias to get the Alias part of the url friendlyPath = GetFriendlyAlias(path, portalAlias); //Call GetFriendlyQueryString to get the QueryString part of the url friendlyPath = GetFriendlyQueryString(tab, friendlyPath, pageName); return(friendlyPath); }
/// <summary> /// The Change Friendly Url method is called for every Url generated when a page is generated by DotNetNuke. This call sits 'underneath' the 'NavigateUrl' call in DotNetNuke. /// Whenever your module calls NavigateUrl, this method will be also called. In here, the module developer should modify the friendlyUrlPath to the final state required. /// However, because this call is used for all Urls on the page, not just those generated by the target module, some type of high-level filter should be used to make sure only /// the module Urls are modified. /// </summary> /// <param name="tab">Current Tab</param> /// <param name="friendlyUrlPath">Current Friendly Url Path after going through the Friendly Url Generation process of the Url Master module.</param> /// <param name="options">The options currently applying to Urls in this portal (space replacement, max length, etc)</param> /// <param name="cultureCode">The culture code being used for this Url (if supplied, may be empty)</param> /// <param name="endingPageName">The page name the Url has been called with. Normally default.aspx, but may be different for some modules.</param> /// <param name="useDnnPagePath">Out parameter to be set by the module. If true, the path of the DNN page will be in the Url (ie /pagename). If false, this part of the Url will be removed.</param> /// <param name="messages">List of debug messages. Add any debug information to this collection to help debug your provider. This can be seen in the repsonse headers, and also in the 'test Url Rewrite' page in the Url Master module.</param> /// <returns>System.String.</returns> public override string ChangeFriendlyUrl(DotNetNuke.Entities.Tabs.TabInfo tab, string friendlyUrlPath, iFinity.DNN.Modules.UrlMaster.FriendlyUrlOptions options, string cultureCode, ref string endingPageName, out bool useDnnPagePath, ref List <string> messages) { _options = options;//keep local copy of options //set default values for out parameters useDnnPagePath = true; if (messages == null) { messages = new List <string>(); } //check if we want to try and modify this Url //first check to see if this Url is an 'edit' Url - something that loads a module-specific page. //we don't want to mess with these, because they're always permissions based Urls and thus //no need to be friendly return(friendlyUrlPath); }
private void ConfigurarModulo() { tableBody.ClientIDMode = System.Web.UI.ClientIDMode.Static; DotNetNuke.Entities.Tabs.TabController TC = new DotNetNuke.Entities.Tabs.TabController(); DotNetNuke.Entities.Tabs.TabInfo TI = TC.GetTab(TabId, PortalId); MyURL = TI.FullUrl; for (int a = 0; a < TI.Modules.Count; a++) { DotNetNuke.Entities.Modules.ModuleInfo MyModule = TI.Modules[a] as ModuleInfo; if (MyModule.ModuleTitle == "Factura2") { modulofacturacion = true; } } }
protected void Page_Load(object sender, EventArgs e) { try { DotNetNuke.Entities.Tabs.TabController tabCont = new DotNetNuke.Entities.Tabs.TabController(); DotNetNuke.Entities.Tabs.TabInfo tab = tabCont.GetTabByName(UserInfo.Profile.IM, PortalId); if (tab != null && tab.TabID != null) { Response.Redirect(DotNetNuke.Common.Globals.NavigateURL(tab.TabID)); } } catch (Exception ex) { } }
protected override void RenderContents(HtmlTextWriter writer) { if (UserId == -1) { return; } try { string output = string.Empty; DotNetNuke.Entities.Portals.PortalSettings ps = (DotNetNuke.Entities.Portals.PortalSettings)(Context.Items["PortalSettings"]); DotNetNuke.Entities.Users.UserInfo cu = DotNetNuke.Entities.Users.UserController.GetCurrentUserInfo(); string imagePath = string.Empty; int portalId = ps.PortalId; string tmp = string.Empty; if (Template == null) { tmp = "<span class=\"aslabelsmbold\">[RESX:Posts]:</span> [AF:PROFILE:POSTCOUNT]<br />" + "<span class=\"aslabelsmbold\">[RESX:RankName]:</span> [AF:PROFILE:RANKNAME]<br />" + "<span class=\"aslabelsmbold\">[RESX:RankDisplay]:</span> [AF:PROFILE:RANKDISPLAY] <br />" + "<span class=\"aslabelsmbold\">[RESX:LastUpdate]:</span> [AF:PROFILE:DATELASTACTIVITY:d] <br />" + "<span class=\"aslabelsmbold\">[RESX:MemberSince]:</span> [AF:PROFILE:DATECREATED:d]"; } else { tmp = Template.Text; } if (ModuleId == -1) { DotNetNuke.Entities.Modules.ModuleController mc = new DotNetNuke.Entities.Modules.ModuleController(); DotNetNuke.Entities.Tabs.TabController tc = new DotNetNuke.Entities.Tabs.TabController(); DotNetNuke.Entities.Tabs.TabInfo ti = null; foreach (DotNetNuke.Entities.Modules.ModuleInfo mi in mc.GetModules(portalId)) { if (mi.DesktopModule.ModuleName.ToUpperInvariant() == "Active Forums".ToUpperInvariant()) { ModuleId = mi.ModuleID; break; } } } output = TemplateUtils.ParseProfileTemplate(tmp, UserId, portalId, ModuleId, cu.UserID, Convert.ToInt32(PortalSettings.Current.TimeZone.BaseUtcOffset.TotalMinutes)); output = Utilities.LocalizeControl(output); writer.Write(output); } catch (Exception ex) { writer.Write(ex.Message); } }
private void BindControls() { ArrayList tabs = DotNetNuke.Common.Globals.GetPortalTabs(PortalSettings.DesktopTabs, false, true, false, true); for (int i = 0; i < tabs.Count; i++) { DotNetNuke.Entities.Tabs.TabInfo tab = (DotNetNuke.Entities.Tabs.TabInfo)tabs[i]; ddlDesktopListID.Items.Add(new ListItem(tab.TabName, tab.TabID.ToString())); ddlDesktopViewID.Items.Add(new ListItem(tab.TabName, tab.TabID.ToString())); ddlBookingPageID.Items.Add(new ListItem(tab.TabName, tab.TabID.ToString())); } ddlBookingPageID.Items.Insert(0, new ListItem("", "-1")); CategoryController catdb = new CategoryController(); string sCatID = (Request.QueryString["id"] == null)?"":Request.QueryString["id"]; DataTable dt = catdb.LoadTree(false, PortalId, sCatID); DataRow row = dt.NewRow(); row["CatName"] = ""; row["CatID"] = 0; dt.Rows.InsertAt(row, 0); ddlParentID.DataSource = dt; ddlParentID.DataTextField = "CatName"; ddlParentID.DataValueField = "CatID"; ddlParentID.DataBind(); if (Request.QueryString["id"] != null) { NewsController newsCont = new NewsController(); Dictionary <int, NewsInfo> dicNews = newsCont.GetNewsByCat(Request.QueryString["id"]); ArrayList fLstNews = new ArrayList(); NewsInfo info = new NewsInfo(); info.ID = 0; info.Headline = ""; fLstNews.Add(info); foreach (NewsInfo fNewsInfo in dicNews.Values) { fLstNews.Add(fNewsInfo); } ddlNews.DataSource = fLstNews; ddlNews.DataTextField = "Headline"; ddlNews.DataValueField = "ID"; ddlNews.DataBind(); } }
internal static DotNetNuke.Entities.Tabs.TabInfo GetParentTab(DotNetNuke.Entities.Tabs.TabInfo relativeToTab, DTO.PagePositionMode location) { if (relativeToTab == null) { return(null); } var tabCtrl = new DotNetNuke.Entities.Tabs.TabController(); DotNetNuke.Entities.Tabs.TabInfo parentTab = null; if (location == DTO.PagePositionMode.ChildOf) { parentTab = relativeToTab; } else if ((relativeToTab != null) && relativeToTab.ParentId != Null.NullInteger) { parentTab = tabCtrl.GetTab(relativeToTab.ParentId, relativeToTab.PortalID, false); } return(parentTab); }
void ConfigurarModulo() { DotNetNuke.Entities.Tabs.TabController TC = new DotNetNuke.Entities.Tabs.TabController(); DotNetNuke.Entities.Tabs.TabInfo TI = TC.GetTab(TabId, PortalId); MyURL = TI.FullUrl; Log.ADD("Configuracion Modulo", this); hf_URL.Value = MyURL; if (cmb_Vendedor.Items.Count == 0) { System.Web.UI.WebControls.ListItem LI = new System.Web.UI.WebControls.ListItem("Ninguno", "0"); cmb_Vendedor.Items.Add(LI); List <Struct_Vendedores> LV = Data2.Class.Struct_Vendedores.GetAllVendedores(UserId); if (LV != null) { foreach (Struct_Vendedores V in LV) { System.Web.UI.WebControls.ListItem _LI = new System.Web.UI.WebControls.ListItem(V.NombreVendedor, V.Id.ToString()); cmb_Vendedor.Items.Add(_LI); } } } }
public override string FriendlyUrl( TabInfo tab, string path, string pageName ) { PortalSettings _portalSettings = PortalController.GetCurrentPortalSettings(); return FriendlyUrl( tab, path, pageName, _portalSettings ); }
/// <summary> /// The Change Friendly Url method is called for every Url generated when a page is generated by DotNetNuke. This call sits 'underneath' the 'NavigateUrl' call in DotNetNuke. /// Whenever your module calls NavigateUrl, this method will be also called. In here, the module developer should modify the friendlyUrlPath to the final state required. /// However, because this call is used for all Urls on the page, not just those generated by the target module, some type of high-level filter should be used to make sure only /// the module Urls are modified. /// /// </summary> /// <param name="tab">Current Tab</param> /// <param name="friendlyUrlPath">Current Friendly Url Path after going through the Friendly Url Generation process of the Url Master module.</param> /// <param name="options">The options currently applying to Urls in this portal (space replacement, max length, etc)</param> /// <param name="cultureCode">The culture code being used for this Url (if supplied, may be empty)</param> /// <param name="endingPageName">The page name the Url has been called with. Normally default.aspx, but may be different for some modules.</param> /// <param name="useDnnPagePath">Out parameter to be set by the module. If true, the path of the DNN page will be in the Url (ie /pagename). If false, this part of the Url will be removed. </param> /// <param name="messages">List of debug messages. Add any debug information to this collection to help debug your provider. This can be seen in the repsonse headers, and also in the 'test Url Rewrite' page in the Url Master module.</param> /// <returns></returns> public override string ChangeFriendlyUrl(DotNetNuke.Entities.Tabs.TabInfo tab, string friendlyUrlPath, iFinity.DNN.Modules.UrlMaster.FriendlyUrlOptions options, string cultureCode, ref string endingPageName, out bool useDnnPagePath, ref List <string> messages) { _options = options;//keep local copy of options //set default values for out parameters useDnnPagePath = true; if (messages == null) { messages = new List <string>(); } //check if we want to try and modify this Url //first check to see if this Url is an 'edit' Url - something that loads a module-specific page. //we don't want to mess with these, because they're always permissions based Urls and thus //no need to be friendly if (Regex.IsMatch(friendlyUrlPath, @"(^|/)(mid|moduleId)/\d+/?", RegexOptions.IgnoreCase) == false) { Hashtable friendlyUrlIndex = null; //the friendly url index is the lookup we use //try and match incoming friendly url path to what we would expect from the module //NOTE: regex used here but can be any type of logic to determine if this is a friendly url that applies to the module //There will be many different urls created for this tab, so we only want to change the ones we know apply to this module //by way of looking for a certain pattern or other unique marker in the Url. //For this example, match by looking for 'itemId' - normally the Url would be /pagename/tabid/xx/itemid/yy/default.aspx Regex itemUrlRegex = new Regex(@"(?<l>/)?ItemId/(?<itemId>\d+)", RegexOptions.IgnoreCase); Match itemUrlMatch = itemUrlRegex.Match(friendlyUrlPath); if (itemUrlMatch.Success) { //this is a Url we want to modify string rawId = itemUrlMatch.Groups["itemId"].Value; int itemId = 0; if (int.TryParse(rawId, out itemId)) { //we have obtained the item Id out of the Url //get the friendlyUrlIndex (it comes from the database via the cache) friendlyUrlIndex = UrlController.GetFriendlyUrlIndex(tab.TabID, tab.PortalID, this, options); if (friendlyUrlIndex != null) { //item urls are indexed with i + itemId ("i5") - this is so we could mix and match entities if necessary string furlkey = "i" + itemId.ToString(); //create the lookup key for the friendly url index string path = (string)friendlyUrlIndex[furlkey]; //check if in the index if (path == null) { //don't normally expect to have a no-match with a friendly url path when an itemId was in the Url. //could be a new item that has been created and isn't in the index //do a direct call and find out if it's there path = UrlController.CheckForMissingItemId(itemId, tab.TabID, tab.PortalID, this, options, ref messages); } if (path != null) //got a valid path { //url found in the index for this entry. So replace the matched part of the path with the friendly url if (itemUrlMatch.Groups["l"].Success) //if the path had a leading /, then make sure to add that onto the replacement { path = base.EnsureLeadingChar("/", path); } /* finish it all off */ messages.Add("Item Friendly Url Replacing : " + friendlyUrlPath + " in Path : " + path); //this is the point where the Url is modified! //replace the path in the path - which leaves any other parts of a path intact. friendlyUrlPath = itemUrlRegex.Replace(friendlyUrlPath, path);//replace the part in the friendly Url path with it's replacement. //check if this tab is the one specified to not use a path if (_noDnnPagePathTabId == tab.TabID) { useDnnPagePath = false;//make this Url relative from the site root } //set back to default.aspx so that Url Master removes it - just in case it wasn't standard endingPageName = DotNetNuke.Common.Globals.glbDefaultPage; } } } } } return(friendlyUrlPath); }
public override string FriendlyUrl( TabInfo tab, string path, string pageName, string portalAlias ) { string friendlyPath = path; string matchString = ""; //Call GetFriendlyAlias to get the Alias part of the url friendlyPath = GetFriendlyAlias( path, portalAlias ); //Call GetFriendlyQueryString to get the QueryString part of the url friendlyPath = GetFriendlyQueryString( tab, friendlyPath, pageName ); return friendlyPath; }
/// <summary> /// GetFriendlyQueryString gets the Querystring part of the friendly url /// </summary> /// <remarks> /// </remarks> /// <param name="tab">The tab whose url is being formatted.</param> /// <param name="path">The path to format.</param> /// <returns>The formatted url</returns> /// <history> /// [cnurse] 12/16/2004 created /// [smcculloch]10/10/2005 Regex update for rewritten characters /// </history> private string GetFriendlyQueryString( TabInfo tab, string path, string pageName ) { string friendlyPath = path; Match queryStringMatch = Regex.Match( friendlyPath, "(.[^\\\\?]*)\\\\?(.*)", RegexOptions.IgnoreCase ); string queryStringSpecialChars = ""; if( !( queryStringMatch == Match.Empty ) ) { friendlyPath = queryStringMatch.Groups[1].Value; friendlyPath = Regex.Replace( friendlyPath, Globals.glbDefaultPage, "", RegexOptions.IgnoreCase ); string queryString = queryStringMatch.Groups[2].Value.Replace( "&", "&" ); if( queryString.StartsWith( "?" ) ) { queryString = queryString.TrimStart( Convert.ToChar( "?" ) ); } string[] nameValuePairs = queryString.Split( Convert.ToChar( "&" ) ); for( int i = 0; i <= nameValuePairs.Length - 1; i++ ) { string pathToAppend = ""; string[] pair = nameValuePairs[i].Split( Convert.ToChar( "=" ) ); //Add name part of name/value pair if( friendlyPath.EndsWith( "/" ) ) { pathToAppend = pathToAppend + pair[0]; } else { pathToAppend = pathToAppend + "/" + pair[0]; } if( pair.Length > 1 ) { if( pair[1].Length > 0 ) { if( Regex.IsMatch( pair[1], _regexMatch ) == false ) { // Contains Non-AlphaNumeric Characters if( pair[0].ToLower() == "tabid" ) { if( Information.IsNumeric( pair[1] ) ) { if( !( tab == null ) ) { int tabId = Convert.ToInt32( pair[1] ); if( tab.TabID == tabId ) { if( ( tab.TabPath != Null.NullString ) && IncludePageName ) { pathToAppend = tab.TabPath.Replace( "//", "/" ).TrimStart( '/' ) + "/" + pathToAppend; } } } } } pathToAppend = pathToAppend + "/" + pair[1].Replace( " ", HttpUtility.UrlEncode( ( '\u0020' ).ToString() ) ); } else { // Rewrite into URL, contains only alphanumeric and the % or space if( queryStringSpecialChars.Length == 0 ) { queryStringSpecialChars = pair[0] + "=" + pair[1]; } else { queryStringSpecialChars = queryStringSpecialChars + "&" + pair[0] + "=" + pair[1]; } pathToAppend = ""; } } else { pathToAppend = pathToAppend + "/" + HttpUtility.UrlEncode( ( '\u0020' ).ToString() ); } } friendlyPath = friendlyPath + pathToAppend; } } if( queryStringSpecialChars.Length > 0 ) { return AddPage( friendlyPath, pageName ) + "?" + queryStringSpecialChars; } else { return AddPage( friendlyPath, pageName ); } }
public TabInfo LocaliseTab(TabInfo tab, int portalId) { return(EaloWorker.LocaliseTab(tab, portalId)); }
public override string FriendlyUrl(TabInfo tab, string path) { PortalSettings _portalSettings = PortalController.GetCurrentPortalSettings(); return(FriendlyUrl(tab, path, Globals.glbDefaultPage, _portalSettings)); }
/// <summary> /// The Change Friendly Url method is called for every Url generated when a page is generated by DotNetNuke. This call sits 'underneath' the 'NavigateUrl' call in DotNetNuke. /// Whenever your module calls NavigateUrl, this method will be also called. In here, the module developer should modify the friendlyUrlPath to the final state required. /// However, because this call is used for all Urls on the page, not just those generated by the target module, some type of high-level filter should be used to make sure only /// the module Urls are modified. /// /// </summary> /// <param name="tab">Current Tab</param> /// <param name="friendlyUrlPath">Current Friendly Url Path after going through the Friendly Url Generation process of the Url Master module.</param> /// <param name="options">The options currently applying to Urls in this portal (space replacement, max length, etc)</param> /// <param name="cultureCode">The culture code being used for this Url (if supplied, may be empty)</param> /// <param name="endingPageName">The page name the Url has been called with. Normally default.aspx, but may be different for some modules.</param> /// <param name="useDnnPagePath">Out parameter to be set by the module. If true, the path of the DNN page will be in the Url (ie /pagename). If false, this part of the Url will be removed. </param> /// <param name="messages">List of debug messages. Add any debug information to this collection to help debug your provider. This can be seen in the repsonse headers, and also in the 'test Url Rewrite' page in the Url Master module.</param> /// <returns></returns> public override string ChangeFriendlyUrl(DotNetNuke.Entities.Tabs.TabInfo tab, string friendlyUrlPath, FriendlyUrlOptions options, string cultureCode, ref string endingPageName, out bool useDnnPagePath, ref List <string> messages) { //no modifications to urls for this provider useDnnPagePath = true; return(friendlyUrlPath); }
public TabInfo LocaliseTab(TabInfo tab, int portalId) { return EaloWorker.LocaliseTab(tab, portalId); }
/// <summary> /// Creates a friendly article url, depending on the options /// </summary> /// <param name="provider"></param> /// <param name="articleUrlMatch"></param> /// <param name="articleUrlRegex"></param> /// <param name="friendlyUrlPath"></param> /// <param name="tab"></param> /// <param name="options"></param> /// <param name="urlOptions"></param> /// <param name="cultureCode"></param> /// <param name="endingPageName"></param> /// <param name="useDnnPagePath"></param> /// <param name="messages"></param> /// <param name="articleUrl"></param> /// <returns></returns> internal static bool MakeArticleUrl(NewsArticlesModuleProvider provider, Match articleUrlMatch, Regex articleUrlRegex, string friendlyUrlPath, DotNetNuke.Entities.Tabs.TabInfo tab, FriendlyUrlOptions options, TabUrlOptions urlOptions, string cultureCode, ref string endingPageName, ref bool useDnnPagePath, ref List <string> messages, out string articleUrl) { bool result = false; articleUrl = null; //this is a url that looks like an article url. We want to modify it and create the new one. string rawId = articleUrlMatch.Groups["artid"].Value; int articleId = 0; if (int.TryParse(rawId, out articleId) && (provider.StartingArticleId <= articleId)) { Hashtable friendlyUrlIndex = null; //the friendly url index is the lookup we use //we have obtained the item Id out of the Url //get the friendlyUrlIndex (it comes from the database via the cache) friendlyUrlIndex = UrlController.GetFriendlyUrlIndex(tab.TabID, tab.PortalID, provider, options, urlOptions); if (friendlyUrlIndex != null) { string furlkey = null; int pageId = -1; //first check if we are seeking page or article if (articleUrlMatch.Groups["pageid"].Success) { //page item urls are index by p + page id. But we only use this if it is present //ie pages override articles when both are present string rawPageId = articleUrlMatch.Groups["pageid"].Value; if (int.TryParse(rawPageId, out pageId)) { furlkey = "p" + rawPageId; } } else { //item urls are indexed with a + articleId ("a5") - this is so we could mix and match entities if necessary furlkey = "a" + articleId.ToString(); //create the lookup key for the friendly url index } string path = (string)friendlyUrlIndex[furlkey]; //check if in the index if (path == null) { //don't normally expect to have a no-match with a friendly url path when an articleId was in the Url. //could be that the page id is bunk - in that case, just use the article Id if (furlkey.Contains("p")) { furlkey = "a" + articleId.ToString(); //create the lookup key for the friendly url index path = (string)friendlyUrlIndex[furlkey]; //check if in the index } if (path == null) { //could be a new item that has been created and isn't in the index //do a direct call and find out if it's there path = UrlController.CheckForMissingNewsArticleItem(articleId, "article", tab.TabID, tab.PortalID, provider, options, urlOptions, ref messages); } } if (path != null) //got a valid path { //url found in the index for this entry. So replace the matched part of the path with the friendly url if (articleUrlMatch.Groups["l"].Success) //if the path had a leading /, then make sure to add that onto the replacement { path = provider.EnsureLeadingChar("/", path); } /* finish it all off */ messages.Add("Item Friendly Url Replacing : " + friendlyUrlPath + " in Path : " + path); //this is the point where the Url is modified! //replace the path in the path - which leaves any other parts of a path intact. articleUrl = articleUrlRegex.Replace(friendlyUrlPath, path);//replace the part in the friendly Url path with it's replacement. //check if this tab is the one specified to not use a path if (provider.NoDnnPagePathTabId == tab.TabID) { useDnnPagePath = false;//make this Url relative from the site root } //set back to default.aspx so that Url Master removes it - just in case it wasn't standard endingPageName = DotNetNuke.Common.Globals.glbDefaultPage; result = true; } } } return(result); }
internal static bool MakeArchiveUrl(NewsArticlesModuleProvider provider, Match archiveUrlMatch, Regex archiveUrlRegex, string friendlyUrlPath, DotNetNuke.Entities.Tabs.TabInfo tab, FriendlyUrlOptions options, TabUrlOptions urlOptions, string cultureCode, ref string endingPageName, ref bool useDnnPagePath, ref List <string> messages, out string archiveUrl) { archiveUrl = friendlyUrlPath; bool result = false; Group mthGrp = archiveUrlMatch.Groups["mth"]; Group yrGrp = archiveUrlMatch.Groups["yr"]; bool month = false, year = false; string mm = null, yyyy = null; string path = null; if (mthGrp != null && mthGrp.Success) { //contains a month month = true; mm = archiveUrlMatch.Groups["mm"].Value; } if (yrGrp != null && yrGrp.Success) { year = true; yyyy = archiveUrlMatch.Groups["yyyy"].Value; } if (year) { path = "/" + yyyy; } if (month) { path += "/" + mm; } if (path != null) //got a valid path { //have a valid url replacement for this url. So replace the matched part of the path with the friendly url if (archiveUrlMatch.Groups["l"].Success) //if the path had a leading /, then make sure to add that onto the replacement { path = provider.EnsureLeadingChar("/", path); } /* finish it all off */ messages.Add("Item Friendly Url Replacing Archive Url : " + friendlyUrlPath + " with Path : " + path); //this is the point where the Url is modified! //replace the path in the path - which leaves any other parts of a path intact. archiveUrl = archiveUrlRegex.Replace(friendlyUrlPath, path);//replace the part in the friendly Url path with it's replacement. //check if this tab is the one specified to not use a path if (provider.NoDnnPagePathTabId == tab.TabID) { useDnnPagePath = false;//make this Url relative from the site root } //set back to default.aspx so that Url Master removes it - just in case it wasn't standard endingPageName = DotNetNuke.Common.Globals.glbDefaultPage; //return success result = true; } return(result); }
internal static bool MakeCategoryUrl(NewsArticlesModuleProvider provider, Match categoryUrlMatch, Regex categoryUrlRegex, string friendlyUrlPath, DotNetNuke.Entities.Tabs.TabInfo tab, FriendlyUrlOptions options, TabUrlOptions urlOptions, string cultureCode, ref string endingPageName, ref bool useDnnPagePath, ref List <string> messages, out string categoryUrl) { bool result = false; categoryUrl = null; //this is a url that looks like an category url. We want to modify it and create the new one. string rawId = categoryUrlMatch.Groups["catid"].Value; int categoryId = 0; if (int.TryParse(rawId, out categoryId)) { Hashtable friendlyUrlIndex = null; //the friendly url index is the lookup we use //we have obtained the item Id out of the Url //get the friendlyUrlIndex (it comes from the database via the cache) friendlyUrlIndex = UrlController.GetFriendlyUrlIndex(tab.TabID, tab.PortalID, provider, options, urlOptions); if (friendlyUrlIndex != null) { //item urls are indexed with a + category id ("c5") - this is so authors/articles/categories can be mixed and matched string furlkey = "c" + categoryId.ToString(); //create the lookup key for the friendly url index string path = (string)friendlyUrlIndex[furlkey]; //check if in the index if (path == null) { //don't normally expect to have a no-match with a friendly url path when an categoryId was in the Url. //could be a new item that has been created and isn't in the index //do a direct call and find out if it's there //path = UrlController.CheckForMissingNewscategoryItem(categoryId, "category", tab.TabID, tab.PortalID, provider, options, urlOptions, ref messages); } if (path != null) //got a valid path { //url found in the index for this entry. So replace the matched part of the path with the friendly url if (categoryUrlMatch.Groups["l"].Success) //if the path had a leading /, then make sure to add that onto the replacement { path = provider.EnsureLeadingChar("/", path); } /* finish it all off */ messages.Add("Item Friendly Url Replacing : " + friendlyUrlPath + " in Path : " + path); //this is the point where the Url is modified! //replace the path in the path - which leaves any other parts of a path intact. categoryUrl = categoryUrlRegex.Replace(friendlyUrlPath, path);//replace the part in the friendly Url path with it's replacement. //check if this tab is the one specified to not use a path if (provider.NoDnnPagePathTabId == tab.TabID) { useDnnPagePath = false;//make this Url relative from the site root } //set back to default.aspx so that Url Master removes it - just in case it wasn't standard endingPageName = DotNetNuke.Common.Globals.glbDefaultPage; result = true; } } } return(result); }
/// <summary> /// GetFriendlyQueryString gets the Querystring part of the friendly url /// </summary> /// <remarks> /// </remarks> /// <param name="tab">The tab whose url is being formatted.</param> /// <param name="path">The path to format.</param> /// <returns>The formatted url</returns> /// <history> /// [cnurse] 12/16/2004 created /// [smcculloch]10/10/2005 Regex update for rewritten characters /// </history> private string GetFriendlyQueryString(TabInfo tab, string path, string pageName) { string friendlyPath = path; Match queryStringMatch = Regex.Match(friendlyPath, "(.[^\\\\?]*)\\\\?(.*)", RegexOptions.IgnoreCase); string queryStringSpecialChars = ""; if (!(queryStringMatch == Match.Empty)) { friendlyPath = queryStringMatch.Groups[1].Value; friendlyPath = Regex.Replace(friendlyPath, Globals.glbDefaultPage, "", RegexOptions.IgnoreCase); string queryString = queryStringMatch.Groups[2].Value.Replace("&", "&"); if (queryString.StartsWith("?")) { queryString = queryString.TrimStart(Convert.ToChar("?")); } string[] nameValuePairs = queryString.Split(Convert.ToChar("&")); for (int i = 0; i <= nameValuePairs.Length - 1; i++) { string pathToAppend = ""; string[] pair = nameValuePairs[i].Split(Convert.ToChar("=")); //Add name part of name/value pair if (friendlyPath.EndsWith("/")) { pathToAppend = pathToAppend + pair[0]; } else { pathToAppend = pathToAppend + "/" + pair[0]; } if (pair.Length > 1) { if (pair[1].Length > 0) { if (Regex.IsMatch(pair[1], _regexMatch) == false) { // Contains Non-AlphaNumeric Characters if (pair[0].ToLower() == "tabid") { if (Information.IsNumeric(pair[1])) { if (!(tab == null)) { int tabId = Convert.ToInt32(pair[1]); if (tab.TabID == tabId) { if ((tab.TabPath != Null.NullString) && IncludePageName) { pathToAppend = tab.TabPath.Replace("//", "/").TrimStart('/') + "/" + pathToAppend; } } } } } pathToAppend = pathToAppend + "/" + pair[1].Replace(" ", HttpUtility.UrlEncode(('\u0020').ToString())); } else { // Rewrite into URL, contains only alphanumeric and the % or space if (queryStringSpecialChars.Length == 0) { queryStringSpecialChars = pair[0] + "=" + pair[1]; } else { queryStringSpecialChars = queryStringSpecialChars + "&" + pair[0] + "=" + pair[1]; } pathToAppend = ""; } } else { pathToAppend = pathToAppend + "/" + HttpUtility.UrlEncode(('\u0020').ToString()); } } friendlyPath = friendlyPath + pathToAppend; } } if (queryStringSpecialChars.Length > 0) { return(AddPage(friendlyPath, pageName) + "?" + queryStringSpecialChars); } else { return(AddPage(friendlyPath, pageName)); } }
/// <summary> /// The Change Friendly Url method is called for every Url generated when a page is generated by DotNetNuke. This call sits 'underneath' the 'NavigateUrl' call in DotNetNuke. /// Whenever your module calls NavigateUrl, this method will be also called. In here, the module developer should modify the friendlyUrlPath to the final state required. /// However, because this call is used for all Urls on the page, not just those generated by the target module, some type of high-level filter should be used to make sure only /// the module Urls are modified. /// /// </summary> /// <param name="tab">Current Tab</param> /// <param name="friendlyUrlPath">Current Friendly Url Path after going through the Friendly Url Generation process of the Url Master module.</param> /// <param name="options">The options currently applying to Urls in this portal (space replacement, max length, etc)</param> /// <param name="cultureCode">The culture code being used for this Url (if supplied, may be empty)</param> /// <param name="endingPageName">The page name the Url has been called with. Normally default.aspx, but may be different for some modules.</param> /// <param name="useDnnPagePath">Out parameter to be set by the module. If true, the path of the DNN page will be in the Url (ie /pagename). If false, this part of the Url will be removed. </param> /// <param name="messages">List of debug messages. Add any debug information to this collection to help debug your provider. This can be seen in the repsonse headers, and also in the 'test Url Rewrite' page in the Url Master module.</param> /// <returns></returns> public override string ChangeFriendlyUrl(DotNetNuke.Entities.Tabs.TabInfo tab, string friendlyUrlPath, FriendlyUrlOptions options, string cultureCode, ref string endingPageName, out bool useDnnPagePath, ref List <string> messages) { IsInitialized(); _options = options;//keep local copy of options TabUrlOptions urlOptions = GetTabUrlOptions(tab.TabID); //set default values for out parameters useDnnPagePath = true; if (messages == null) { messages = new List <string>(); } //check if we want to try and modify this Url //first check to see if this Url is an 'edit' Url - something that loads a module-specific page. //we don't want to mess with these, because they're always permissions based Urls and thus //no need to be friendly if (Regex.IsMatch(friendlyUrlPath, @"(^|/)(mid|moduleId)/\d+/?", RegexOptions.IgnoreCase) == false) { //try and match incoming friendly url path to what we would expect from the module //NOTE: regex used here but can be any type of logic to determine if this is a friendly url that applies to the module //There will be many different urls created for this tab, so we only want to change the ones we know apply to this module //by way of looking for a certain pattern or other unique marker in the Url. //For this example, match by looking for 'articleId' - normally the Url would be /pagename/tabid/xx/articleId/yy/default.aspx bool replacementFound = false; if (!replacementFound) { //redundant if, but blocks together statements for consistency and localises variables //matches category and page optionally, because these are sometime-addendums to the base article ID Regex articleUrlRegex = new Regex(@"((?<l>/)?articleType/ArticleView/articleId/|/id/)(?<artid>\d+)(/PageId/(?<pageid>\d+))?(/categoryId/(?<catid>\d+))?", RegexOptions.IgnoreCase); Match articleUrlMatch = articleUrlRegex.Match(friendlyUrlPath); if (articleUrlMatch.Success) { string articleUrl = ""; replacementFound = UrlController.MakeArticleUrl(this, articleUrlMatch, articleUrlRegex, friendlyUrlPath, tab, options, urlOptions, cultureCode, ref endingPageName, ref useDnnPagePath, ref messages, out articleUrl); if (replacementFound) { friendlyUrlPath = articleUrl; } } } if (!replacementFound) { //no match on article - next check is for a category match Regex authorUrlRegex = new Regex(@"(?<l>/)?articleType/AuthorView/authorId/(?<authid>\d+)", RegexOptions.IgnoreCase); Match authorUrlMatch = authorUrlRegex.Match(friendlyUrlPath); if (authorUrlMatch.Success) { string authorUrl = ""; replacementFound = UrlController.MakeAuthorUrl(this, authorUrlMatch, authorUrlRegex, friendlyUrlPath, tab, options, urlOptions, cultureCode, ref endingPageName, ref useDnnPagePath, ref messages, out authorUrl); if (replacementFound) { friendlyUrlPath = authorUrl; } } } if (!replacementFound) { //no match on article - next check is for a category match Regex categoryUrlRegex = new Regex(@"(?<l>/)?articleType/CategoryView/categoryId/(?<catid>\d+)", RegexOptions.IgnoreCase); Match categoryUrlMatch = categoryUrlRegex.Match(friendlyUrlPath); if (categoryUrlMatch.Success) { string categoryUrl = ""; replacementFound = UrlController.MakeCategoryUrl(this, categoryUrlMatch, categoryUrlRegex, friendlyUrlPath, tab, options, urlOptions, cultureCode, ref endingPageName, ref useDnnPagePath, ref messages, out categoryUrl); if (replacementFound) { friendlyUrlPath = categoryUrl; } } } if (!replacementFound) { Regex archiveUrlRegex = new Regex(@"(?<l>/)?articleType/ArchiveView(?<mth>/month/(?<mm>\d+))?(?<yr>/year/(?<yyyy>\d+))?", RegexOptions.IgnoreCase); Match archiveUrlMatch = archiveUrlRegex.Match(friendlyUrlPath); if (archiveUrlMatch.Success) { string archiveUrl = ""; replacementFound = UrlController.MakeArchiveUrl(this, archiveUrlMatch, archiveUrlRegex, friendlyUrlPath, tab, options, urlOptions, cultureCode, ref endingPageName, ref useDnnPagePath, ref messages, out archiveUrl); if (replacementFound) { friendlyUrlPath = archiveUrl; } } } if (replacementFound) { friendlyUrlPath = base.EnsureLeadingChar("/", friendlyUrlPath); } } return(friendlyUrlPath); }
public override string FriendlyUrl(TabInfo tab, string path, string pageName) { PortalSettings _portalSettings = PortalController.GetCurrentPortalSettings(); return(FriendlyUrl(tab, path, pageName, _portalSettings)); }
public override string FriendlyUrl( TabInfo tab, string path ) { PortalSettings _portalSettings = PortalController.GetCurrentPortalSettings(); return FriendlyUrl( tab, path, Globals.glbDefaultPage, _portalSettings ); }
protected void Page_Load(object sender, EventArgs e) { //Register Jquery Usage jQuery.RequestRegistration(); jQuery.RequestUIRegistration(); jQuery.RequestDnnPluginsRegistration(); if (currentUser.IsSuperUser || currentUser.IsInRole("clubadmin")) { m_ModuelControl = "frmClub.ascx"; } else { m_ModuelControl = "frmSeason.ascx"; li_HomeLink.Visible = false; li_SportsRegistration.Visible = false; li_SeasonLink.Visible = false; li_ClubeRegistrationLink.Visible = false; li_Masters.Visible = false; li_ClubMemberType.Visible = false; li_UserType.Visible = false; li_Registration.Visible = false; li_AddDocumentsType.Visible = false; li_Event.Visible = false; li_SponsorType.Visible = false; li_SponsorLevel.Visible = false; li_PlayerType.Visible = false; li_TeamMemberType.Visible = false; li_Sponsor.Visible = false; li_Media.Visible = false; li_News.Visible = false; li_Pictures.Visible = false; li_Videos.Visible = false; li_MatchType.Visible = false; li_MerchandiseType.Visible = false; //li_MerchandiseTYpe.Visible = false; li_Album.Visible = false; //li_UserRole.Visible = false; //li_TournamentLink.Visible = false; //li_SponsorRegLink.Visible = false; //li_TeamProfile.Visible = false; //li_UserRegLink.Visible = false; //li_LocationLink.Visible = false; //li_NewsLink.Visible = false; //li_NationalTeamLink.Visible = false; //li_NationalTeamListLink.Visible = false; //li_NationalTeamPlayerAssignInGameLink.Visible = false; //li_PollLink.Visible = false; //li_SuspensionLink.Visible = false; //li_AssignAwards.Visible = false; //li_AssignAwardsPosition.Visible = false; //li_AwardsList.Visible = false; //li_AssignWinner.Visible = false; //li_AssignWinnerPosition.Visible = false; //li_WinnerList.Visible = false; //li_Reports.Visible = false; //li_ReportTopScorer.Visible = false; } try { LoadModuleControl(); } catch (Exception exc) //Module failed to load { Exceptions.ProcessModuleLoadException(this, exc); } if (!Page.IsPostBack) { //Get Home Page TabId tInfo1 = tabs1.GetTabByName("Home", PortalId); HomeLink.NavigateUrl = Globals.NavigateURL(tInfo1.TabID, ""); hlSports.NavigateUrl = Globals.NavigateURL(PortalSettings.ActiveTab.TabID, "", "mctl=" + "frmSports"); hlSeason.NavigateUrl = Globals.NavigateURL(PortalSettings.ActiveTab.TabID, "", "mctl=" + "frmSeason"); hlClub.NavigateUrl = Globals.NavigateURL(PortalSettings.ActiveTab.TabID, "", "mctl=" + "frmClub"); hlClubMemberType.NavigateUrl = Globals.NavigateURL(PortalSettings.ActiveTab.TabID, "", "mctl=" + "frmClubMemberType"); hlUserType.NavigateUrl = Globals.NavigateURL(PortalSettings.ActiveTab.TabID, "", "mctl=" + "frmUserType"); hlRegistration.NavigateUrl = Globals.NavigateURL(PortalSettings.ActiveTab.TabID, "", "mctl=" + "frmRegistration"); hlAddDocumentsType.NavigateUrl = Globals.NavigateURL(PortalSettings.ActiveTab.TabID, "", "mctl=" + "frmAddDocumentsType"); hlEvent.NavigateUrl = Globals.NavigateURL(PortalSettings.ActiveTab.TabID, "", "mctl=" + "frmEvent"); hlSponsorType.NavigateUrl = Globals.NavigateURL(PortalSettings.ActiveTab.TabID, "", "mctl=" + "frmSponsorType"); hlSponsorLevel.NavigateUrl = Globals.NavigateURL(PortalSettings.ActiveTab.TabID, "", "mctl=" + "frmSponsorLevel"); hlPlayerType.NavigateUrl = Globals.NavigateURL(PortalSettings.ActiveTab.TabID, "", "mctl=" + "frmPlayerType"); hlTeamMemberType.NavigateUrl = Globals.NavigateURL(PortalSettings.ActiveTab.TabID, "", "mctl=" + "frmTeamMemberType"); hlSponsor.NavigateUrl = Globals.NavigateURL(PortalSettings.ActiveTab.TabID, "", "mctl=" + "frmSponsor"); hlNews.NavigateUrl = Globals.NavigateURL(PortalSettings.ActiveTab.TabID, "", "mctl=" + "frmNews"); hlPictures.NavigateUrl = Globals.NavigateURL(PortalSettings.ActiveTab.TabID, "", "mctl=" + "frmPictures"); hlVideos.NavigateUrl = Globals.NavigateURL(PortalSettings.ActiveTab.TabID, "", "mctl=" + "frmVideos"); //hlUserRole.NavigateUrl = Globals.NavigateURL(PortalSettings.ActiveTab.TabID, "", "mctl=" + "frmUserRole"); hlAlbum.NavigateUrl = Globals.NavigateURL(PortalSettings.ActiveTab.TabID, "", "mctl=" + "frmAlbum"); hlAssignPlayerInTeam.NavigateUrl = Globals.NavigateURL(PortalSettings.ActiveTab.TabID, "", "mctl=" + "frmAssignPlayerInTeam"); hlCompetitionType.NavigateUrl = Globals.NavigateURL(PortalSettings.ActiveTab.TabID, "", "mctl=" + "frmCompetitionType"); hlCompetitionLeague.NavigateUrl = Globals.NavigateURL(PortalSettings.ActiveTab.TabID, "", "mctl=" + "frmCompetitionLeague"); hlCompetitionFormat.NavigateUrl = Globals.NavigateURL(PortalSettings.ActiveTab.TabID, "", "mctl=" + "frmCompetitionFormat"); hlCompetition.NavigateUrl = Globals.NavigateURL(PortalSettings.ActiveTab.TabID, "", "mctl=" + "frmCompetition"); hlDivision.NavigateUrl = Globals.NavigateURL(PortalSettings.ActiveTab.TabID, "", "mctl=" + "frmDivision"); hlTeam.NavigateUrl = Globals.NavigateURL(PortalSettings.ActiveTab.TabID, "", "mctl=" + "frmTeam"); hlLocation.NavigateUrl = Globals.NavigateURL(PortalSettings.ActiveTab.TabID, "", "mctl=" + "frmLocation"); hlMatchStatus.NavigateUrl = Globals.NavigateURL(PortalSettings.ActiveTab.TabID, "", "mctl=" + "frmMatchStatus"); hlMatchType.NavigateUrl = Globals.NavigateURL(PortalSettings.ActiveTab.TabID, "", "mctl=" + "frmMatchType"); hlMerchandiseType.NavigateUrl = Globals.NavigateURL(PortalSettings.ActiveTab.TabID, "", "mctl=" + "frmMerchandiseType"); hlMerchandise.NavigateUrl = Globals.NavigateURL(PortalSettings.ActiveTab.TabID, "", "mctl=" + "frmMerchandise"); } }
protected void Page_Load(object sender, EventArgs e) { try { NewsController cont = new NewsController(); int tabid = 0; DotNetNuke.Entities.Tabs.TabController tabCont = new DotNetNuke.Entities.Tabs.TabController(); DotNetNuke.Entities.Tabs.TabInfo tab = tabCont.GetTabByName(ConfigurationManager.AppSettings["ThuVienSo_ListNewsPage"], PortalId); if (tab != null) { tabid = tab.TabID; } //lnk1.Attributes["onclick"] = "window.location.href='" + DotNetNuke.Common.Globals.NavigateURL(tabid, "", "categoryid/0_TieuDiem") + "';return false;"; //lnk2.Attributes["onclick"] = "window.location.href='" + DotNetNuke.Common.Globals.NavigateURL(tabid, "", "categoryid/0_MoiBanHanh") + "';return false;"; //lnk3.Attributes["onclick"] = "window.location.href='" + DotNetNuke.Common.Globals.NavigateURL(tabid, "", "categoryid/0_BanChuaBiet") + "';return false;"; ltTieuDe1.NavigateUrl = DotNetNuke.Common.Globals.NavigateURL(tabid, "", "categoryid/0_TieuDiem"); ltTieuDe2.NavigateUrl = DotNetNuke.Common.Globals.NavigateURL(tabid, "", "categoryid/0_MoiBanHanh"); ltTieuDe3.NavigateUrl = DotNetNuke.Common.Globals.NavigateURL(tabid, "", "categoryid/0_BanChuaBiet"); if (Settings["tieude1"] != null) { ltTieuDe1.Text = Settings["tieude1"].ToString(); ltTieuDe1.Attributes["class"] = "TieuDe1"; } if (Settings["tieude2"] != null) { ltTieuDe2.Text = Settings["tieude2"].ToString(); ltTieuDe2.Attributes["class"] = "TieuDe2"; } if (Settings["tieude3"] != null) { ltTieuDe3.Text = Settings["tieude3"].ToString(); ltTieuDe3.Attributes["class"] = "TieuDe3"; } if (Settings["baiviet1"] != null && Settings["baiviet1"].ToString() != "") { string baiviet1 = Settings["baiviet1"].ToString(); XmlDocument doc1 = LoadData(baiviet1, "1"); XmlElement root1 = doc1.DocumentElement; if (doc1.InnerXml != "<newslist></newslist>") { if (Settings["template1"] != null) { string template1 = PortalSettings.HomeDirectory + "Xsl/" + Settings["template1"].ToString(); DotNetNuke.NewsProvider.Utils.XMLTransform(lt1, template1, doc1); } } } if (Settings["baiviet2"] != null && Settings["baiviet2"].ToString() != "") { string baiviet2 = Settings["baiviet2"].ToString(); XmlDocument doc2 = LoadData(baiviet2, "2"); XmlElement root2 = doc2.DocumentElement; if (doc2.InnerXml != "<newslist></newslist>") { if (Settings["template2"] != null) { string template2 = PortalSettings.HomeDirectory + "Xsl/" + Settings["template2"].ToString(); DotNetNuke.NewsProvider.Utils.XMLTransform(lt2, template2, doc2); } } } if (Settings["baiviet3"] != null && Settings["baiviet3"].ToString() != "") { string baiviet3 = Settings["baiviet3"].ToString(); XmlDocument doc3 = LoadData(baiviet3, "3"); XmlElement root3 = doc3.DocumentElement; if (doc3.InnerXml != "<newslist></newslist>") { if (Settings["template3"] != null) { string template3 = PortalSettings.HomeDirectory + "Xsl/" + Settings["template3"].ToString(); DotNetNuke.NewsProvider.Utils.XMLTransform(lt3, template3, doc3); } } } } catch (Exception ex) { Response.Write(ex.Message); } }