コード例 #1
0
 protected virtual void WriteUnitDetails(HtmlTextWriter writer, ListQuickDetailCategoryUnit unit)
 {
     //$this->detaillistrenderer->Draw($this->catalog, $unit->Detail);
     DetailsList.Details = unit.Detail;
     RenderChildren(writer);
 }
コード例 #2
0
        protected virtual void WriteUnitImage(HtmlTextWriter writer, ListQuickDetailCategoryUnit unit)
        {
            //<div class="guayaquil_unit_icons">
            //<div class="guayaquil_zoom" full="'.str_replace('%size%', 'source', $unit['imageurl']).'" title="'.$unit['code'].': '.$unit['name'].'">
            //<img src="'.$this->zoom_image.'"></div></div>
            writer.AddAttribute(HtmlTextWriterAttribute.Class, "guayaquil_unit_icons");
            writer.RenderBeginTag(HtmlTextWriterTag.Div);
            writer.AddAttribute(HtmlTextWriterAttribute.Class, "guayaquil_zoom");
            writer.AddAttribute("full",
                                string.IsNullOrEmpty(unit.imageurl)
                                    ? string.Empty
                                    : unit.imageurl.Replace("%size%", "source"));
            writer.AddAttribute(HtmlTextWriterAttribute.Title, String.Format("{0}: {1}", unit.code, unit.name));
            writer.RenderBeginTag(HtmlTextWriterTag.Div);

            writer.AddAttribute(HtmlTextWriterAttribute.Src, ZoomImageUrl);
            writer.RenderBeginTag(HtmlTextWriterTag.Img);
            writer.RenderEndTag();
            writer.RenderEndTag();
            writer.RenderEndTag();

            //<div class="gdImage'.(!strlen($img) ? ' gdNoImage' : '').'" style="width:'.(int)$this->size.'px; height:'.(int)$this->size.'px;">
            writer.AddAttribute(HtmlTextWriterAttribute.Class,
                                String.Format("gdImage{0}", string.IsNullOrEmpty(unit.imageurl) ? " gdNoImage" : null));
            writer.AddAttribute(HtmlTextWriterAttribute.Style, String.Format("width:{0}px; height:{0}px;", ImageSize));
            writer.RenderBeginTag(HtmlTextWriterTag.Div);

            if(!string.IsNullOrEmpty(unit.imageurl))
            {
                writer.AddAttribute(HtmlTextWriterAttribute.Src, unit.imageurl.Replace("%size%", ImageSize.ToString()));
                writer.RenderBeginTag(HtmlTextWriterTag.Img);
                writer.RenderEndTag();
            }
            writer.RenderEndTag();

            string link = FormatLink("unit", unit);
            //<a href="'.$link.'"><b>'.$unit['code'].':</b> '.$unit['name'].'</a>
            writer.AddAttribute(HtmlTextWriterAttribute.Href, link);
            writer.RenderBeginTag(HtmlTextWriterTag.A);
            writer.RenderBeginTag(HtmlTextWriterTag.B);
            writer.Write(String.Format("{0}: ", unit.code));
            writer.RenderEndTag();
            writer.Write(unit.name);
            writer.RenderEndTag();
        }
コード例 #3
0
        protected virtual void WriteUnit(HtmlTextWriter writer, ListQuickDetailCategoryUnit unit)
        {
            CurrentUnit = unit;

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

            writer.AddAttribute(HtmlTextWriterAttribute.Class, "gdImageCol");
            writer.AddAttribute(HtmlTextWriterAttribute.Width, (ImageSize + 4).ToString());
            writer.AddAttribute(HtmlTextWriterAttribute.Align, "center");
            writer.AddAttribute(HtmlTextWriterAttribute.Valign, "top");
            writer.RenderBeginTag(HtmlTextWriterTag.Td);

            WriteUnitImage(writer, unit);

            writer.RenderEndTag();

            writer.AddAttribute(HtmlTextWriterAttribute.Class, "gdDetailCol");
            writer.AddAttribute(HtmlTextWriterAttribute.Valign, "top");
            writer.RenderBeginTag(HtmlTextWriterTag.Td);

            WriteUnitDetails(writer, unit);

            writer.RenderEndTag();
            writer.RenderEndTag();
            writer.RenderEndTag();
        }