- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
- 26
- 27
- 28
- 29
- 30
- 31
- 32
- 33
- 34
- 35
- 36
- 37
- 38
- 39
- 40
- 41
- 42
- 43
- 44
- 45
- 46
- 47
- 48
- 49
- 50
public string GetHtmlElement(RepeaterItem Container)
{
string Result = string.Empty;
string AClasses = HAS_CHILDREN_BASE_CSS_CLASS;
SiteMapNode Node = (SiteMapNode)Container.DataItem;
string Title = Node.Title;
string EnabledAttrSign = CustomSiteMapNodeInfo.ENABLED_ATTR_NAME;
string CssClassNameSign = CustomSiteMapNodeInfo.CSS_CLASS_ATTR_NAME;
string SpanCssClasses = string.Empty;
// checks for separator
if (string.IsNullOrEmpty(Node.Title) || Node.Title == ShellModuleInitializer.SEPARATOR)
{
SpanCssClasses = MENU_SEPARATOR_CSS_CLASS_NAME;
Title = EMPTY_TEXT;
}
bool HasImage = !string.IsNullOrEmpty(Node[CssClassNameSign]);
if (HasImage)
{
SpanCssClasses += HAS_IMAGE_CSS_CLASS_NAME;
}
Result = string.Format("<span class=\"{0}\">{1}</span>", SpanCssClasses, Title);
if (HasImage)
{
Result = string.Format("<span class=\"{0}\">{1}</span>{2}", Node[CssClassNameSign], EMPTY_TEXT, Result);
}
// checks for disabled item
if (!string.IsNullOrEmpty(Node[EnabledAttrSign]) && string.Compare(Node[EnabledAttrSign], "false", true) == 0)
{
AClasses += string.Format(" {0}", DISABLED_CSS_CLASS_NAME);
}
// checks for enabled item
if (!string.IsNullOrEmpty(Node[EnabledAttrSign]) && string.Compare(Node[EnabledAttrSign], "true", true) == 0)
{
Result = string.Format("<a href=\"{0}\" class=\"{1}\">{2}</a>", GetFullUrl(Container), AClasses, Result);
}
else
{
// cheks for non-clickable item
Result = string.Format("<a class=\"{0}\">{1}</a>", AClasses, Result);
}
return Result;
}
guest 18.11.2009 19:07 # 0
guest 21.11.2009 23:22 # 0
paranoid 23.11.2009 13:38 # 0
guest 24.11.2009 20:07 # 0
И если GetFullUrl возвращает ТОЛЬКО БУКВЫ, то будет работать.