home *** CD-ROM | disk | FTP | other *** search
/ rtsi.com / 2014.01.www.rtsi.com.tar / www.rtsi.com / OS9 / FAQ / cgi-bin / discus4_00 / source / admtree.tmpl < prev    next >
Text File  |  2009-11-06  |  25KB  |  644 lines

  1. # FILE: admtree.tmpl
  2. # DESCRIPTION: Actual generator of the tree view
  3. # Copyright (c) 2002, DiscusWare, LLC, all rights reserved
  4. # -------------------------------------------------------------------------------------------
  5.  
  6. <!--BEGIN-->
  7.  
  8. <#sub icon( $expanded, $param, $lastel, $force, $noexpanded )#>
  9.     <#if $noexpanded == 1#>
  10.         <#if $lastel == 0#>e<#else#>f<#endif#>\
  11.     <#else#>    
  12.         <#if $browser->{ieX} || $force == 1#>
  13.             <#if $lastel == 0#>
  14.                 <#if $param =~ match(Sublist)#>
  15.                     <#if $expanded#>b<#else#>a<#endif#>\
  16.                 <#else#>
  17.                     e\
  18.                 <#endif#>
  19.             <#else#>
  20.                 <#if $param =~ match(Sublist)#>
  21.                     <#if $expanded#>d<#else#>c<#endif#>\
  22.                 <#else#>
  23.                     f\
  24.                 <#endif#>
  25.             <#endif#>
  26.         <#else#>
  27.             <#if $lastel == 0#>e<#else#>f<#endif#>\
  28.         <#endif#>
  29.     <#endif#>
  30. <#endsub#>
  31.  
  32. <#if $part eq "head"#>
  33.  
  34.     <style>
  35.     <!--
  36.     body { font-family: $color->{face}; line-spacing: 0 }
  37.     <#if $browser->{nsX}#>
  38.         .o { color: $GLOBAL_OPTIONS{COLOR_text} }
  39.         .f { color: $GLOBAL_OPTIONS{COLOR_text} }
  40.     <#endif#>
  41.     <#if $browser->{ieX}#>
  42.         img.navicon { height: 50; width: 46; border: 0 }
  43.         .o { color: $GLOBAL_OPTIONS{COLOR_text}; display: block; }
  44.         <#if $display_all_default == 1#>
  45.             .f { color: $GLOBAL_OPTIONS{COLOR_text}; display: block; }
  46.         <#else#>
  47.             .f { color: $GLOBAL_OPTIONS{COLOR_text}; display: none; }
  48.         <#endif#>
  49.     <#endif#>
  50.     -->
  51.     </style>
  52.     <script language="JavaScript1.2">
  53.     <!--
  54.     <#if $browser->{ieX}#>
  55.         function loader () {
  56.             treea = new Image();
  57.             treea.src = "$icon_url/tree_a.gif";
  58.             treeb = new Image();
  59.             treeb.src = "$icon_url/tree_b.gif";
  60.             treec = new Image();
  61.             treec.src = "$icon_url/tree_c.gif";
  62.             treed = new Image();
  63.             treed.src = "$icon_url/tree_d.gif";
  64.         }
  65.         function ex(el, lst) {
  66.             wel = eval("ch" + el);
  67.             iel = eval("i" + el);
  68.             wel.style.display = ( iel.src == treed.src || iel.src == treeb.src ) ? "none" : "block";
  69.             iel.src = ( wel.style.display == "block" ) ? ( lst == 1 ? treed.src : treeb.src ) : ( lst == 1 ? treec.src : treea.src );
  70.             return false;
  71.         }
  72.     <#else#>
  73.         function loader() {
  74.     
  75.         }
  76.     <#endif#>
  77.     
  78.     <#if $browser->{mozilla} >= 4.0 && $general->{force_nojs} != 1#>
  79.         function p(icons, page, islast, lasticon, pageicon, iconurl, texturl, target, name, islastpost, postnum, linkedtext, unlinkedtext) {
  80.             var out = '';
  81.             var imgsrc1 = '<img src="$general->{icon_url}/tree_';
  82.             var imgsrc2 = '.gif" border=0 height=16 width=20 align=top>';
  83.             var imgsrc3 = '<img name="i' + page + '" src="$general->{icon_url}/tree_';
  84.             for (var j = 0; j < icons.length; j = j + 1) {
  85.                 k = icons.substring(j, 1+j);
  86.                 out = out + imgsrc1 + k + imgsrc2;
  87.             }
  88.             if (typeof postnum == "undefined") {
  89.                 <#if $browser->{ieX} && $display_all_default == 0#>
  90.                     if (page) {
  91.                         out = out + '<a href="#" onClick="return ex(' + page + ',';
  92.                         if (islast) {
  93.                             out = out + islast + ');">';    
  94.                         } else {
  95.                             out = out + '0);">';
  96.                         }    
  97.                         out = out + imgsrc3 + lasticon + imgsrc2;
  98.                         out = out + '</a>';
  99.                     } else {
  100.                         out = out + imgsrc1 + lasticon + imgsrc2;
  101.                     }
  102.                 <#else#>
  103.                     out = out + imgsrc1 + lasticon + imgsrc2;
  104.                 <#endif#>
  105.     
  106.                 <#if $general->{icon_click_url}#>
  107.                     out = out + '<a href="$general->{icon_click_url}' + $iconurl + '">';
  108.                 <#endif#>
  109.                 if (pageicon.length == 1) {
  110.                     out = out + imgsrc1 + pageicon + imgsrc2;
  111.                 } else {
  112.                     out = out + '<img src="' + pageicon + '" border=0 align=top>';
  113.                 }
  114.                 <#if $general->{icon_click_url}#>
  115.                     out = out + '</a>';
  116.                 <#endif#>
  117.                 if (texturl != "") {
  118.                     out = out + '<a href="' + texturl + '"';
  119.                     <#if $general->{new_window}#>
  120.                         out = out + ' target="_blank"';
  121.                     <#else#>
  122.                         if (target != "") {
  123.                             out = out + ' target="' + target + '"';
  124.                         }
  125.                     <#endif#>
  126.                     <#if $general->{screen} == 0#>
  127.                         out = out + '>' + name + '</a>';
  128.                     <#else#>
  129.                         out = out + '><b>' + name + '</b></a>';
  130.                     <#endif#>
  131.                 } else {
  132.                     out = out + name;
  133.                 }
  134.             } else {
  135.                 if (islast != "*") {
  136.                     out = out + imgsrc1;
  137.                     if (islast == "1") {
  138.                         out = out + "j";
  139.                     } else {
  140.                         out = out + "i";
  141.                     }
  142.                     out = out + imgsrc2;
  143.                 }
  144.                 out = out + imgsrc1;
  145.                 if (islastpost == "0") {
  146.                     out = out + "e";
  147.                 } else {
  148.                     out = out + "f";
  149.                 }
  150.                 out = out + imgsrc2 + imgsrc1 + "l" + imgsrc2 + '<font size=1>';
  151.                 if (linkedtext != "" && texturl != "") {
  152.                     out = out + '<a href="' + texturl + '#POST' + postnum;
  153.                     <#if $general->{new_window}#>
  154.                         out = out + '" target="_blank';
  155.                     <#endif#>
  156.                     out = out + '">' + linkedtext + '</a>';
  157.                 }
  158.                 out = out + ' - ' + unlinkedtext + '</font>';
  159.             }
  160.             document.write(out + '<BR>\n');    
  161.             return true;
  162.         }
  163.             
  164.         function pr(text) {
  165.             document.writeln(text);
  166.             return true;
  167.         }
  168.     <#endif#>
  169.     // -->
  170.     </script>
  171. <#endif#>
  172.  
  173. <#if $part eq "body"#>
  174.  
  175. <#if $browser->{mozilla} >= 4 && $general->{force_nojs} != 1#>
  176.     <#if $browser->{ieX}#>
  177.         <!-- IE Tree -->
  178.         <#skipto "JS_tree_IE"#>
  179.     <#else#>
  180.         <!-- Non-IE Tree -->
  181.         <#skipto "JS_tree_NS"#>
  182.     <#endif#>
  183. <#endif#>
  184.  
  185. <!-- Non-JavaScript Tree -->
  186.  
  187. ###########################################################################################
  188. # NON-JAVASCRIPT TREE, FOR OLD BROWSERS (BELOW VERSION 4.0 OF NETSCAPE AND IE)
  189. #
  190. # This takes longer to load and is generally less functional than the JavaScript version
  191. ###########################################################################################
  192.  
  193. <img src="$general->{icon_url}/tree_g.gif" height=16 width=20 align=top>$title<br>
  194. <#foreach $topic_tree (@topic_tree)#>
  195.     <#if $general->{screen} == 0#>
  196.         <#if $general->{expand_url} ne ""#>
  197.             <a href="$general->{expand_url}<#if $topic_tree->{expanded} == 1#>?x=c<#else#>?x=e<#endif#>&st=$topic_tree->{page}">\
  198.             <img height=16 width=20 border=0 src="$general->{icon_url}/tree_<#&icon("$topic_tree->{expanded}", "$topic_tree->{param}", "$topic_tree->{_is_last_element}", "0", "0")#>.gif" align=top alt="$L{TREE_VIEW_EXPAND_COLLAPSE}">\
  199.             </a>\
  200.         <#else#>
  201.             <img height=16 width=20 border=0 src="$general->{icon_url}/tree_<#&icon("$topic_tree->{expanded}", "$topic_tree->{param}", "$topic_tree->{_is_last_element}", "0", "1")#>.gif" align=top alt="">\
  202.         <#endif#>
  203.     <#else#>
  204.         <#if $general->{cache} ne ""#>
  205.             <a href="$general->{expand_url}<#if $topic_tree->{expanded} == 1#>?x=c<#else#>?x=e<#endif#>&st=$topic_tree->{page}&scache=$general->{cache}">\
  206.             <img height=16 width=20 border=0 src="$general->{icon_url}/tree_<#&icon("$topic_tree->{expanded}", "$topic_tree->{param}", "$topic_tree->{_is_last_element}", "0", "0")#>.gif" align=top alt="$L{TREE_VIEW_EXPAND_COLLAPSE}">\
  207.             </a>\
  208.         <#else#>
  209.             <img height=16 width=20 border=0 src="$general->{icon_url}/tree_<#&icon("$topic_tree->{expanded}", "$topic_tree->{param}", "$topic_tree->{_is_last_element}", "0", "1")#>.gif" align=top alt="">\
  210.         <#endif#>
  211.     <#endif#>
  212.     <img src="$general->{icon_url}/\
  213.     <#if $topic_tree->{icon} ne ""#>$topic_tree->{icon}<#else#>tree_g<#endif#>.gif" height=16 width=20 align=top>\
  214.     <#if $general->{link_to_page}#>
  215.         <a href="\
  216.         <#if $secure->{$topic_tree->{topic}}#>
  217.             $DCONF->{authorize_reader}?file=/$topic_tree->{topic}/$topic_tree->{page}.$ext{#if $noqm == 0#}&lm=$topic_tree->{lastmod}{#endif#}\
  218.         <#else#>
  219.             $general->{message_url}/$topic_tree->{topic}/$topic_tree->{page}.$ext{#if $noqm == 0#}?$topic_tree->{lastmod}{#endif#}\
  220.         <#endif#>
  221.         <#if $general->{new_window}#>
  222.             " target="_blank\
  223.         <#endif#>
  224.         ">\
  225.         <#if $general->{screen} == 1#>
  226.             <b><#maxchar 60/... "$topic_tree->{name}"#></b></a><br>
  227.         <#else#>
  228.             <#maxchar 60/... "$topic_tree->{name}"#></a><br>
  229.         <#endif#>
  230.     <#else#>
  231.         <#maxchar 60/... "$topic_tree->{name}"#><br>
  232.     <#endif#>
  233.     <#if $topic_tree->{expanded} == 1#>
  234.         <#if $topic_tree->{subtree} ne ""#>
  235.             <#reference array @subtopic_tree from $topic_tree->{subtree}#>
  236.         <#endif#>
  237.         <#foreach $subtopic (@subtopic_tree)#>
  238.             <#if $subtopic->{topic} == $topic_tree->{topic}#>
  239.                 <#define $flag = "0"#>
  240.                 <#if $subtopic->{datatype} eq "mp"#>
  241.                     <#if $topic_tree->{_is_last_element}#>
  242.                         <img src="$general->{icon_url}/tree_j.gif" height=16 width=20 border=0 align=top>\
  243.                     <#else#>
  244.                         <img src="$general->{icon_url}/tree_i.gif" height=16 width=20 border=0 align=top>\
  245.                     <#endif#>
  246.                     <#if $subtopic->{level} > 0#>
  247.                         <#define $i = 1#>
  248.                         <#while ($i < $subtopic->{level})#>
  249.                             <#if $disp_icon[$i] == 0#>
  250.                                 <img src="$general->{icon_url}/tree_j.gif" height=16 width=20 border=0 align=top>\
  251.                             <#else#>
  252.                                 <img src="$general->{icon_url}/tree_i.gif" height=16 width=20 border=0 align=top>\
  253.                             <#endif#>
  254.                             <#math: $i += 1#>
  255.                         <#/while#>
  256.                         <img src="$general->{icon_url}/tree_{#if $subtopic->{last_of_parent}#}j{#else#}i{#endif#}.gif" height=16 width=20 align=top>\
  257.                     <#endif#>
  258.                     <img src="$general->{icon_url}/tree_{#if $subtopic->{is_last_post}#}f{#else#}e{#endif#}.gif" height=16 width=20 align=top>\
  259.                     <img src="$general->{icon_url}/tree_l.gif" height=16 width=20 align=top>\
  260.                     <font size=1>\
  261.                     <#if $subtopic->{linked_text} ne ""#>
  262.                         <a href="\
  263.                         <#if $secure->{$subtopic->{topic}}#>
  264.                             $DCONF->{authorize_reader}?file=/$subtopic->{topic}/$subtopic->{page}.$ext{#if $noqm == 0#}&lm=$subtopic->{lastmod}{#endif#}\
  265.                         <#else#>
  266.                             $general->{message_url}/$subtopic->{topic}/$subtopic->{page}.$ext{#if $noqm == 0#}?$subtopic->{lastmod}{#endif#}#POST$subtopic->{postnum}\
  267.                         <#endif#>
  268.                         "{#if $general->{new_window}#} target="_blank"{#endif#}>\
  269.                         <#maxchar 20 "<#javascript_prepare "<#unescape "$subtopic->{linked_text}"#>"#>"#></a>\
  270.                     <#endif#>
  271.                      -\
  272.                     <#if $GLOBAL_OPTIONS->{nm_show_dates}#>
  273.                         <#date $subtopic->{posttime} format "$L{REALSHORTDATE}"#>-\
  274.                     <#endif#>
  275.                      <#maxchar 50/... "<#javascript_prepare "<#unescape "$subtopic->{unlinked_text}"#>"#>"#></font><br>
  276.                 <#else#>
  277.                     <#if $subtopic->{page} == $subtopic->{topic}#>
  278.                         <#next#>
  279.                     <#endif#>
  280.                     <#if $topic_tree->{_is_last_element}#>
  281.                         <img src="$general->{icon_url}/tree_j.gif" height=16 width=20 border=0 align=top>\
  282.                     <#else#>
  283.                         <img src="$general->{icon_url}/tree_i.gif" height=16 width=20 border=0 align=top>\
  284.                     <#endif#>
  285.                     <#define $i = 1#>
  286.                     <#while ($i < $subtopic->{level})#>
  287.                         <#if $disp_icon[$i] == 0#>
  288.                             <img src="$general->{icon_url}/tree_j.gif" height=16 width=20 border=0 align=top>\
  289.                         <#else#>
  290.                             <img src="$general->{icon_url}/tree_i.gif" height=16 width=20 border=0 align=top>\
  291.                         <#endif#>
  292.                         <#math: $i += 1#>
  293.                     <#/while#>
  294.                     <img src="$general->{icon_url}/tree_{#if $subtopic->{last_of_parent}#}f{#else#}e{#endif#}.gif" height=16 width=20 align=top>\
  295.                     <#if $subtopic->{last_of_parent}#>
  296.                         <#define $disp_icon[$subtopic->{level}] = "0"#>
  297.                     <#else#>
  298.                         <#define $disp_icon[$subtopic->{level}] = "1"#>
  299.                     <#endif#>
  300.                     <img src="$general->{icon_url}/<#program sub "" &tree_icon_chooser($subtopic->{icon}, $subtopic->{param}, $subtopic->{islink}, 0)#>.gif" height=16 width=20 border=0 align=top>\
  301.                     <#if $general->{link_to_page}#>
  302.                         <#if $subtopic->{islink}#>
  303.                             <a href="$subtopic->{url}" target="$subtopic->{target}">\
  304.                         <#else#>
  305.                             <a href="\
  306.                             <#if $secure->{$subtopic->{topic}}#>
  307.                                 $DCONF->{authorize_reader}?file=/$subtopic->{topic}/$subtopic->{page}.$ext{#if $noqm == 0#}&lm=$subtopic->{lastmod}{#endif#}\
  308.                             <#else#>
  309.                                 $general->{message_url}/$subtopic->{topic}/$subtopic->{page}.$ext{#if $noqm == 0#}?$subtopic->{lastmod}{#endif#}\
  310.                             <#endif#>
  311.                             <#if $general->{new_window}#>
  312.                                 " target="_blank\
  313.                             <#endif#>
  314.                             ">\
  315.                         <#endif#>
  316.                         <#if $general->{screen} == 1#>
  317.                             <b><#maxchar 60/... "$subtopic->{name}"#></b></a><br>
  318.                         <#else#>
  319.                             <#maxchar 60/... "$subtopic->{name}"#></a><br>
  320.                         <#endif#>
  321.                     <#else#>
  322.                         <#maxchar 60/... "$subtopic->{name}"#><br>
  323.                     <#endif#>
  324.                 <#endif#>
  325.             <#endif#>
  326.         <#endloop#>
  327.     <#endif#>
  328. <#endloop#>
  329.  
  330. <#skipto "End"#>
  331.  
  332. <#endif#>
  333.  
  334. <#label "JS_Tree_IE"#>
  335.  
  336. <#if $part eq "body"#>
  337.  
  338. <div id="main" class="o">
  339. <img src="$general->{icon_url}/tree_g.gif" {#if $browser->{nsX}#}height=16 width=20{#endif#} align=top>$title<br>
  340. <#define $level = "1"#>
  341.  
  342. <#foreach $topic_tree (@topic_tree)#>
  343.     <#if $general->{screen} == 0#>
  344.         <#if $general->{expand_url} ne ""#>
  345.             <a href="$general->{expand_url}<#if $topic_tree->{expanded} == 1#>?x=c<#else#>?x=e<#endif#>&st=$topic_tree->{page}">\
  346.             <img height=16 width=20 border=0 src="$general->{icon_url}/tree_<#&icon("$topic_tree->{expanded}", "$topic_tree->{param}", "$topic_tree->{_is_last_element}", "0", "0")#>.gif" align=top alt="$L{TREE_VIEW_EXPAND_COLLAPSE}">\
  347.             </a>\
  348.         <#else#>
  349.             <img height=16 width=20 border=0 src="$general->{icon_url}/tree_<#&icon("$topic_tree->{expanded}", "$topic_tree->{param}", "$topic_tree->{_is_last_element}", "0", "1")#>.gif" align=top alt="">\
  350.         <#endif#>
  351.     <#else#>
  352.         <#if $general->{cache} ne ""#>
  353.             <a href="$general->{expand_url}<#if $topic_tree->{expanded} == 1#>?x=c<#else#>?x=e<#endif#>&st=$topic_tree->{page}&scache=$general->{cache}">\
  354.             <img height=16 width=20 border=0 src="$general->{icon_url}/tree_<#&icon("$topic_tree->{expanded}", "$topic_tree->{param}", "$topic_tree->{_is_last_element}", "0", "0")#>.gif" align=top alt="$L{TREE_VIEW_EXPAND_COLLAPSE}">\
  355.             </a>\
  356.         <#else#>
  357.             <img height=16 width=20 border=0 src="$general->{icon_url}/tree_<#&icon("$topic_tree->{expanded}", "$topic_tree->{param}", "$topic_tree->{_is_last_element}", "0", "1")#>.gif" align=top alt="">\
  358.         <#endif#>
  359.     <#endif#>
  360.     <img src="$general->{icon_url}/\
  361.     <#if $topic_tree->{icon} ne ""#>$topic_tree->{icon}<#else#>tree_g<#endif#>\
  362.     .gif" align=top>\
  363.     <#if $general->{link_to_page}#>
  364.         <a href="\
  365.         <#if $secure->{$topic_tree->{topic}}#>
  366.             $DCONF->{authorize_reader}?file=/$topic_tree->{topic}/$topic_tree->{page}.$ext{#if $noqm == 0#}&lm=$topic_tree->{lastmod}{#endif#}\
  367.         <#else#>
  368.             $general->{message_url}/$topic_tree->{topic}/$topic_tree->{page}.$ext{#if $noqm == 0#}?$topic_tree->{lastmod}{#endif#}\
  369.         <#endif#>
  370.         <#if $general->{new_window}#>
  371.             " target="_blank\
  372.         <#endif#>
  373.         ">\
  374.         <#if $general->{screen} == 1#>
  375.             <b><#maxchar 60/... "$topic_tree->{name}"#></b></a><br>
  376.         <#else#>
  377.             <#maxchar 60/... "$topic_tree->{name}"#></a><br>
  378.         <#endif#>
  379.     <#else#>
  380.         <#maxchar 60/... "$topic_tree->{name}"#><br>
  381.     <#endif#>
  382.     <#if $topic_tree->{expanded} == 1#>
  383.         <#if $topic_tree->{subtree} ne ""#>
  384.             <#reference array @subtopic_tree from $topic_tree->{subtree}#>
  385.         <#endif#>
  386.         <script language="JavaScript">
  387.         <#foreach $subtopic (@subtopic_tree)#>
  388.             <#if $subtopic->{topic} == $topic_tree->{topic}#>
  389.                 <#if $subtopic->{datatype} eq "mp"#>
  390.                     p(\
  391.                     <#if $topic_tree->{_is_last_element}#>
  392.                         'j\
  393.                     <#else#>
  394.                         'i\
  395.                     <#endif#>
  396.                     <#if $subtopic->{level} > 0#>
  397.                         <#define $i = 1#>
  398.                         <#while ($i < $subtopic->{level})#>
  399.                             <#if $disp_icon[$i] == 0#>
  400.                                 j\
  401.                             <#else#>
  402.                                 i\
  403.                             <#endif#>
  404.                             <#math: $i += 1#>
  405.                         <#/while#>
  406.                         ','','$subtopic->{last_of_parent}','','','',\
  407.                     <#else#>
  408.                         ','','*','','','',\
  409.                     <#endif#>
  410.                     <#if $secure->{$topic_tree->{topic}}#>
  411.                         '$DCONF->{authorize_reader}?file=/$subtopic->{topic}/$subtopic->{page}.$ext{#if $noqm == 0#}&lm=$subtopic->{lastmod}{#endif#}'\
  412.                     <#else#>
  413.                         '$general->{message_url}/$subtopic->{topic}/$subtopic->{page}.$ext{#if $noqm == 0#}?$subtopic->{lastmod}{#endif#}'\
  414.                     <#endif#>
  415.                     ,'','','$subtopic->{is_last_post}','$subtopic->{postnum}',\
  416.                     '<#maxchar 20 "<#javascript_prepare "<#unescape "$subtopic->{linked_text}"#>"#>"#>',\
  417.                     <#if $GLOBAL_OPTIONS->{nm_show_dates}#>
  418.                         '<#date $subtopic->{posttime} format "$L{REALSHORTDATE}"#> - <#maxchar 50/... "<#javascript_prepare "<#unescape "$subtopic->{unlinked_text}"#>"#>"#>');            
  419.                     <#else#>
  420.                         '<#maxchar 50/... "<#javascript_prepare "<#unescape "$subtopic->{unlinked_text}"#>"#>"#>');            
  421.                     <#endif#>
  422.                 <#else#>
  423.                     <#if $subtopic->{page} == $subtopic->{topic}#>
  424.                         <#next#>
  425.                     <#endif#>
  426.                     <#if $divlevel > $subtopic->{level}#>
  427.                         <#define $minus = $divlevel#>
  428.                         <#math: $minus -= $subtopic->{level}#>
  429.                         <#math: $divlevel -= $minus#>
  430.                         pr('<#repeated $minus "</div>"#>');
  431.                     <#endif#>
  432.                     p(\
  433.                     <#if $topic_tree->{_is_last_element}#>
  434.                         'j\
  435.                     <#else#>
  436.                         'i\
  437.                     <#endif#>
  438.                     <#define $i = 1#>
  439.                     <#while ($i < $subtopic->{level})#>
  440.                         <#if $disp_icon[$i] == 0#>
  441.                             j\
  442.                         <#else#>
  443.                             i\
  444.                         <#endif#>
  445.                         <#math: $i += 1#>
  446.                     <#/while#>
  447.                     ',\
  448.                     <#if $subtopic->{param} =~ match(Sublist) && $subtopic->{subs} > 1#>'$subtopic->{page}', '$subtopic->{last_of_parent}', \
  449.                     <#if $subtopic->{param} !~ match(Sublist)#>'', '', \
  450.                     <#if $subtopic->{param} =~ match(Sublist) && $subtopic->{subs} <= 1#>
  451.                         '$subtopic->{page}', '$subtopic->{last_of_parent}', \
  452.                         '<#&icon("$subtopic->{expanded}", "$subtopic->{param}", "$subtopic->{last_of_parent}", "0", "1")#>', \
  453.                     <#else#>
  454.                         '<#&icon("$subtopic->{expanded}", "$subtopic->{param}", "$subtopic->{last_of_parent}", "0", "$display_all_default")#>', \
  455.                     <#endif#>
  456.                     <#if $subtopic->{last_of_parent}#>
  457.                         <#define $disp_icon[$subtopic->{level}] = "0"#>
  458.                     <#else#>
  459.                         <#define $disp_icon[$subtopic->{level}] = "1"#>
  460.                     <#endif#>
  461.                     '<#program sub "" &tree_icon_chooser($subtopic->{icon}, $subtopic->{param}, $subtopic->{islink}, 1)#>', \
  462.                     <#if $general->{icon_click_url}#>
  463.                         '$subtopic->{topic}/$subtopic->{page}',\
  464.                     <#else#>
  465.                         '',\
  466.                     <#endif#>            
  467.                     <#if $general->{link_to_page}#>
  468.                         <#if $subtopic->{islink}#>
  469.                             '<#javascript_prepare "$subtopic->{url}"#>', '$subtopic->{target}', \
  470.                         <#else#>
  471.                             <#if $secure->{$topic_tree->{topic}}#>
  472.                                 '$DCONF->{authorize_reader}?file=/$subtopic->{topic}/$subtopic->{page}.$ext{#if $noqm == 0#}&lm=$subtopic->{lastmod}{#endif#}',\
  473.                             <#else#>
  474.                                 '$general->{message_url}/$subtopic->{topic}/$subtopic->{page}.$ext{#if $noqm == 0#}?$subtopic->{lastmod}{#endif#}',\
  475.                             <#endif#>
  476.                             '',\
  477.                         <#endif#>
  478.                         '<#maxchar 60/... "<#javascript_prepare "$subtopic->{name}"#>"#>');
  479.                     <#else#>
  480.                         '', '', '<#maxchar 60/... "<#javascript_prepare "$subtopic->{name}"#>"#>');
  481.                     <#endif#>
  482.                     <#if $subtopic->{param} =~ match(Sublist)#>
  483.                         <#if $subtopic->{expanded}#>
  484.                             pr('<div ID="ch$subtopic->{page}" class="o">');
  485.                         <#else#>
  486.                             pr('<div ID="ch$subtopic->{page}" class="f">');
  487.                         <#endif#>
  488.                         <#define $divlevel = $subtopic->{level}#>
  489.                         <#math: $divlevel += 1#>
  490.                     <#endif#>
  491.                 <#endif#>
  492.             <#endif#>
  493.         <#endloop#>
  494.         <#if $divlevel > 0#>
  495.             pr('<#repeated $divlevel "</div>"#>');
  496.         <#endif#>
  497.         </script>
  498.     <#endif#>
  499. <#endloop#>
  500.  
  501. <#skipto "End"#>
  502.  
  503. <#endif#>
  504.  
  505. <#label "JS_Tree_NS"#>
  506.  
  507. <#if $part eq "body"#>
  508.  
  509. <div id="main" class="o">
  510. <img src="$general->{icon_url}/tree_g.gif" {#if $browser->{nsX}#}height=16 width=20{#endif#} align=top>$title<br>
  511. <#define $level = "1"#>
  512.  
  513. <#foreach $topic_tree (@topic_tree)#>
  514.     <#if $general->{screen} == 0#>
  515.         <#if $general->{expand_url} ne ""#>
  516.             <a href="$general->{expand_url}<#if $topic_tree->{expanded} == 1#>?x=c<#else#>?x=e<#endif#>&st=$topic_tree->{page}">\
  517.             <img height=16 width=20 border=0 src="$general->{icon_url}/tree_<#&icon("$topic_tree->{expanded}", "$topic_tree->{param}", "$topic_tree->{_is_last_element}", "1", "0")#>.gif" align=top alt="$L{TREE_VIEW_EXPAND_COLLAPSE}">\
  518.             </a>\
  519.         <#else#>
  520.             <img height=16 width=20 border=0 src="$general->{icon_url}/tree_<#&icon("$topic_tree->{expanded}", "$topic_tree->{param}", "$topic_tree->{_is_last_element}", "0", "1")#>.gif" align=top alt="">\
  521.         <#endif#>
  522.     <#else#>
  523.         <#if $general->{cache} ne ""#>
  524.             <a href="$general->{expand_url}<#if $topic_tree->{expanded} == 1#>?x=c<#else#>?x=e<#endif#>&st=$topic_tree->{page}&scache=$general->{cache}">\
  525.             <img height=16 width=20 border=0 src="$general->{icon_url}/tree_<#&icon("$topic_tree->{expanded}", "$topic_tree->{param}", "$topic_tree->{_is_last_element}", "1", "0")#>.gif" align=top alt="$L{TREE_VIEW_EXPAND_COLLAPSE}">\
  526.             </a>\
  527.         <#else#>
  528.             <img height=16 width=20 border=0 src="$general->{icon_url}/tree_<#&icon("$topic_tree->{expanded}", "$topic_tree->{param}", "$topic_tree->{_is_last_element}", "0", "1")#>.gif" align=top alt="">\
  529.         <#endif#>
  530.     <#endif#>
  531.     <img src="$general->{icon_url}/\
  532.     <#if $topic_tree->{icon} ne ""#>$topic_tree->{icon}<#else#>tree_g<#endif#>\
  533.     .gif" {#if $browser->{nsX}#}height=16 width=20{#endif#} align=top>\
  534.     <#if $general->{link_to_page}#>
  535.         <a href="\
  536.         <#if $secure->{$topic_tree->{topic}}#>
  537.             $DCONF->{authorize_reader}?file=/$topic_tree->{topic}/$topic_tree->{page}.$ext{#if $noqm == 0#}&lm=$topic_tree->{lastmod}{#endif#}\
  538.         <#else#>
  539.             $general->{message_url}/$topic_tree->{topic}/$topic_tree->{page}.$ext{#if $noqm == 0#}?$topic_tree->{lastmod}{#endif#}\
  540.         <#endif#>
  541.         <#if $general->{new_window}#>
  542.             " target="_blank\
  543.         <#endif#>
  544.         ">\
  545.         <#if $general->{screen} == 1#>
  546.             <b><#maxchar 60/... "$topic_tree->{name}"#></b></a><br>
  547.         <#else#>
  548.             <#maxchar 60/... "$topic_tree->{name}"#></a><br>
  549.         <#endif#>
  550.     <#else#>
  551.         <#maxchar 60/... "$topic_tree->{name}"#><br>
  552.     <#endif#>
  553.     <#if $topic_tree->{expanded} == 1#>
  554.         <#if $topic_tree->{subtree} ne ""#>
  555.             <#reference array @subtopic_tree from $topic_tree->{subtree}#>
  556.         <#endif#>
  557.         <script language="JavaScript">
  558.         <#foreach $subtopic (@subtopic_tree)#>
  559.             <#if $subtopic->{topic} == $topic_tree->{topic}#>
  560.                 <#if $subtopic->{datatype} eq "mp"#>
  561.                     p('\
  562.                     <#if $topic_tree->{_is_last_element}#>j<#else#>i<#endif#>\
  563.                     <#if $subtopic->{level} > 0#>
  564.                         <#define $i = 1#>
  565.                         <#while ($i < $subtopic->{level})#>
  566.                             <#if $disp_icon[$i] == 0#>
  567.                                 j\
  568.                             <#else#>
  569.                                 i\
  570.                             <#endif#>
  571.                             <#math: $i += 1#>
  572.                         <#/while#>
  573.                         ','','$subtopic->{last_of_parent}','','','',\
  574.                     <#else#>
  575.                         ','','*','','','',\
  576.                     <#endif#>
  577.                     <#if $secure->{$topic_tree->{topic}}#>
  578.                         '$DCONF->{authorize_reader}?file=/$subtopic->{topic}/$subtopic->{page}.$ext{#if $noqm == 0#}&lm=$subtopic->{lastmod}{#endif#}'\
  579.                     <#else#>
  580.                         '$general->{message_url}/$subtopic->{topic}/$subtopic->{page}.$ext{#if $noqm == 0#}?$subtopic->{lastmod}{#endif#}'\
  581.                     <#endif#>
  582.                     ,'','','$subtopic->{is_last_post}','$subtopic->{postnum}',\
  583.                     '<#maxchar 20 "<#javascript_prepare "<#unescape "$subtopic->{linked_text}"#>"#>"#>',\
  584.                     <#if $GLOBAL_OPTIONS->{nm_show_dates}#>
  585.                         '<#date $subtopic->{posttime} format "$L{REALSHORTDATE}"#> - <#maxchar 50/... "<#javascript_prepare "<#unescape "$subtopic->{unlinked_text}"#>"#>"#>');            
  586.                     <#else#>
  587.                         '<#maxchar 50/... "<#javascript_prepare "<#unescape "$subtopic->{unlinked_text}"#>"#>"#>');            
  588.                     <#endif#>
  589.                 <#else#>
  590.                     <#if $subtopic->{page} == $subtopic->{topic}#>
  591.                         <#next#>
  592.                     <#endif#>
  593.                     p('<#if $topic_tree->{_is_last_element}#>j<#else#>i<#endif#>\
  594.                     <#define $i = 1#>
  595.                     <#while ($i < $subtopic->{level})#>
  596.                         <#if $disp_icon[$i] == 0#>
  597.                             j\
  598.                         <#else#>
  599.                             i\
  600.                         <#endif#>
  601.                         <#math: $i += 1#>
  602.                     <#/while#>
  603.                     ',\
  604.                     <#if $subtopic->{param} =~ match(Sublist)#>'$subtopic->{page}', '$subtopic->{last_of_parent}', \
  605.                     <#if $subtopic->{param} !~ match(Sublist)#>'', '', \
  606.                     '<#&icon("$subtopic->{expanded}", "$subtopic->{param}", "$subtopic->{last_of_parent}", "0", "1")#>', \
  607.                     <#if $subtopic->{last_of_parent}#>
  608.                         <#define $disp_icon[$subtopic->{level}] = "0"#>
  609.                     <#else#>
  610.                         <#define $disp_icon[$subtopic->{level}] = "1"#>
  611.                     <#endif#>
  612.                     '<#program sub "" &tree_icon_chooser($subtopic->{icon}, $subtopic->{param}, $subtopic->{islink}, 1)#>', \
  613.                     <#if $general->{icon_click_url}#>
  614.                         '$subtopic->{topic}/$subtopic->{page}',\
  615.                     <#else#>
  616.                         '',\
  617.                     <#endif#>            
  618.                     <#if $general->{link_to_page}#>
  619.                         <#if $subtopic->{islink}#>
  620.                             '<#javascript_prepare "$subtopic->{url}"#>', '$subtopic->{target}', \
  621.                         <#else#>
  622.                             <#if $secure->{$topic_tree->{topic}}#>
  623.                                 '$DCONF->{authorize_reader}?file=/$subtopic->{topic}/$subtopic->{page}.$ext{#if $noqm == 0#}&lm=$subtopic->{lastmod}{#endif#}'\
  624.                             <#else#>
  625.                                 '$general->{message_url}/$subtopic->{topic}/$subtopic->{page}.$ext{#if $noqm == 0#}?$subtopic->{lastmod}{#endif#}'\
  626.                             <#endif#>
  627.                             ,'',\
  628.                         <#endif#>
  629.                         '<#maxchar 60/... "<#javascript_prepare "$subtopic->{name}"#>"#>');
  630.                     <#else#>
  631.                         '', '', '<#maxchar 60/... "<#javascript_prepare "$subtopic->{name}"#>"#>');
  632.                     <#endif#>
  633.                 <#endif#>
  634.             <#endif#>
  635.         <#endloop#>
  636.         </script>
  637.     <#endif#>
  638. <#endloop#>
  639.  
  640. <#endif#>
  641. <#label "End"#>
  642.  
  643. <!--END-->
  644.