changed git call from https to git readonly
[atutor.git] / mods / phpdoc / PHPDoc / renderer / html / PhpdocHTMLRenderer.php
1 <?php
2 /**
3 * Default HTML Renderer based on templates.
4 */
5 class PhpdocHTMLRenderer extends PhpdocRendererObject {
6
7         /**
8         * Template object
9         *
10         * @var  object  IntegratedTemplates     $tpl
11         */      
12         var $tpl;
13
14         /**
15         * XML data accessor object.
16         *
17         * @var  object  PhpdocAccessor
18         */
19         var $accessor;
20
21         /**
22         * Rootpath for Templatefiles.
23         *
24         * @var  string  $templateRoot
25         * @see  setTemplateRoot()
26         */
27         var $templateRoot = "";
28
29         /**
30         * Directory path prefix.
31         *
32         * @var  string  $path
33         */
34         var $path = "";
35
36         /**
37         * Sets a directory path prefix.
38         *
39         * @param        string  
40         */
41         function setPath($path) {
42
43                 if ("" != $path && "/" != substr($path, -1))
44                         $path .= "/";
45
46                 $this->path = $path;
47         } // end func path
48
49         /**
50         * Sets the template directory.
51         *
52         * @param        string
53         */
54         function setTemplateRoot($templateRoot) {
55
56                 if ("" != $path && "/" != substr($templateRoot, -1))
57                         $templateRoot .= "/";
58
59                 $this->templateRoot = $templateRoot;
60         } // end func setTemplateRoot
61
62         /**
63         * Encodes the given string.
64         * 
65         * This function gets used to encode all userdependend 
66         * elements of the phpdoc xml files. Use it to 
67         * customize your rendering result: beware newlines (nl2br()),
68         * strip tags etc.
69         *
70         * @param        string  String to encode
71         * @return       string  $string Encoded string
72         */
73         function encode($string) {
74                 return nl2br(htmlspecialchars($string));
75         } // end func encode
76
77 } // end class PhpdocHTMLRenderer
78 ?>