File: PhpdocHTMLRendererManager.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 (98 lines) | stat: -rw-r--r-- 2,211 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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
<?php
/**
* Controls the HTML Renderer objects.
* 
*/ 
class PhpdocHTMLRendererManager extends PhpdocObject {

	/**
	* @var	object PhpdocHTMLIndexRenderer
	*/
	var $indexrenderer;
	
	/**
	* @var	object PhpdocHTMLClassRenderer
	*/
	var $classrenderer;
	
	/**
	* @var	object PhpdocHTMLModuleRenderer
	*/
	var $modulerenderer;
	
	/**
	* @var	object PhpdocHTMLWarningRenderer
	*/
	var $warningrenderer;

	/**
	* Creates all necessary renderer objects
	* 
	* @param	string	Name of the target directory
	* @param 	string	Name of the directory with the templates.
	* @param	string	Name of the current application
	*/	
	function PhpdocHTMLRendererManager($target, $template, $application) {
	
		$this->indexrenderer = new PhpdocHTMLIndexRenderer($target, $template, $application);
		$this->indexrenderer->generate();

		$this->classrenderer 	= new PhpdocHTMLClassRenderer($target, $template, $application);
		$this->modulerenderer = new PhpdocHTMLModuleRenderer($target, $template, $application);
		$this->warningrenderer = new PhpdocHTMLWarningRenderer($target, $template, $application);
		
	} // end constructor
	
	/**
	* Renders the given xml file.
	* 
	* @param	string	XML file.
	* @param	string	Content of the XML file: class, classtree, 
	*									module, modulegroup, warnings, indexdata
	* @access	public
	*/
	function render($xmlfile, $type) {
			
		switch(strtolower($type)) {
		
			case "class":
				$this->classrenderer->renderClass($xmlfile);
				break;
			
			case "classtree":
				$this->indexrenderer->addClasstree($xmlfile);
				break;
				
			case "module":
				$this->modulerenderer->renderModule($xmlfile);
				break;	
			
			case "modulegroup":
				$this->indexrenderer->addModulegroup($xmlfile);
				break;
				
			case "warning":
				$this->warningrenderer->addWarnings($xmlfile);
				break;
				
		}
		
	} // end func render

	/**
	* Finishes the rendering process.
	* 
	* Finish means here: write the classtree and modulegroup overview to disk.
	*
	* @access	public
	*/	
	function finish() {

		$this->indexrenderer->finishClasstree();
		$this->indexrenderer->finishModulegroup();
		$this->warningrenderer->finishWarnings();

	} // end func finish
	
} // end class PhpdocHTMLRendererManager
?>