home *** CD-ROM | disk | FTP | other *** search
-
- #####################################################################
- #####################################################################
- ## ##
- ## COLLECTION TOC VIEW CREATION ##
- ## ##
- #####################################################################
- #####################################################################
-
- dwTemplate Generic__CollectionTocView {
- $[dwCall dwMakeUrlParts]
- <HTML>
- <HEAD>
- <BASE HREF="$[dwGet BaseUrl]@Generic__CollectionTocView">
- </HEAD>
- <BODY BGCOLOR=#FFFBF0 LINK=#000000 ALINK=#008000 VLINK=#800080>
- <H3>$[dwGetRootTitle]</H3>
- <HR>
- $[dwCall Generic__GenerateCollectionViewBody]
- <HR>
- </BODY>
- </HTML>
- }
-
-
- dwScript Generic__GenerateCollectionViewBody {
- dwInitTocLineGenerator BooksAndCollections [dwGet State__CollTocDepth]
- dwCall Generic__GenerateCollectionTocLines
- }
-
-
- dwScript Generic__CollTocView {
- if {[dwGet State__Frames] == 1} {
- dwProcessTemplate Frames__CollTocView
- } else {
- dwProcessTemplate NoFrames__CollTocView
- }
- }
-
- dwTemplate Frames__CollTocView {
- $[dwCall dwMakeUrlParts]
- <HTML>
- <HEAD>
- <TITLE>$[dwGetRootTitle]: Table of Contents</TITLE>
- <BASE HREF="$[dwGet BaseUrl]@Generic__CollTocView">
- </HEAD>
- <BODY BGCOLOR=#FFFBF0 LINK=#000000 ALINK=#008000 VLINK=#800080>
- <H3>$[dwGetRootTitle]</H3>
- $[dwCall Generic__ShowSearchResult]
- <HR>
- $[dwCall Generic__GenerateBookTocViewBody]
- <HR>
- </BODY>
- </HTML>
- }
-
- dwTemplate NoFrames__CollTocView {
- $[dwCall dwMakeUrlParts]
- <HTML>
- <HEAD>
- <TITLE>$[dwGetRootTitle]: Table of Contents</TITLE>
- <BASE HREF="$[dwGet BaseUrl]@Generic__CollTocView">
- </HEAD>
- <BODY BGCOLOR=#FFFBF0 LINK=#000000 ALINK=#008000 VLINK=#800080>
- $[dwCall Generic__BookButtonBarView]
- <HR>
- <H3>Table of contents for $[dwGetRootTitle]</H3>
- $[dwCall Generic__ShowSearchResult]
- <HR>
- $[dwCall Generic__GenerateCollTocViewBody]
- <HR>
- </BODY>
- </HTML>
- }
-
- dwScript Generic__GenerateCollectionTocLines {
- dwCall dwMakeUrlParts
- if {[dwGet ActiveQuery] != ""} {set checkHits 1} else {set checkHits 0}
-
- set root [dwGet RootAbsUrlPath]
- set params [dwGet UrlParamString]
- set query [dwGet UrlQueryString]
- set icondir [dwGetParam IconDir]
-
- while {[dwNewTocLine]} {
- set item [dwGetTocItemPath]
- switch -exact [dwGetTocItemType] {
- collection {
- dwSet TocLineIcon [dwGetParam graphic_image_srcmap collection]
- dwSet TocLinePath "$root/$item/@Generic__CollectionView$params$query"
- dwSet TocLinePathTarget " TARGET=_top"
- }
- book {
- dwSet TocLineIcon [dwGetParam graphic_image_srcmap book]
- dwSet TocLinePath "$root/$item/@Generic__BookView$params$query"
- dwSet TocLinePathTarget " TARGET=_top"
- }
- default {
- dwSet TocLineUrl \
- "@Generic__BookTextView/[dwGetTocItemPath]$params$query"
- dwSet TocIconUrl \
- "@Generic__BookTocView/[dwGetTocItemPath]$params$query"
- dwSet TocIconExpUrl \
- "@Generic__BookTocView/[dwGetTocItemExpansionPath]$params$query"
-
- if {[dwGet State__Frames] == 1} {
- dwSet TocLineTarget " TARGET=\"dynaweb_content\""
- } else {
- dwSet TocLineTarget ""
- }
- dwCall Tables__ShowCurrentTocLine
- continue
- }
- }
- if {$checkHits} {
- set hitCount [dwGetTocItemHitCount]
- if {$hitCount < 0} {
- dwSet TocLineHitCount "<FONT COLOR=#FF0000>---</FONT>"
- } else {
- dwSet TocLineHitCount "<FONT COLOR=#FF0000><B>$hitCount</B></FONT>"
- }
- }
- dwCall Generic__GenerateCollectionTocLine
- }
- }
-
- dwScript Generic__GenerateCollectionTocLine {
- if {[dwGet State__Tables] == 1} {
-
- ## width of indent from one TOC item level to the next
- ## if there's a query, this also holds the hit count
- if {[dwGet ActiveQuery] == ""} {
- dwSet IndentWidth 10
- } else {
- dwSet IndentWidth 45
- }
-
- ## width of collection/book icon
- dwSet ArrowWidth 22
-
- ## width of TOC item text
- dwSet TextWidth 800
-
- ## width of TOC line
- dwSet LineWidth 867
-
-
- dwProcessTemplate Tables__CollectionTocLine
- } else {
- set icondir [dwGetParam IconDir]
- set hitCount [dwGet TocLineHitCount]
- set tocLine $hitCount
- set loop [expr 6 - [string length $hitCount]]
- while {$loop > 0} {
- set tocLine "$tocLine$[dwGetParam graphic_image_srcmap spacer]"
- incr loop -1
- }
- set tocLine "$tocLine[dwGet TocLineIcon]"
- set loop 2
- while {$loop > 0} {
- set tocLine "$tocLine$[dwGetParam graphic_image_srcmap spacer]"
- incr loop -1
- }
- set tocLine "$tocLine<A HREF=\"[dwGet TocLinePath]\"[dwGet TocLinePathTarget]>[dwGetTocItemTitle]</A><BR>"
- dwSend $tocLine
- }
- }
-
- dwTemplate Tables__CollectionTocLine {
- <TABLE CELLPADDING=0 BORDER=0 WIDTH=$[dwGet LineWidth]>
- <TR><NOBR>
- <TD ALIGN=RIGHT VALIGN=TOP WIDTH=$[expr [dwGetTocItemLevel] * [dwGet IndentWidth]]>
- $[dwGet TocLineHitCount]
- </TD>
- <TD ALIGN=CENTER VALIGN=TOP WIDTH=$[dwGet ArrowWidth]>
- <A HREF="$[dwGet TocLinePath]"$[dwGet TocLinePathTarget]>$[dwGet TocLineIcon]</A>
- </TD>
- <TD ALIGN=LEFT VALIGN=TOP WIDTH=$[dwGet TextWidth] NOWRAP>
- <A HREF="$[dwGet TocLinePath]"$[dwGet TocLinePathTarget]>$[dwGetTocItemTitle]</A>
- </TD>
- </NOBR></TR>
- </TABLE>
- }
-
-
-