+++ /dev/null
-<?php\r
-/**\r
-* Renders modules.\r
-*\r
-* @version $Id: PhpdocHTMLModuleRenderer.php,v 1.4 2000/12/03 22:37:37 uw Exp $\r
-*/\r
-class PhpdocHTMLModuleRenderer extends PhpdocHTMLDocumentRenderer {\r
-\r
- /**\r
- * Sets the xml and template root directory.\r
- * \r
- * @param string XML file path\r
- * @param string Template file path\r
- * @param string Name of the current application\r
- * @param string Filename extension\r
- * @see setPath(), setTemplateRoot()\r
- */\r
- function PhpdocHTMLModuleRenderer($path, $templateRoot, $application, $extension = ".html") {\r
-\r
- $this->setPath($path);\r
- $this->setTemplateRoot($templateRoot);\r
- $this->application = $application;\r
- $this->file_extension = $extension;\r
-\r
- $this->accessor = new PhpdocModuleAccessor;\r
- $this->tpl = new IntegratedTemplate($this->templateRoot);\r
- $this->fileHandler = new PhpdocFileHandler;\r
-\r
- } // end constructor\r
-\r
- /**\r
- * Renders a module\r
- *\r
- * @param string XML source file\r
- * @param string Name of the HTML target file.\r
- * @access public\r
- */ \r
- function renderModule($xmlfile, $htmlfile = "") {\r
-\r
- $this->tpl->loadTemplatefile("module.html"); \r
- if ("" == $htmlfile)\r
- $htmlfile = substr($xmlfile, 7, -4) . $this->file_extension;\r
-\r
- $this->accessor->loadXMLFile($this->path . $xmlfile);\r
- $module = $this->accessor->getModuledata(); \r
-\r
- $this->renderFunctions();\r
- $this->renderUses();\r
- $this->renderConstants();\r
-\r
- $tplvars = array();\r
- $tplvars["MODULE_FILE"] = $module["file"]["value"];\r
- $tplvars["MODULE_NAME"] = $module["name"];\r
- $tplvars["MODULE_GROUP"] = $module["group"];\r
- $tplvars["MODULE_ACCESS"] = $module["access"];\r
- $tplvars["MODULE_PACKAGE"] = $module["package"];\r
- $tplvars["MODULE_UNDOC"] = ("true" == $module["undoc"]) ? $this->undocumented : "";\r
-\r
- if (isset($module["doc"]["link"]))\r
- $this->renderLinks($module["doc"]["link"], "class_");\r
-\r
- if (isset($module["doc"]["author"]))\r
- $this->renderAuthors($module["doc"]["author"], "class_");\r
-\r
- if (isset($module["doc"]["see"]))\r
- $this->renderSee($module["doc"]["see"], "class_");\r
-\r
- $fields = array( "version", "deprecated", "copyright", "since", "magic");\r
- reset($fields);\r
- while (list($k, $field) = each($fields)) \r
-\r
- if (isset($module["doc"][$field])) {\r
- $this->tpl->setCurrentBlock("module_" . strtolower($field));\r
- $this->tpl->setVariable(strtoupper($field), $module["doc"][$field]["value"]);\r
- $this->tpl->parseCurrentBlock();\r
- }\r
-\r
- $fields = array( "description", "shortdescription" );\r
- reset($fields);\r
- while (list($k, $field) = each($fields)) \r
-\r
- if (isset($module["doc"][$field]))\r
- $tplvars["MODULE_" . strtoupper($field)] = $this->encode($module["doc"][$field]["value"]);\r
-\r
- $this->tpl->setCurrentBlock("__global__");\r
- $this->tpl->setVariable($tplvars);\r
- $this->tpl->setVariable("APPNAME", $this->application);\r
-\r
- $this->fileHandler->createFile($this->path . $htmlfile, $this->tpl->get() );\r
- $this->tpl->free(); \r
-\r
- } // end func renderModule\r
-\r
-} // end class PhpdocHTMLModuleRenderer\r
-?>
\ No newline at end of file