/// <summary> Adds the main view section to the page turner </summary> /// <param name="placeHolder"> Main place holder ( "mainPlaceHolder" ) in the itemNavForm form into which the the bulk of the item viewer's output is displayed</param> /// <param name="Tracer"> Trace object keeps a list of each method executed and important milestones in rendering </param> public override void Add_Main_Viewer_Section(PlaceHolder placeHolder, Custom_Tracer Tracer) { if (Tracer != null) { Tracer.Add_Trace("Street_ItemViewer.Add_Main_Viewer_Section", "Adds one literal with all the html"); } // Build the value StringBuilder builder = new StringBuilder(5000); Map_Streets_DataSet streets = SobekCM_Database.Get_All_Streets_By_Item(CurrentItem.Web.ItemID, Tracer); if (streets == null) { builder.AppendLine("<br />"); builder.AppendLine("<center><b>UNABLE TO LOAD STREETS FROM DATABASE</b></center>"); builder.AppendLine("<br />"); CurrentMode.Mode = Display_Mode_Enum.Contact; builder.AppendLine("<center>Click <a href=\"" + CurrentMode.Redirect_URL() + "\">here</a> to report this issue.</center>"); builder.AppendLine("<br />"); CurrentMode.Mode = Display_Mode_Enum.Item_Display; } else { // Save the current viewer code string current_view_code = CurrentMode.ViewerCode; // Start the citation table builder.AppendLine("\t\t<!-- STREET VIEWER OUTPUT -->"); builder.AppendLine("\t\t<td align=\"left\" height=\"40px\" ><span class=\"SobekViewerTitle\"><b>Index of Streets</b></span></td></tr>"); builder.AppendLine("\t\t<tr><td class=\"SobekDocumentDisplay\">"); builder.AppendLine("\t\t\t<div class=\"SobekCitation\">"); // Get the list of streets from the database Create_Street_Index(builder, streets); // Finish the citation table builder.AppendLine("\t\t\t</div>"); builder.AppendLine("\t\t</td>"); builder.AppendLine("\t\t<!-- END STREET VIEWER OUTPUT -->"); // Restore the mode CurrentMode.ViewerCode = current_view_code; } // Add the HTML for the image Literal mainLiteral = new Literal { Text = builder.ToString() }; placeHolder.Controls.Add(mainLiteral); }
/// <summary> Stream to which to write the HTML for this subwriter </summary> /// <param name="Output"> Response stream for the item viewer to write directly to </param> /// <param name="Tracer"> Trace object keeps a list of each method executed and important milestones in rendering </param> public override void Write_Main_Viewer_Section(TextWriter Output, Custom_Tracer Tracer) { if (Tracer != null) { Tracer.Add_Trace("Street_ItemViewer.Write_Main_Viewer_Section", ""); } // Build the value Map_Streets_DataSet streets = SobekCM_Database.Get_All_Streets_By_Item(CurrentItem.Web.ItemID, Tracer); if (streets == null) { Output.WriteLine("<br />"); Output.WriteLine("<center><b>UNABLE TO LOAD STREETS FROM DATABASE</b></center>"); Output.WriteLine("<br />"); CurrentMode.Mode = Display_Mode_Enum.Contact; Output.WriteLine("<center>Click <a href=\"" + CurrentMode.Redirect_URL() + "\">here</a> to report this issue.</center>"); Output.WriteLine("<br />"); CurrentMode.Mode = Display_Mode_Enum.Item_Display; } else { // Save the current viewer code string current_view_code = CurrentMode.ViewerCode; // Start the citation table Output.WriteLine("\t\t<!-- STREET VIEWER OUTPUT -->"); Output.WriteLine("\t\t<td align=\"left\" height=\"40px\" ><span class=\"SobekViewerTitle\"><b>Index of Streets</b></span></td></tr>"); Output.WriteLine("\t\t<tr><td class=\"SobekDocumentDisplay\">"); Output.WriteLine("\t\t\t<div class=\"SobekCitation\">"); // Get the list of streets from the database Create_Street_Index(Output, streets); // Finish the citation table Output.WriteLine("\t\t\t</div>"); Output.WriteLine("\t\t</td>"); Output.WriteLine("\t\t<!-- END STREET VIEWER OUTPUT -->"); // Restore the mode CurrentMode.ViewerCode = current_view_code; } }