/// <summary> Gets the menu items related to this viewer that should be included on the main item (digital resource) menu </summary> /// <param name="CurrentItem"> Digital resource object, which can be used to ensure if and how this viewer should appear /// in the main item (digital resource) menu </param> /// <param name="CurrentUser"> Current user, who may or may not be logged on </param> /// <param name="CurrentRequest"> Information about the current request </param> /// <param name="MenuItems"> List of menu items, to which this method may add one or more menu items </param> /// <param name="IpRestricted"> Flag indicates if this item is IP restricted AND if the current user is outside the ranges </param> public virtual void Add_Menu_Items(BriefItemInfo CurrentItem, User_Object CurrentUser, Navigation_Object CurrentRequest, List <Item_MenuItem> MenuItems, bool IpRestricted) { // Get the URL for this string previous_code = CurrentRequest.ViewerCode; CurrentRequest.ViewerCode = ViewerCode.Replace("#", ""); string url = UrlWriterHelper.Redirect_URL(CurrentRequest); CurrentRequest.ViewerCode = previous_code; // Start with the default label on the menu string label = "Thumbnails"; // Allow the label to be implemented for this viewer BriefItem_BehaviorViewer thisViewerInfo = CurrentItem.Behaviors.Get_Viewer(ViewerCode); // If this is found, and has a custom label, use that if ((thisViewerInfo != null) && (!String.IsNullOrWhiteSpace(thisViewerInfo.Label))) { label = thisViewerInfo.Label; } // Add the item menu information Item_MenuItem menuItem = new Item_MenuItem(label, null, null, url, ViewerCode); MenuItems.Add(menuItem); }
/// <summary> Gets the menu items related to this viewer that should be included on the main item (digital resource) menu </summary> /// <param name="CurrentItem"> Digital resource object, which can be used to ensure if and how this viewer should appear /// in the main item (digital resource) menu </param> /// <param name="CurrentUser"> Current user, who may or may not be logged on </param> /// <param name="CurrentRequest"> Information about the current request </param> /// <param name="MenuItems"> List of menu items, to which this method may add one or more menu items </param> /// <param name="IpRestricted"> Flag indicates if this item is IP restricted AND if the current user is outside the ranges </param> public void Add_Menu_items(BriefItemInfo CurrentItem, User_Object CurrentUser, Navigation_Object CurrentRequest, List <Item_MenuItem> MenuItems, bool IpRestricted) { // Get the URL for this string previous_code = CurrentRequest.ViewerCode; CurrentRequest.ViewerCode = ViewerCode.Replace("#", "1"); string url = UrlWriterHelper.Redirect_URL(CurrentRequest); CurrentRequest.ViewerCode = previous_code; // Add the item menu information Item_MenuItem menuItem = new Item_MenuItem("Page Images", "Text", null, url, ViewerCode); MenuItems.Add(menuItem); }
/// <summary> Gets the menu items related to this viewer that should be included on the main item (digital resource) menu </summary> /// <param name="CurrentItem"> Digital resource object, which can be used to ensure if and how this viewer should appear /// in the main item (digital resource) menu </param> /// <param name="CurrentUser"> Current user, who may or may not be logged on </param> /// <param name="CurrentRequest"> Information about the current request </param> /// <param name="MenuItems"> List of menu items, to which this method may add one or more menu items </param> /// <param name="IpRestricted"> Flag indicates if this item is IP restricted AND if the current user is outside the ranges </param> public virtual void Add_Menu_Items(BriefItemInfo CurrentItem, User_Object CurrentUser, Navigation_Object CurrentRequest, List <Item_MenuItem> MenuItems, bool IpRestricted) { // Get the URL for this string previous_code = CurrentRequest.ViewerCode.Replace("x", "").Replace("j", ""); int current_page; if (!int.TryParse(previous_code, out current_page)) { current_page = 1; } CurrentRequest.ViewerCode = ViewerCode.Replace("#", current_page.ToString()); string url = UrlWriterHelper.Redirect_URL(CurrentRequest); CurrentRequest.ViewerCode = previous_code; // Add the item menu information Item_MenuItem menuItem = new Item_MenuItem("Page Images", "Zoomable", null, url, ViewerCode); MenuItems.Add(menuItem); }
/// <summary> Creates and returns the an instance of the <see cref="JPEG_ItemViewer"/> class for showing a /// JPEG image from a page within a digital resource during execution of a single HTTP request. </summary> /// <param name="CurrentItem"> Digital resource object </param> /// <param name="CurrentUser"> Current user, who may or may not be logged on </param> /// <param name="CurrentRequest"> Information about the current request </param> /// <param name="Tracer"> Trace object keeps a list of each method executed and important milestones in rendering </param> /// <returns> Fully built and initialized <see cref="JPEG_ItemViewer"/> object </returns> /// <remarks> This method is called whenever a request requires the actual viewer to be created to render the HTML for /// the digital resource requested. The created viewer is then destroyed at the end of the request </remarks> public override iItemViewer Create_Viewer(BriefItemInfo CurrentItem, User_Object CurrentUser, Navigation_Object CurrentRequest, Custom_Tracer Tracer) { return(new JPEG_ItemViewer(CurrentItem, CurrentUser, CurrentRequest, Tracer, ViewerCode.ToLower(), FileExtensions)); }