Beispiel #1
0
 protected override void Render(System.Web.UI.HtmlTextWriter writer)
 {
     writer.WriteBeginTag("div");
     writer.WriteAttribute("class", "umbLabelButton");
     writer.Write(HtmlTextWriter.TagRightChar);
     base.Render(writer);
     caption.RenderControl(writer);
     writer.WriteEndTag("div");
 }
Beispiel #2
0
        /// <summary>
        /// This is where you implment the simple aspects of rendering your control.  The rest
        /// will be handled by calling RenderControlHelper's RenderControl() method.
        /// </summary>
        /// <param name="writer">The writer.</param>
        public virtual void RenderBaseControl( HtmlTextWriter writer )
        {
            if ( this.Enabled )
            {
                writer.AddAttribute( "id", this.ID.ToString() );
                writer.AddAttribute( "class", "picker picker-select rollover-container " + this.CssClass );
                writer.RenderBeginTag( HtmlTextWriterTag.Div );

                _hfItemId.RenderControl( writer );
                _hfInitialItemParentIds.RenderControl( writer );
                _hfItemName.RenderControl( writer );
                _hfItemRestUrlExtraParams.RenderControl( writer );

                if ( !HidePickerLabel )
                {
                    string pickerLabelHtmlFormat = @"
                    <a class='picker-label' href='#'>
                        <i class='{2}'></i>
                        <span id='selectedItemLabel_{0}' class='selected-names'>{1}</span>
                        <b class='fa fa-caret-down pull-right'></b>
                    </a>";

                    writer.Write( pickerLabelHtmlFormat, this.ID, this.ItemName, this.IconCssClass );

                    writer.WriteLine();

                    _btnSelectNone.RenderControl( writer );
                }

                // picker menu
                writer.AddAttribute( "class", "picker-menu dropdown-menu" );
                if ( ShowDropDown )
                {
                    writer.AddStyleAttribute( HtmlTextWriterStyle.Display, "block" );
                }

                writer.RenderBeginTag( HtmlTextWriterTag.Div );

                // mode panel
                if ( ModePanel != null )
                {
                    ModePanel.RenderControl( writer );
                }

                // treeview
                writer.Write(
                           @"<div id='treeview-scroll-container_{0}' class='scroll-container scroll-container-vertical scroll-container-picker'>
                                <div class='scrollbar'>
                                    <div class='track'>
                                        <div class='thumb'>
                                            <div class='end'></div>
                                        </div>
                                    </div>
                                </div>
                                <div class='viewport'>
                                    <div class='overview'>
                                        <div id='treeviewItems_{0}' class='treeview treeview-items'></div>        
                                    </div>
                                </div>
                            </div>",
                           this.ID );

                // picker actions
                writer.AddAttribute( "class", "picker-actions" );
                writer.RenderBeginTag( HtmlTextWriterTag.Div );
                _btnSelect.RenderControl( writer );
                writer.Write( "<a class='btn btn-xs btn-link picker-cancel' id='btnCancel_{0}'>Cancel</a>", this.ID );
                writer.WriteLine();
                writer.RenderEndTag();

                // closing div of picker-menu
                writer.RenderEndTag();

                // closing div of picker
                writer.RenderEndTag();

                RegisterJavaScript();
            }
            else
            {
                // this picker is not enabled (readonly), so just render a readonly version
                writer.AddAttribute( "class", "picker picker-select" );
                writer.RenderBeginTag( HtmlTextWriterTag.Div );
                LinkButton linkButton = new LinkButton();
                linkButton.CssClass = "picker-label";
                linkButton.Text = string.Format( "<i class='{1}'></i><span>{0}</span>", this.ItemName, this.IconCssClass );
                linkButton.Enabled = false;
                linkButton.RenderControl( writer );
                writer.WriteLine();
                writer.RenderEndTag();
            }
        }
