Fixed and closed #475: links in breadcrumbs trail drop-down menu limited to 20.

This commit is contained in:
Dario Solera 2010-02-02 10:29:17 +00:00
parent 9f31c1e47e
commit 2bf5df3368
2 changed files with 6 additions and 5 deletions

View file

@ -16,5 +16,5 @@ using System.Reflection;
// //
// You can specify all the values or you can default the Revision and Build Numbers // You can specify all the values or you can default the Revision and Build Numbers
// by using the '*' as shown below: // by using the '*' as shown below:
[assembly: AssemblyVersion("3.0.1.469")] [assembly: AssemblyVersion("3.0.1.470")]
[assembly: AssemblyFileVersion("3.0.1.469")] [assembly: AssemblyFileVersion("3.0.1.470")]

View file

@ -467,23 +467,24 @@ namespace ScrewTurn.Wiki {
StringBuilder buffer = new StringBuilder(300); StringBuilder buffer = new StringBuilder(300);
buffer.AppendFormat(@"<div id=""{0}"" style=""display: none;"" class=""pageoutgoinglinksmenu"" onmouseover=""javascript:return __CancelHideTimer();"" onmouseout=""javascript:return __HideDropDown('{0}');"">", id); buffer.AppendFormat(@"<div id=""{0}"" style=""display: none;"" class=""pageoutgoinglinksmenu"" onmouseover=""javascript:return __CancelHideTimer();"" onmouseout=""javascript:return __HideDropDown('{0}');"">", id);
bool pageAdded = false; int count = 0;
foreach(string link in outgoingLinks) { foreach(string link in outgoingLinks) {
PageInfo target = Pages.FindPage(link); PageInfo target = Pages.FindPage(link);
if(target != null) { if(target != null) {
pageAdded = true; count++;
PageContent cont = Content.GetPageContent(target, true); PageContent cont = Content.GetPageContent(target, true);
string title = FormattingPipeline.PrepareTitle(cont.Title, false, FormattingContext.PageContent, currentPage); string title = FormattingPipeline.PrepareTitle(cont.Title, false, FormattingContext.PageContent, currentPage);
buffer.AppendFormat(@"<a href=""{0}{1}"" title=""{2}"">{2}</a>", link, Settings.PageExtension, title, title); buffer.AppendFormat(@"<a href=""{0}{1}"" title=""{2}"">{2}</a>", link, Settings.PageExtension, title, title);
} }
if(count >= 20) break;
} }
buffer.Append("</div>"); buffer.Append("</div>");
sb.Insert(0, buffer.ToString()); sb.Insert(0, buffer.ToString());
if(pageAdded) return id; if(count > 0) return id;
else return null; else return null;
} }