summaryrefslogtreecommitdiffabout
path: root/htdocs/sources.chtml
blob: 8c0c7015921210106190e744a77e16afd0978edc (plain)
1
2
3
4
5
6
7
8
9
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
% html(); return; /* vim:set ft=sitecing: */
%%derive layout = "/ancestry/layout.chtml";
%%derive sources = "/ancestry/sources.chtml";
<%impl>
 #include <sitecing/sitecing_util.h>
</%impl>
<%constructor>
 b_strict = false;
 PN_PREV("/quickref/metasyntax","syntax","meta syntax");
</%constructor>
<%codemethod string title() %>
 return "runtime exceptions handling";
</%codemethod>
<%method void content() %>
 <h1>browse this site sources</h1>

 <ul class="sourcebrowser">
% for(int n=0;n<source_files_count;n++) {
%  sourcefile_t& sf = source_files[n];
%  if(!sf.name) { /* the beginning or the end of the directory */
%   if(sf.dir) { /* the beginning */
     <li class="dir"><% sf.dir %>/<ul class="dir">
%   }else{ /* the end */
     </ul></li>
%   }
%  }else{
    <li class="file"><a href="/view/<% sf.dir %>/<% sf.name %>" title="<% sf.desc %>" target="insert"><% sf.name %></a></li>
%  }
% }
 </ul>

 <%code>
  string rfile = sitecing::normalize_path(
   sitecing::strip_prefix(__CGI->get_meta("PATH_INFO"),"/sources.chtml"),
   sitecing::restrict_dotdot|sitecing::strip_leading_slash );
  if(rfile.empty())
   rfile = "about:blank";
  else
   rfile = "/view/"+rfile;
 </%code>
 <div class="insert">
  <iframe id="insert" name="insert" src="<% rfile %>" width="95%" height="300">
   <p>I wanted to put an &lt;iframe&gt; here, but your browser does not seem to
   support it. That is okay, it still will open links somehow.</p>
  </iframe>
 </div>

</%method>