Beispiel #3
0
        /// <summary>
        /// Renders the <see cref="T:System.Web.UI.WebControls.TextBox" /> control to the specified <see cref="T:System.Web.UI.HtmlTextWriter" /> object.
        /// </summary>
        /// <param name="writer">The <see cref="T:System.Web.UI.HtmlTextWriter" /> that receives the rendered output.</param>
        public void RenderBaseControl( HtmlTextWriter writer )
        {
            if ( this.Enabled )
            {
                writer.AddAttribute( "id", this.ClientID );
                writer.AddAttribute( "class", string.Format( "picker picker-select picker-person {0}", this.CssClass ) );
                writer.RenderBeginTag( HtmlTextWriterTag.Div );
                _hfPersonId.RenderControl( writer );
                _hfPersonName.RenderControl( writer );
                _hfSelfPersonId.RenderControl( writer );
                _hfSelfPersonName.RenderControl( writer );
                _hfIncludeBusinesses.RenderControl( writer );

                string pickerLabelHtmlFormat = @"
            <a class='picker-label' href='#'>
                <i class='fa fa-user'></i>
                <span id='{0}_selectedPersonLabel' class='picker-selectedperson'>{1}</span>
                <b class='fa fa-caret-down pull-right'></b>
            </a>
            ";
                writer.Write( string.Format( pickerLabelHtmlFormat, this.ClientID, this.PersonName ) );

                _btnSelectNone.RenderControl( writer );

                // render picker-menu dropdown-menu
                writer.AddAttribute( HtmlTextWriterAttribute.Class, "picker-menu dropdown-menu" );
                writer.RenderBeginTag( HtmlTextWriterTag.Div );

                writer.AddAttribute( HtmlTextWriterAttribute.Class, "row" );
                writer.RenderBeginTag( HtmlTextWriterTag.Div );

                // column1
                writer.AddAttribute( HtmlTextWriterAttribute.Class, "col-md-6" );
                writer.RenderBeginTag( HtmlTextWriterTag.Div );
                writer.Write( "<h4>Search</h4>" );
                writer.RenderEndTag();

                // column2
                writer.AddAttribute( HtmlTextWriterAttribute.Class, "col-md-6" );
                writer.RenderBeginTag( HtmlTextWriterTag.Div );
                if ( this.EnableSelfSelection )
                {
                    writer.Write( @"
                    <span class='js-select-self' title='Select self'>
                        <i class='fa fa-user pull-right clickable' ></i>
                    </span>" );
                }
                writer.RenderEndTag();

                // row
                writer.RenderEndTag();

                string pickMenuHtmlFormatStart = @"
             <input id='{0}_personPicker' type='text' class='picker-search form-control input-sm' />

             <hr />

             <h4>Results</h4>

             <ul class='picker-select' id='{0}_personPickerItems'>
             </ul>
             <div class='picker-actions'>
            ";

                writer.Write( pickMenuHtmlFormatStart, this.ClientID );

                _btnSelect.RenderControl( writer );

                string pickMenuHtmlFormatEnd = @"
            <a class='btn btn-link btn-xs' id='{0}_btnCancel'>Cancel</a>
            </div>
            ";

                writer.Write( string.Format( pickMenuHtmlFormatEnd, this.ClientID ) );

                // picker-menu dropdown-menu
                writer.RenderEndTag();

                // picker picker-select picker-person
                writer.RenderEndTag();
            }
            else
            {
                // this picker is not enabled (readonly), so just render a readonly version
                writer.AddAttribute( "class", "picker picker-select" );
                writer.RenderBeginTag( HtmlTextWriterTag.Div );
                LinkButton linkButton = new LinkButton();
                linkButton.CssClass = "picker-label";
                linkButton.Text = string.Format( "<i class='{1}'></i><span>{0}</span>", this.PersonName, "fa fa-user" );
                linkButton.Enabled = false;
                linkButton.RenderControl( writer );
                writer.WriteLine();
                writer.RenderEndTag();
            }
        }
Beispiel #4
0
        /// <summary>
        /// Renders the <see cref="T:System.Web.UI.WebControls.TextBox" /> control to the specified <see cref="T:System.Web.UI.HtmlTextWriter" /> object.
        /// </summary>
        /// <param name="writer">The <see cref="T:System.Web.UI.HtmlTextWriter" /> that receives the rendered output.</param>
        public void RenderBaseControl( HtmlTextWriter writer )
        {
            _hfPersonId.RenderControl( writer );
            _hfPersonName.RenderControl( writer );

            if ( this.Enabled )
            {
                string controlHtmlFormatStart = @"
        <div id='{0}' class='picker picker-select picker-person {2}' > 
            <a class='picker-label' href='#'>
                <i class='fa fa-user'></i>
                <span id='selectedPersonLabel_{0}'>{1}</span>
                <b class='fa fa-caret-down pull-right'></b>
            </a>
";
                writer.Write( string.Format( controlHtmlFormatStart, this.ID, this.PersonName, this.CssClass ) );

                _btnSelectNone.RenderControl( writer );

                string controlHtmlFormatMiddle = @"
          <div class='picker-menu dropdown-menu'>

             <h4>Search</h4>
             <input id='personPicker_{0}' type='text' class='picker-search form-control input-sm' />

             <hr />             

             <h4>Results</h4>
             
             <ul class='picker-select' id='personPickerItems_{0}'>
             </ul>
             <div class='picker-actions'>
";

                writer.Write( controlHtmlFormatMiddle, this.ID, this.PersonName );

                _btnSelect.RenderControl( writer );

                string controlHtmlFormatEnd = @"
            <a class='btn btn-link btn-xs' id='btnCancel_{0}'>Cancel</a>
            </div>
         </div>
     </div>
";

                writer.Write( string.Format( controlHtmlFormatEnd, this.ID, this.PersonName ) );
            }
            else
            {
                // this picker is not enabled (readonly), so just render a readonly version
                writer.AddAttribute( "class", "picker picker-select" );
                writer.RenderBeginTag( HtmlTextWriterTag.Div );
                LinkButton linkButton = new LinkButton();
                linkButton.CssClass = "picker-label";
                linkButton.Text = string.Format( "<i class='{1}'></i><span>{0}</span>", this.PersonName, "fa fa-user" );
                linkButton.Enabled = false;
                linkButton.RenderControl( writer );
                writer.WriteLine();
                writer.RenderEndTag();
            }
        }
Beispiel #5
0
        /// <summary>
        /// Renders the base control.
        /// </summary>
        /// <param name="writer">The writer.</param>
        public void RenderBaseControl( HtmlTextWriter writer )
        {
            RegisterJavaScript();

            // controls div
            writer.AddAttribute( "class", "controls" );
            writer.RenderBeginTag( HtmlTextWriterTag.Div );

            _hfGeoDisplayName.RenderControl( writer );
            _hfGeoPath.RenderControl( writer );

            if ( this.Enabled )
            {
                writer.AddAttribute( "id", this.ClientID.ToString() );
                writer.AddAttribute("class", "picker picker-geography rollover-container");
                writer.RenderBeginTag( HtmlTextWriterTag.Div );

                writer.Write( string.Format( @"
                    <a class='picker-label' href='#'>
                        <i class='fa fa-map-marker'></i>
                        <span id='selectedGeographyLabel_{0}'>{1}</span>
                        <b class='fa fa-caret-down pull-right'></b>
                    </a>", this.ClientID, this.GeoDisplayName ) );
                writer.WriteLine();

                _btnSelectNone.RenderControl( writer );

                // picker menu
                writer.AddAttribute( "class", "picker-menu dropdown-menu" );
                if ( ShowDropDown )
                {
                    writer.AddStyleAttribute( HtmlTextWriterStyle.Display, "block" );
                }

                writer.RenderBeginTag( HtmlTextWriterTag.Div );

                // mode panel
                if ( ModePanel != null )
                {
                    ModePanel.RenderControl( writer );
                }

                // map
                writer.Write( @"
                    <h4>Geography Picker <a class='pull-right btn btn-link btn-minimal' title='Toggle Fullscreen' id='btnExpandToggle_{0}'><i class='fa fa-expand'></i></a></h4>
                    <!-- Our custom delete button that we add to the map for deleting polygons. -->
                    <div style='display:none; z-index: 10; position: absolute; left: 105px; top: 40px; line-height:0;' id='gmnoprint-delete-button_{0}'>
                        <div style='direction: ltr; overflow: hidden; text-align: left; position: relative; color: rgb(51, 51, 51); font-family: Arial, sans-serif; font-size: 13px; background-color: rgb(255, 255, 255); padding: 4px; border-bottom-left-radius: 2px; border-top-left-radius: 2px; -webkit-background-clip: padding-box; background-clip: padding-box; border: 1px solid rgba(0, 0, 0, 0.14902); -webkit-box-shadow: rgba(0, 0, 0, 0.298039) 0px 1px 4px -1px; box-shadow: rgba(0, 0, 0, 0.298039) 0px 1px 4px -1px; font-weight: 500; background-position: initial initial; background-repeat: initial initial;' title='Delete selected shape'>
                            <span style='display: inline-block;'><div style='width: 16px; height: 16px; overflow: hidden; position: relative;'><i class='fa fa-times' style='font-size: 16px; padding-left: 2px; color: #aaa;'></i></div></span>
                        </div>
                    </div>
                    <!-- This is where the Google Map (with Drawing Tools) will go. -->
                    <div id='geoPicker_{0}' style='height: 300px; width: 500px' ></div>", this.ClientID );
                writer.WriteLine();

                // picker actions
                writer.AddAttribute( "class", "picker-actions" );
                writer.RenderBeginTag( HtmlTextWriterTag.Div );
                _btnSelect.RenderControl( writer );
                writer.Write( "<a class='btn btn-link btn-xs' id='btnCancel_{0}'>Cancel</a>", this.ClientID );
                writer.WriteLine();
                writer.RenderEndTag();

                // closing div of picker-menu
                writer.RenderEndTag();

                // closing div of picker
                writer.RenderEndTag();
            }
            else
            {
                // this picker is not enabled (readonly), so just render a readonly version
                writer.AddAttribute( "class", "picker picker-select" );
                writer.RenderBeginTag( HtmlTextWriterTag.Div );
                LinkButton linkButton = new LinkButton();
                linkButton.CssClass = "picker-label";
                linkButton.Text = string.Format( "<i class='{1}'></i><span>{0}</span>", this.GeoDisplayName, "fa fa-map-marker" );
                linkButton.Enabled = false;
                linkButton.RenderControl( writer );
                writer.WriteLine();
                writer.RenderEndTag();
            }

            // controls div
            writer.RenderEndTag();
        }
Beispiel #6
0
        protected override void Render(HtmlTextWriter output)
        {
            #region Test for Errors

            if (clip == null)
            {
                RenderException(output, "The requested content could not be found.");
                return;
            }

            if (!adminView)
            {
                if (!clip.ParentCatalog.Enabled)
                {
                    RenderException(output, "The content's requested catalog is disabled.");
                    return;
                }

                if (clip.ExpirationDate < DateTime.Now)
                {
                    RenderException(output, "The requested content is expired.");
                    return;
                }

                if (clip.PublishDate > DateTime.Now)
                {
                    RenderException(output, "The requested content is awaiting publishing.");
                    return;
                }
            }

            #endregion

            #region Editor Rendering

            if (userEditor != null && userEditor.Visible)
            //if (caEditor != null && caEditor.Visible)
            //if (ftbEditor != null && ftbEditor.Visible)
            {
                output.Write("<div style=\"margin-bottom:5px\">Title:</div><div style=\"margin-bottom:5px\">");
                tbTitle.RenderControl(output);
                output.Write("</div><div style=\"margin-bottom:5px\">Description:</div><div style=\"margin-bottom:5px\">");
                tbDescription.RenderControl(output);
                output.Write("</div><div style=\"margin-bottom:5px\">");
                userEditor.RenderControl(output);
                //ftbEditor.RenderControl(output);
                output.Write("</div><div>");
                btSave.RenderControl(output);
                output.Write("&nbsp;");
                btCancel.RenderControl(output);
                output.Write("</div>");
                return;
            }

            #endregion

            #region Content Rendering

            if (_contentOnly)
            {
                // Resolve home references! Whahoo!
                output.Write(clip.Body.Replace("=\"~", Page.ResolveUrl("~")));

                // Display Edit Link
                if (btEdit != null && btEdit.Visible)
                {
                    output.Write("<br>");
                    btEdit.RenderControl(output);
                }

                return;
            }

            #endregion

            // Compile Clip
            Amns.GreyFox.Content.Support.ContentBuilder b = new Amns.GreyFox.Content.Support.ContentBuilder(clip);
            b.Compile();

            this.renderTextTag(output, _titleCssClass, "h3", clip.Title);

            if (clip.Authors.Count != 0)
            {
                output.WriteBeginTag("h4");
                if (_contributorsCssClass != "")
                {
                    output.WriteAttribute("class", _contributorsCssClass);
                }
                output.Write(HtmlTextWriter.TagRightChar);
                for (int i = 0; i < clip.Authors.Count; i++)
                {
                    output.Write(clip.Authors[i].Contact.ConstructName("P F L S"));
                    if (i + 1 < clip.Authors.Count)
                    {
                        output.Write(", ");
                    }
                }
                output.WriteEndTag("h4");

                // Output Dates
                this.renderTextTag(output, _publishDateCssClass, "h5", clip.PublishDate.ToString("MMMM yyyy"));
            }

            output.WriteBeginTag("div");
            if (_bodyCssClass != string.Empty)
            {
                output.WriteAttribute("class", _bodyCssClass);
            }
            output.Write(HtmlTextWriter.TagRightChar);

            #region Reference, Administrator and Additional Side Panels

            output.WriteBeginTag("div");
            output.WriteAttribute("style", "float:right;");
            output.Write(HtmlTextWriter.TagRightChar);

            #region Reference Panel

            if (clip.References.Count != 0)
            {
                output.WriteBeginTag("table");
                output.WriteAttribute("border", "0");
                output.WriteAttribute("cellPadding", "5");
                output.WriteAttribute("cellSpacing", "0");
                output.WriteAttribute("width", "150px");
                if (_referenceTableCssClass != string.Empty)
                {
                    output.WriteAttribute("class", _referenceTableCssClass);
                }
                output.Write(HtmlTextWriter.TagRightChar);
                output.WriteFullBeginTag("tr");
                output.WriteBeginTag("td");
                if (_referenceTitleCssClass != string.Empty)
                {
                    output.WriteAttribute("class", _referenceTitleCssClass);
                }
                output.Write(HtmlTextWriter.TagRightChar);
                output.Write("References");
                output.WriteEndTag("td");
                output.WriteEndTag("tr");
                foreach (DbContentClip reference in clip.References)
                {
                    output.WriteFullBeginTag("tr");
                    output.WriteFullBeginTag("td");
                    output.WriteBeginTag("a");
                    if (reference.OverrideUrl != string.Empty)
                    {
                        output.WriteAttribute("href", reference.OverrideUrl);
                    }
                    else
                    {
                        output.WriteAttribute("href", Page.ResolveUrl(string.Format(_linkFormat, reference.ID)));
                    }
                    if (reference.MenuTooltip != string.Empty)
                    {
                        output.WriteAttribute("title", reference.MenuTooltip);
                    }
                    output.Write(HtmlTextWriter.TagRightChar);
                    output.Write(reference.Title);
                    output.WriteEndTag("a");
                    output.WriteEndTag("td");
                    output.WriteEndTag("tr");
                }
                output.WriteEndTag("table");
            }

            #endregion

            #region Administration Panel

            if (btEdit != null && btEdit.Visible)
            {
                output.WriteBeginTag("table");
                output.WriteAttribute("border", "0");
                output.WriteAttribute("cellPadding", "5");
                output.WriteAttribute("cellSpacing", "0");
                output.WriteAttribute("width", "150px");
                if (_referenceTableCssClass != string.Empty)
                {
                    output.WriteAttribute("class", _referenceTableCssClass);
                }
                output.Write(HtmlTextWriter.TagRightChar);
                output.WriteFullBeginTag("tr");
                output.WriteBeginTag("td");
                if (_referenceTitleCssClass != string.Empty)
                {
                    output.WriteAttribute("class", _referenceTitleCssClass);
                }
                output.Write(HtmlTextWriter.TagRightChar);
                output.Write("Administration");
                output.WriteEndTag("td");
                output.WriteEndTag("tr");
                output.WriteFullBeginTag("tr");
                output.WriteFullBeginTag("td");
                btEdit.RenderControl(output);
                output.WriteEndTag("td");
                output.WriteEndTag("tr");

                #region Hit Counter Display

                // TODO: Finish Counter
                int totalHits  = 0;
                int uniqueHits = 0;

                DbContentHitManager    hm   = new DbContentHitManager();
                DbContentHitCollection hits = hm.GetCollection("RequestContentID=" + clip.ID.ToString(), "RequestDate", null);

                totalHits = hits.Count;

                // =================================================
                // BAR GRAPH
                // =================================================

                DateTime now = DateTime.Now;

                DateTime weekStart6 = DateManipulator.FirstOfWeek(now);
                DateTime weekStart5 = DateManipulator.FirstOfWeek(now.Subtract(TimeSpan.FromDays(7)));
                DateTime weekStart4 = DateManipulator.FirstOfWeek(now.Subtract(TimeSpan.FromDays(14)));
                DateTime weekStart3 = DateManipulator.FirstOfWeek(now.Subtract(TimeSpan.FromDays(21)));
                DateTime weekStart2 = DateManipulator.FirstOfWeek(now.Subtract(TimeSpan.FromDays(28)));
                DateTime weekStart1 = DateManipulator.FirstOfWeek(now.Subtract(TimeSpan.FromDays(35)));

                int[] weekCounts = new int[6];

                // Count Unique Hits
                foreach (DbContentHit hit in hits)
                {
                    if (hit.IsUnique)
                    {
                        if (hit.RequestDate > weekStart1 & hit.RequestDate < weekStart2)
                        {
                            weekCounts[0]++;
                        }
                        if (hit.RequestDate > weekStart2 & hit.RequestDate < weekStart3)
                        {
                            weekCounts[1]++;
                        }
                        if (hit.RequestDate > weekStart3 & hit.RequestDate < weekStart4)
                        {
                            weekCounts[2]++;
                        }
                        if (hit.RequestDate > weekStart4 & hit.RequestDate < weekStart5)
                        {
                            weekCounts[3]++;
                        }
                        if (hit.RequestDate > weekStart5 & hit.RequestDate < weekStart6)
                        {
                            weekCounts[4]++;
                        }
                        if (hit.RequestDate > weekStart6)
                        {
                            weekCounts[5]++;
                        }

                        uniqueHits++;
                    }
                }

                int graphWidth   = 138;
                int graphHeight  = 100;
                int graphPadding = 1;
                int plotWidth    = graphWidth - (graphPadding * 2);
                int plotHeight   = graphHeight - (graphPadding * 2);
                int maxBarHeight = plotHeight;
                int minBarHeight = 20;
                int barMargin    = 2;
                int barWidth     = 21;

                // Find Highest Count
                int maxCount = 0;
                for (int i = 0; i < weekCounts.Length; i++)
                {
                    if (weekCounts[i] > maxCount)
                    {
                        maxCount = weekCounts[i];
                    }
                }

                // Find Height per Unit
                double pixelUnit = Convert.ToDouble(maxBarHeight) / Convert.ToDouble(maxCount);

                output.WriteFullBeginTag("tr");
                output.WriteFullBeginTag("td");
                output.Write("<strong>Hits:</strong>");
                output.WriteEndTag("td");
                output.WriteEndTag("tr");

                output.WriteFullBeginTag("tr");
                output.WriteFullBeginTag("td");

                output.WriteFullBeginTag("style");
                output.WriteLine("#vertgraph { width : " + graphWidth.ToString() + "px; " +
                                 "height: " + graphHeight.ToString() + "px; " +
                                 "position: relative; " +
                                 "padding: " + graphPadding.ToString() + "px; " +
                                 "background: #aaaaaa; }");
                output.WriteLine("#vertgraph .graph-area { width: " + plotWidth.ToString() + "px; " +
                                 "height: " + plotHeight.ToString() + "px; " +
                                 "padding: 0; " +
                                 "margin: 0; " +
                                 "position: relative; " +
                                 "overflow: hidden; } ");
                output.WriteLine("#vertgraph ul { width: " + plotWidth.ToString() + "px; " +
                                 "height: " + plotHeight.ToString() + "px; " +
                                 "margin: 0; " +
                                 "padding: 0; " +
                                 "position: absolute; " +
                                 "bottom: 0; " +
                                 "list-style-type: none; }");
                output.Write("#vertgraph ul li { position: absolute; " +
                             "width: " + barWidth.ToString() + "px; " +
                             "height: " + maxBarHeight.ToString() + "px; " +
                             "bottom: 0; " +
                             "padding 0; " +
                             "margin 0; " +
                             "background: no-repeat; " +
                             "writing-mode:tb-rl; " +
                             "text-align: center; " +
                             "font-size: xx-small; " +
                             //					"font-weight: bold; " +
                             "vertical-align: middle; " +
                             "color: white; }");
                output.WriteLine("#vertgraph li.week1 { background: #999999; left: 0px; }");
                output.WriteLine("#vertgraph li.week2 { background: #888888; left: " + ((barMargin + barWidth) * 1).ToString() + "px; }");
                output.WriteLine("#vertgraph li.week3 { background: #777777; left: " + ((barMargin + barWidth) * 2).ToString() + "px; }");
                output.WriteLine("#vertgraph li.week4 { background: #666666; left: " + ((barMargin + barWidth) * 3).ToString() + "px; }");
                output.WriteLine("#vertgraph li.week5 { background: #555555; left: " + ((barMargin + barWidth) * 4).ToString() + "px; }");
                output.WriteLine("#vertgraph li.week6 { background: #444444; left: " + ((barMargin + barWidth) * 5).ToString() + "px; }");
                output.WriteEndTag("style");

                output.WriteBeginTag("div");
                output.WriteAttribute("id", "vertgraph");
                output.Write(HtmlTextWriter.TagRightChar);
                output.WriteBeginTag("div");
                output.WriteAttribute("id", "graph-area");
                output.Write(HtmlTextWriter.TagRightChar);
                output.WriteFullBeginTag("ul");

                int    barHeight;
                double barHeightD = 0;

                for (int i = 0; i < 6; i++)
                {
                    barHeightD = Convert.ToDouble(weekCounts[i]) * pixelUnit;
                    if (barHeightD < minBarHeight)
                    {
                        barHeight = minBarHeight;
                    }
                    else if (double.IsNaN(barHeightD))
                    {
                        barHeight = minBarHeight;
                    }
                    else
                    {
                        barHeight = Convert.ToInt32(barHeightD);
                    }

                    output.WriteBeginTag("li");
                    output.WriteAttribute("class", "week" + (i + 1).ToString());
                    output.WriteAttribute("style", "height: " + barHeight + "px;");
                    output.Write(HtmlTextWriter.TagRightChar);
                    output.Write(weekCounts[i]);
                    output.WriteEndTag("li");
                    output.WriteLine();
                }

                output.WriteEndTag("ul");
                output.WriteEndTag("div");
                output.WriteEndTag("div");

                output.WriteEndTag("td");
                output.WriteEndTag("tr");
                // ===============================================
                // END BAR GRAPH
                // ===============================================

                output.WriteFullBeginTag("tr");
                output.WriteFullBeginTag("td");
                output.Write("<strong>Unique Hits:</strong><br />");
                output.Write(uniqueHits);
                output.WriteEndTag("td");
                output.WriteEndTag("tr");

                output.WriteFullBeginTag("tr");
                output.WriteFullBeginTag("td");
                output.Write("<strong>Total Hits:</strong><br />");
                output.Write(totalHits);
                output.WriteEndTag("td");
                output.WriteEndTag("tr");

                if (hits.Count > 0)
                {
                    output.WriteFullBeginTag("tr");
                    output.WriteFullBeginTag("td");
                    output.Write("<strong>Last Hit:</strong><br />");
                    output.Write(hits[hits.Count - 1].RequestDate.ToString());
                    output.WriteEndTag("td");
                    output.WriteEndTag("tr");
                }

                #endregion

                #region Update Display

                output.WriteFullBeginTag("tr");
                output.WriteFullBeginTag("td");
                output.Write("<strong>Last Updated:</strong><br />");
                output.Write(clip.ModifyDate.ToString());
                output.WriteEndTag("td");
                output.WriteEndTag("tr");

                #endregion

                #region Admin Notices

                output.WriteFullBeginTag("tr");
                output.WriteFullBeginTag("td");

                if (!clip.ParentCatalog.Enabled)
                {
                    output.Write(string.Format("<div><font color=\"ff0000\">Admin Notice: The requested clip's parent catalog '{0}' is disabled.</font></div>", clip.ParentCatalog.Title));
                }
                if (clip.ExpirationDate < DateTime.Now)
                {
                    output.Write(string.Format("<div><font color=\"ff0000\">Admin Notice: The requested clip expired on {0}.</font></div>", clip.ExpirationDate));
                }
                if (clip.PublishDate > DateTime.Now)
                {
                    output.Write(string.Format("<div><font color=\"ff0000\">Admin Notice: The requested clip will be published on {0}.</font></div>", clip.PublishDate));
                }

                output.WriteEndTag("td");
                output.WriteEndTag("tr");

                #endregion

                output.WriteEndTag("table");
            }

            #endregion

            #region Gloss Word Panel

            if (b.FaqCompiled)
            {
                output.Write("\r\n" +
                             "<script language=\"javascript\">\r\n" +
                             "function gfx_faqToggle(id) {\r\n" +
                             "	q = new getObj(id); \r\n"+
                             "	if(q.style.display == 'block') \r\n"+
                             "		q.style.display = 'none'; \r\n"+
                             "	else \r\n"+
                             "		q.style.display = 'block'; \r\n"+
                             "}\r\n" +
                             "</script>\r\n");
            }

            if (b.GlossWordsCompiled)
            {
                output.Write("\r\n" +
                             "<script language=\"javascript\">\r\n" +
                             "function gfx_glossCopy(id) {\r\n" +
                             "	document.getElementById('glosscontainer').innerHTML = \r\n"+
                             "		document.getElementById(id).innerHTML;\r\n"+
                             "}\r\n" +
                             "</script>\r\n");

                output.WriteBeginTag("table");
                output.WriteAttribute("border", "0");
                output.WriteAttribute("cellPadding", "5");
                output.WriteAttribute("cellSpacing", "0");
                output.WriteAttribute("width", "150px");
                if (_glossTableCssClass != string.Empty)
                {
                    output.WriteAttribute("class", _glossTableCssClass);
                }
                output.Write(HtmlTextWriter.TagRightChar);
                output.WriteFullBeginTag("tr");
                output.WriteBeginTag("td");
                if (_glossTitleCssClass != string.Empty)
                {
                    output.WriteAttribute("class", _glossTitleCssClass);
                }
                output.Write(HtmlTextWriter.TagRightChar);
                output.Write("Glossary");
                output.WriteEndTag("td");
                output.WriteEndTag("tr");
                output.WriteFullBeginTag("tr");
                output.WriteFullBeginTag("td");
                output.WriteBeginTag("div");
                output.WriteAttribute("id", "glosscontainer");
                output.Write(HtmlTextWriter.TagRightChar);
                output.Write("Please hover over a keyword to view glossary content.");
                output.WriteEndTag("div");
                output.Write(b.GlossBlock);
                output.WriteEndTag("td");
                output.WriteEndTag("tr");
                output.WriteEndTag("table");
            }

            #endregion

            output.WriteEndTag("div");

            #endregion

            output.Write(b.Output);

            output.WriteEndTag("div");

            // DO NOT RECORD HITS ON ADMIN VIEW OR IF USER HAS ALREADY
            // HIT THIS PAGE UNIQUELY.
            if (!adminView & _hitCounterEnabled)
            {
                if (Page.Session["GFX_HIT_" + clip.ID.ToString()] == null)
                {
                    clip.SaveHit(Page.Request, true);
                    Page.Session["GFX_HIT_" + clip.ID.ToString()] = true;
                }
                else
                {
                    clip.SaveHit(Page.Request, false);
                }
            }
        }
        protected void RenderEventRow(HtmlTextWriter writer, DateTime rowStart)
        {
            DateTime rowEnd = rowStart.Date.AddDays(6);

            writer.AddAttribute(HtmlTextWriterAttribute.Class, "events");
            writer.RenderBeginTag(HtmlTextWriterTag.Tr);

            CalendarEvent[] events = this._provider.GetEvents(this.DisplayUserKey, rowStart.Date, rowEnd.Date);
            if (events.Length == 0)
            {
                for (int i = 0; i < 7; i++)
                    this.RenderEmptyEvent(writer);
            }
            else
            {
                Style eventTextStyle = new Style();
                eventTextStyle.MergeWith(this._eventStyle);
                eventTextStyle.BorderStyle = BorderStyle.None;

                List<CalendarEvent> unrenderedEvents = new List<CalendarEvent>(events);
                DateTime curDay = rowStart;
                while (unrenderedEvents.Count > 0)
                {
                    // Doing the event this way, lets us put multiple events on the same
                    //   row, so long as they don't "interfere" with each other.
                    CalendarEvent curEv = null;
                    if (curDay.Date == rowStart.Date)
                        // Make sure that we only allow events to occured before the
                        //   "current" date if we're on the first cell in the row.
                        curEv = unrenderedEvents.Where(e => e.EventStartDate.Date <= curDay.Date).FirstOrDefault();
                    else
                        curEv = unrenderedEvents.Where(e => e.EventStartDate.Date == curDay.Date).FirstOrDefault();

                    while (curEv == null && curDay.Date <= rowEnd.Date)
                    {
                        this.RenderEmptyEvent(writer);
                        curDay = curDay.AddDays(1);
                        curEv = unrenderedEvents.Where(e => e.EventStartDate.Date == curDay.Date).FirstOrDefault();
                    }

                    if (curEv == null)
                    {
                        // If we still have no current event at this point, end this row,
                        //   start a new one, and let the search start over.
                        curDay = rowStart;
                        writer.RenderEndTag(); // TR (event row)
                        writer.AddAttribute(HtmlTextWriterAttribute.Class, "events");
                        writer.RenderBeginTag(HtmlTextWriterTag.Tr);
                    }
                    else
                    {
                        // Now, we write the actual event.
                        int eventDays = curEv.EventEndDate.Date <= rowEnd.Date
                            ? (int)System.Math.Ceiling(curEv.EventEndDate.Subtract(curDay).TotalDays)
                            : (int)System.Math.Ceiling(rowEnd.Subtract(curDay).TotalDays) + 1;
                        if (eventDays > 1)
                            writer.AddAttribute(HtmlTextWriterAttribute.Colspan, eventDays.ToString());
                        if (curEv.EventStartDate < rowStart && curEv.EventEndDate > rowEnd)
                            writer.AddAttribute(HtmlTextWriterAttribute.Class, "evMid");
                        else if (curEv.EventStartDate < rowStart)
                            writer.AddAttribute(HtmlTextWriterAttribute.Class, "evEnd");
                        else if (curEv.EventEndDate > rowEnd)
                            writer.AddAttribute(HtmlTextWriterAttribute.Class, "evStart");
                        else
                            writer.AddAttribute(HtmlTextWriterAttribute.Class, "evFull");
                        if (this.ControlStyle != null)
                        {
                            System.Web.UI.WebControls.Style tdStyle = new Style();
                            tdStyle.BorderStyle = this.ControlStyle.BorderStyle;
                            tdStyle.BorderColor = this.ControlStyle.BorderColor;
                            tdStyle.BorderWidth = this.ControlStyle.BorderWidth;
                            tdStyle.ForeColor = this.ControlStyle.ForeColor;
                            tdStyle.BackColor = this.ControlStyle.BackColor;
                            tdStyle.AddAttributesToRender(writer);
                        }
                        writer.RenderBeginTag(HtmlTextWriterTag.Td);

                        //if (curEv.EventStartDate < rowStart && curEv.EventEndDate > rowEnd)
                        //    writer.AddAttribute(HtmlTextWriterAttribute.Class, "evMid");
                        //else if (curEv.EventStartDate < rowStart)
                        //    writer.AddAttribute(HtmlTextWriterAttribute.Class, "evEnd");
                        //else if (curEv.EventEndDate > rowEnd)
                        //    writer.AddAttribute(HtmlTextWriterAttribute.Class, "evStart");
                        //else
                        //    writer.AddAttribute(HtmlTextWriterAttribute.Class, "evFull");
                        this._eventStyle.AddAttributesToRender(writer);
                        writer.RenderBeginTag(HtmlTextWriterTag.Div);

                        LinkButton lnkEvent = new LinkButton();
                        lnkEvent.ID = "lnkEvent_" + curEv.ProviderEventKey + "_" + curDay.ToString("yyyyMMdd");
                        lnkEvent.Text = (curEv.EventStartDate.Date == curDay.Date)
                            ? string.Format("{0} {1}", curEv.EventStartDate.ToString(System.Globalization.DateTimeFormatInfo.CurrentInfo.ShortTimePattern), curEv.Subject)
                            : string.Format("<< {0}", curEv.Subject);
                        lnkEvent.ApplyStyle(eventTextStyle);
                        lnkEvent.CommandName = "ShowEvent";
                        lnkEvent.CommandArgument = curEv.ProviderEventKey.ToString();
                        lnkEvent.Command += new CommandEventHandler(this.lnkEvent_Command);

                        this.Controls.Add(lnkEvent);
                        lnkEvent.RenderControl(writer);

                        writer.RenderEndTag(); // DIV
                        writer.RenderEndTag(); // TD

                        unrenderedEvents.Remove(curEv);
                        curDay = curEv.EventEndDate.AddDays(1);
                    }
                }
                while (curDay.Date <= rowEnd.Date)
                {
                    // "Fill" any remaining days on this row.
                    this.RenderEmptyEvent(writer);
                    curDay = curDay.AddDays(1);
                }
            }

            writer.RenderEndTag(); // TR (event row)
        }