File: PhpdocHTMLRenderer.php

package info (click to toggle)
php4 4.0.3pl1-0potato3
  • links: PTS
  • area: main
  • in suites: potato
  • size: 15,168 kB
  • ctags: 20,556
  • sloc: ansic: 155,237; php: 10,827; sh: 9,608; yacc: 1,874; lex: 1,742; makefile: 788; java: 424; awk: 359; cpp: 335; perl: 181; xml: 57
file content (74 lines) | stat: -rw-r--r-- 1,373 bytes parent folder | download
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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
<?php
/**
* Default HTML Renderer based on templates.
*/
class PhpdocHTMLRenderer extends PhpdocRendererObject {
	
	/**
	* Template object
	* @var	object	IntegratedTemplates	$tpl
	*/	
	var $tpl;
	
	/**
	* XML data accessor object.
	* @var	object	PhpdocAccessor
	*/
	var $accessor;
	
	/**
	* Rootpath for Templatefiles.
	* @var	string	$templateRoot
	* @see	setTemplateRoot()
	*/
	var $templateRoot = "";
	
	/**
	* Directory path prefix.
	* @var	string	$path
	*/
	var $path = "";
	
	/**
	* Sets a directory path prefix.
	*
	* @param	string	
	*/
	function setPath($path) {
	
		if (""!=$path && "/"!=substr($path, -1))
			$path.="/";
			
		$this->path = $path;
	} // end func path
	
	/**
	* Sets the template directory.
	*
	* @param	string
	*/
	function setTemplateRoot($templateRoot) {
		
		if (""!=$path && "/"!=substr($templateRoot, -1))
			$templateRoot.="/";
			
		$this->templateRoot = $templateRoot;
	} // end func setTemplateRoot
	
	/**
	* Encodes the given string.
	* 
	* This function gets used to encode all userdependend 
	* elements of the phpdoc xml files. Use it to 
	* customize your rendering result: beware newlines (nl2br()),
	* strip tags etc.
	*
	* @param	string	String to encode
	* @return	string	$string	Encoded string
	*/
	function encode($string) {
		return nl2br(htmlspecialchars($string));
	} // end func encode
	
} // end class PhpdocHTMLRenderer
?>