Source for file XMLDocBookConverter.inc
Documentation is available at XMLDocBookConverter.inc
// +------------------------------------------------------------------------+
// +------------------------------------------------------------------------+
// | Copyright (c) 2000-2003 Joshua Eichorn, Gregory Beaver |
// | Web http://www.phpdoc.org |
// | Mirror http://phpdocu.sourceforge.net/ |
// | PEAR http://pear.php.net/package-info.php?pacid=137 |
// +------------------------------------------------------------------------+
// | This source file is subject to version 3.00 of the PHP License, |
// | that is available at http://www.php.net/license/3_0.txt. |
// | If you did not receive a copy of the PHP license and are unable to |
// | obtain it through the world-wide-web, please send a note to |
// +------------------------------------------------------------------------+
* XML output converter for DocBook.
* This Converter takes output from the {@link Parser} and converts it to DocBook output
* @see parserDocBlock, parserInclude, parserPage, parserClass, parserDefine, parserFunction, parserMethod, parserVar
* @version $Id: XMLDocBookConverter.inc,v 1.1 2005/10/17 18:37:36 jeichorn Exp $
* This Converter takes output from the {@link Parser} and converts it to DocBook output
* @see parserDocBlock, parserInclude, parserPage, parserClass, parserDefine, parserFunction, parserMethod, parserVar
* @version $Id: XMLDocBookConverter.inc,v 1.1 2005/10/17 18:37:36 jeichorn Exp $
* @todo indexes for other DocBook converters not based on peardoc
* XMLDocBookConverter wants elements sorted by type as well as alphabetically
* @see Converter::$sort_page_contents_by_type
* indexes of elements by package that need to be generated
var $leftindex = array('classes' => true, 'pages' => true, 'functions' => false, 'defines' => false, 'globals' => false);
* whether a @see is going to be in the {@link $base_dir}, or in a package/subpackage subdirectory of $base_dir
* name of current page being converted
* path of current page being converted
* name of current class being converted
* template for the procedural page currently being processed
* output directory for the current procedural page being processed
* target directory passed on the command-line.
* {@link $targetDir} is malleable, always adding package/ and package/subpackage/ subdirectories onto it.
* output directory for the current class being processed
* template for the class currently being processed
* array of converted package page names.
* Used to link to the package page in the left index
* @var array Format: array(package => 1)
* controls formatting of parser informative output
* "Converting /path/to/file.php... Procedural Page Elements... Classes..."
* Since HTMLdefaultConverter outputs files while converting, it needs to send a \n to start a new line. However, if there
* is more than one class, output is messy, with multiple \n's just between class file output. This variable prevents that
* contains all of the template procedural page element loop data needed for the current template
* contains all of the template class element loop data needed for the current template
* template options. Currently only 1 recognized option usepear
* usepear tells the getLink() function to return a package link to PEAR and PEAR_ERROR if possible, and to link directly
* to the fully-delimited link package#class.method or package#file.method in PEAR style, if possible, even if the
* package is not parsed. This will allow parsing of separate PEAR packages without parsing the entire thing at once!
* sets {@link $base_dir} to $targetDir
function XMLDocBookConverter(&$allp, &$packp, &$classes, &$procpages, $po, $pp, $qm, $targetDir, $templateDir, $title)
die("XMLDocBookConverter is not supported in this development version. Use XML:DocBook/peardoc2:default");
* do that stuff in $template_options
function &getLink($expr, $package = false, $packages = false)
return '<programlisting role="php"><![CDATA[
'. $sourcecode. ']]></programlisting>';
return '<classname>'. $typename. '</classname>';
return '<function>'. $typename. '</function>';
return '<constant>'. $typename. '</constant>';
return '<varname>'. $typename. '</varname>';
$templ->assign("packageindex",$this->package_index);
* Writes out the template file of {@link $class_data} and unsets the template to save memory
* @see registerCurrentClass()
* @see parent::endClass()
$this->writefile(strtolower($func[1] ). '.xml',$func[0]->fetch('method.tpl'));
$this->writefile(str_replace(array('_','.'),array('-','--'),strtolower($this->class)). '-summary.xml',$this->class_summary->fetch('class_summary.tpl'));
* Writes out the template file of {@link $page_data} and unsets the template to save memory
$this->writefile(strtolower($this->page). '-summary.xml',$this->page_summary->fetch('page_summary.tpl'));
* @return string <ulink url="'.$link.'">'.$text.'</ulink>
return '<ulink url="'. $link. '">'. $text. '</ulink>';
if (!isset ($this->package_index))
if (!isset ($start)) $start = $key;
$this->package_index[] = array('link' => "li_$key.html", 'title' => $key);
foreach($o1 as $subpackage => $links)
for($i= 0;$i< count($links);$i++ )
$this->left[$package][$subpackage][] =
array("link" => $this->returnSee($links[$i], false, false, false), "title" => $links[$i]->name);
foreach($o1 as $subpackage => $links)
for($i= 0;$i< count($links);$i++ )
$this->left['#class'][$package][$subpackage][] =
array("link" => $this->returnSee($links[$i], false, false, false), "title" => $links[$i]->name);
* HTMLdefaultConverter chooses to format both package indexes and the complete index here
* This function formats output for the elementindex.html and pkgelementindex.html template files. It then
* writes them to the target directory
* @see generateElementIndex(), generatePkgElementIndex()
// will implement in next release with other templates than peardoc2
for($i= 0;$i< count($package_indexes);$i++ )
$this->package = $package_indexes[$i]['package'];
$template->assign("compiledclassindex",$this->getClassLeft());
$template->assign("compiledfileindex",$this->getPageLeft());
$template->assign("index",$package_indexes[$i]['pindex']);
$template->assign("package",$package_indexes[$i]['package']);
$template->assign("letters",$mletters[$package_indexes[$i]['package']]);
$template->assign("title","Package ". $package_indexes[$i]['package']. " Element Index");
$template->assign("date",date("r",time()));
// $this->writefile('elementindex_'.$package_indexes[$i]['package'].'.html',$template->fetch('pkgelementindex.tpl'));
* HTMLdefaultConverter uses this function to format template index.html and packages.html
* This function generates the package list from {@link $all_packages}, eliminating any
* packages that don't have any entries in their package index (no files at all, due to @ignore
* or other factors). Then it uses the default package name as the first package index to display.
* It sets the right pane to be either a blank file with instructions on making package-level docs,
* or the package-level docs for the default package.
* @global string Used to set the starting package to display
// will implement in next release with other templates than peardoc2
global $phpDocumentor_DefaultPackageName;
$template->assign("index",$elindex);
$template->assign("letters",$mletters);
$template->assign("title","Element Index");
$template->assign("date",date("r",time()));
// $this->writefile('elementindex.html',$template->fetch('elementindex.tpl'));
uksort($this->package_index,"strnatcasecmp");
if (!isset ($start)) $start = $key;
if (isset ($this->package_index[$phpDocumentor_DefaultPackageName])) $start = $phpDocumentor_DefaultPackageName;
$index->assign("compiledclassindex",$this->getClassLeft());
$index->assign("compiledfileindex",$this->getPageLeft());
$index->assign("date",date("r",time()));
$index->assign("title",$this->title);
$index->assign("start","li_$start.html");
// $this->writefile("index.html",$index->fetch('index.tpl'));
// will implement in next release with other templates than peardoc2
$template->assign("compiledclassindex",$this->getClassLeft());
$template->assign("compiledfileindex",$this->getPageLeft());
$template->assign("date",date("r",time()));
$template->assign("title",$this->title);
$template->assign("package",$key);
// $this->writefile("li_$key.html",$template->fetch('index.tpl'));
* Generate indexes for li_package.html and classtree output files
* This function generates the li_package.html files from the template file left.html. It does this by
* iterating through each of the $page_elements, $class_elements and $function_elements arrays to retrieve
* the pre-sorted {@link abstractLink} descendants needed for index generation. Conversion of these links to
* text is done by {@link returnSee()}. The {@link $local} parameter is set to false to ensure that paths are correct.
* Then it uses {@link generateFormattedClassTrees()} to create class trees from the template file classtrees.html. Output
* filename is classtrees_packagename.html. This function also unsets {@link $elements} and {@link $pkg_elements} to free
* up the considerable memory these two class vars use
* @see $page_elements, $class_elements, $function_elements
// will implement in next release with other templates than peardoc2
debug("Nothing parsed, check the command-line");
// Create class tree page
$template->assign("package",$package);
$template->assign("date",date("r",time()));
$template->assign("title","Class Trees for Package $package");
// $this->writefile("classtrees_$package.html",$template->fetch('classtrees.tpl'));
// free up considerable memory
* This function takes an {@link abstractLink} descendant and returns an html link
* @param abstractLink a descendant of abstractlink should be passed, and never text
* @param string text to display in the link
* @param boolean this parameter is not used, and is deprecated
* @param boolean determines whether the returned text is enclosed in an <a> tag
function returnSee(&$element, $eltext = false, $local = true, $with_a = true)
if (!$element) return false;
$eltext = $element->title;
$eltext = '<classname>'. $element->name. '</classname>';
if ($element->type == 'var') $eltext .= '<varname>';
$eltext .= $element->class. '::';
if ($element->type == 'define')
if ($element->type == 'function')
$eltext .= $element->name;
if ($element->type == 'function' || $element->type == 'method') $eltext .= '()</function>';
if ($element->type == 'var') $eltext .= '</varname>';
if ($element->type == 'define') $eltext .= '</constant>';
if (!empty($element->subpackage))
$a = $element->subpackage. '.';
return '<link linkend="package.'. strtolower($element->package. '.'. $a). $element->fileAlias. '">'. $eltext. '</link>';
return 'package.'. strtolower($element->package. '.'. $a). $element->fileAlias;
return '<link linkend="package.'. strtolower($element->package. '.'. $a). $element->fileAlias. '.'. urlencode($element->name). '">'. $eltext. '</link>';
return 'package.'. strtolower($element->package. '.'. $a). $element->fileAlias. '.'. urlencode($element->name);
return '<link linkend="package.'. strtolower($element->package. '.'. $a). $element->fileAlias. '.'. urlencode($element->name). '">'. $eltext. '</link>';
return 'package.'. strtolower($element->package. '.'. $a). $element->fileAlias. '.'. urlencode($element->name);
return '<link linkend="package.'. strtolower($element->package. '.'. $a. str_replace(array('_','.'),array('-','--'),$element->name)). '">'. $eltext. '</link>';
return 'package.'. strtolower($element->package. '.'. $a. str_replace(array('_','.'),array('-','--'),$element->name));
return '<link linkend="package.'. strtolower($element->package. '.'. $a. $element->fileAlias. '.'. str_replace('_','-',$element->name)). '">'. $eltext. '</link>';
return 'package.'. strtolower($element->package. '.'. $a. $element->fileAlias. '.'. str_replace('_','-',$element->name));
return '<link linkend="package.'. strtolower($element->package. '.'. $a. str_replace(array('_','.'),array('-','--'),$element->class). '.'. str_replace('_','-',$element->name)). '">'. $eltext. '</link>';
return '<link linkend="package.'. strtolower($element->package. '.'. $a. str_replace(array('_','.'),array('-','--'),$element->class). '.'. $element->name). '">'. $eltext. '</link>';
return 'package.'. strtolower($element->package. '.'. $a. str_replace(array('_','.'),array('-','--'),$element->class). '.'. $element->name);
return '<link linked="package.'. strtolower($element->package. '.'. $a. str_replace(array('_','.'),array('-','--'),$element->name). '-tutorial">'. $eltext). '</link>';
return 'package.'. strtolower($element->package. '.'. $a. str_replace(array('_','.'),array('-','--'),$element->name)). '-tutorial';
* Get the id value needed to allow linking
* @param mixed descendant of parserElement or parserData/parserPage
* @see parserElement, parserData, parserPage
* @return string the id value for this element type
$element = $this->addLink($el->parent);
$element = $this->addLink($el);
if (!empty($element->subpackage))
$a = $element->subpackage. '.';
return 'package.'. strtolower($element->package. '.'. $a. $element->fileAlias);
return 'package.'. $element->package. '.'. strtolower($a. $element->fileAlias. '.'. str_replace(array('$','_','"',"'"),array('var--','-','-','-'),$element->name));
return 'package.'. strtolower($element->package. '.'. $a. $element->fileAlias. '.'. str_replace(array('$','_','"',"'"),array('var--','-','-','-'),$element->name));
return 'package.'. strtolower($element->package. '.'. $a. str_replace(array('_','.'),array('-','--'),$element->name));
return 'package.'. strtolower($element->package. '.'. $a. $element->fileAlias. '.'. str_replace('_','-',$element->name));
return 'package.'. strtolower($element->package. '.'. $a. str_replace(array('_','.'),array('-','--'),$element->class). '-summary.vars.'. str_replace(array('$','_'),array('var--','-'),$element->name));
return 'package.'. strtolower($element->package. '.'. $a. str_replace(array('_','.'),array('-','--'),$element->name)). '-tutorial';
* Create errors.html template file output
* This method takes all parsing errors and warnings and spits them out ordered by file and line number.
* @global ErrorTracker We'll be using it's output facility
global $phpDocumentor_errors;
$warnings = $phpDocumentor_errors->returnWarnings();
$errors = $phpDocumentor_errors->returnErrors();
foreach($warnings as $warning)
$linenum .= ' on line '. $warning->linenum;
$files[$file]['warnings'][] = array('name' => $linenum, 'listing' => $warning->data);
foreach($errors as $error)
$linenum .= ' on line '. $error->linenum;
$files[$file]['errors'][] = array('name' => $linenum, 'listing' => $error->data);
foreach($allfiles as $file => $num)
usort($allfiles,'strnatcasecmp');
$allfiles[0] = "Post-parsing";
foreach($allfiles as $i => $a)
$allfiles[$i] = array('file' => $a);
foreach($files as $file => $data)
if ($file == '##none') $file = 'Post-parsing';
$template->assign("files",$allfiles);
$template->assign("all",$out);
$template->assign("title","phpDocumentor Parser Errors and Warnings");
$this->writefile("errors.html",$template->fetch('errors.tpl'));
return parent::prepareDocBlock($element, array('staticvar' => 'staticvar','deprec' => 'deprecated','abstract' => 'abstract','TODO' => 'todo', 'uses' => 'see', 'usedby' => 'see', 'tutorial' => 'see'), $nopackage);
$subpackage = (empty($subpackage) ? '' : '.'. $subpackage);
$id = (empty($id) ? '' : '.'. $id);
return 'package.'. strtolower($package. $subpackage. str_replace(array('_','.'),array('-','--'),$tutorial). $id);
return '<!CDATA['. $value. ']]>';
* Converts package page and sets its package as used in {@link $package_pages}
* @param parserPackagePage
$this->package = $element->package;
$template->assign("compiledclassindex",$this->getClassLeft());
$template->assign("compiledfileindex",$this->getPageLeft());
$template->assign("date",date("r",time()));
$template->assign("title",$this->title);
$template->assign("package",$element->package);
$x = $element->Convert($this);
// $this->writefile("li_".$element->package.".html",$template->fetch('index.tpl'));
$x = $element->Convert($this,false);
{ // add child tutorial list to the tutorial through a slight hack :)
if (!empty($element->subpackage)) $b = '.'. $element->subpackage;
foreach($element->ini['Linked Tutorials'] as $child)
$subtutorials .= ' &'. $element->package. $b. '.'. str_replace(array('_','.'),array('-','--'),$child). '-'. $element->tutorial_type. "-tutorial;\n";
<title>Related Docs</title>
</refsect1></refentry>',$x);
$template->assign('contents',$x);
$contents = $template->fetch('tutorial.tpl');
* Converts class variables for template output.
* @see prepareDocBlock(), getFormattedOverrides()
if ($element->docblock->var)
$b = $element->docblock->var->converted_returnType;
// var_dump($this->getFormattedOverrides($element));
$this->class_summary->append('vars',array('sdesc' => $docblock['sdesc'],
'desc' => $docblock['desc'],
'tags' => $docblock['tags'],
'line_number' => $element->getLineNumber(),
'id' => $this->getId($element)));
$this->class_data->append('vars',array('sdesc' => $docblock['sdesc'],
'desc' => $docblock['desc'],
'tags' => $docblock['tags'],
'line_number' => $element->getLineNumber(),
'id' => $this->getId($element)));
* Converts class for template output
* @see prepareDocBlock(), generateChildClassList(), generateFormattedClassTree(), getFormattedConflicts()
* @see getFormattedInheritedMethods(), getFormattedInheritedVars()
$this->class_dir = $element->docblock->package;
$this->class_data->assign("sdesc",$docblock['sdesc']);
$this->class_data->assign("desc",$docblock['desc']);
$this->class_data->assign("tags",$docblock['tags']);
if ($t = $element->getTutorial())
$this->class_summary = &$this->newSmarty(true);
if ($t = $element->getTutorial())
$this->class_summary->assign("tutorial",$this->returnSee($t));
$this->class_summary->assign("class_name",$this->type_adjust($element->getName()));
$this->class_summary->assign("sdesc",$docblock['sdesc']);
$this->class_summary->assign("desc",$docblock['desc']);
$this->class_summary->assign("tags",$docblock['tags']);
$this->class_summary->assign("vars",array());
$this->class_summary->assign("methods",array());
$this->class_summary->assign("package",$element->docblock->package);
$this->class_summary->assign("source_location",$element->getSourceLocation($this,$this->template_options['usepear']));
$this->class_summary->assign("id",$this->getId($element). '-summary');
if (!empty($inherited_methods))
$this->class_summary->assign("imethods",$inherited_methods);
if (!empty($inherited_vars))
$this->class_summary->assign("ivars",$inherited_vars);
* Converts method for template output
* @see prepareDocBlock(), parserMethod::getFunctionCall(), getFormattedDescMethods(), getFormattedOverrides()
$fname = $element->getName();
if ($element->isConstructor)
$fname = 'constructor '. $element->getName();
if ($element->docblock->return)
$a = $element->docblock->return->Convert($this);
$returntype = $element->docblock->return->converted_returnType;
if ($returntype != $element->docblock->return->returnType)
$returntype = "<replaceable>$returntype</replaceable>";
if (count($element->docblock->params))
foreach($element->docblock->params as $param => $val)
$a = $val->Convert($this);
$params[$param] = array("var" => $param,"datatype" => $val->converted_returnType,"data" => $a);
$this->class_summary->append('methods',array('id' => $this->getId($element),
'sdesc' => $docblock['sdesc'],
'desc' => $docblock['desc'],
'tags' => $docblock['tags'],
'is_constructor' => $element->isConstructor,
'function_name' => $element->getName(),
'function_return' => $returntype,
'function_call' => $element->getIntricateFunctionCall($this,$params),
'line_number' => $element->getLineNumber(),
'sdesc' => $docblock['sdesc'],
'desc' => $docblock['desc'],
'tags' => $docblock['tags'],
'is_constructor' => $element->isConstructor,
'function_name' => $element->getName(),
'function_return' => $returntype,
'function_call' => $element->getIntricateFunctionCall($this,$params),
'line_number' => $element->getLineNumber(),
$this->method_data[$i][0]->assign('sdesc',$docblock['sdesc']);
$this->method_data[$i][0]->assign('desc',$docblock['desc']);
$this->method_data[$i][0]->assign('tags',$docblock['tags']);
$this->method_data[$i][0]->assign('function_name',$fname);
$this->method_data[$i][0]->assign('function_return',$returntype);
$this->method_data[$i][0]->assign('function_call',$element->getIntricateFunctionCall($this,$params));
* Converts function for template output
* @see prepareDocBlock(), parserFunction::getFunctionCall(), getFormattedConflicts()
$fname = $element->getName();
if (count($element->docblock->params))
foreach($element->docblock->params as $param => $val)
$a = $val->Convert($this);
$params[$param] = array("var" => $param,"datatype" => $val->converted_returnType,"data" => $a);
if ($element->docblock->return)
$a = $element->docblock->return->Convert($this);
$returntype = $element->docblock->return->converted_returnType;
$this->page_summary->append("function_ids",$this->getId($element));
$this->page_summary->append('functions',array('id' => $this->getId($element),
'sdesc' => $docblock['sdesc'],
'desc' => $docblock['desc'],
'tags' => $docblock['tags'],
'function_name' => $element->getName(),
'line_number' => $element->getLineNumber(),
'function_return' => $returntype,
'function_call' => $element->getIntricateFunctionCall($this,$params),
$this->function_data[$i][0]->assign('line_number',$element->getLineNumber());
$this->function_data[$i][0]->assign('function_return',$returntype);
$this->function_data[$i][0]->assign('function_call',$element->getIntricateFunctionCall($this,$params));
* Converts include elements for template output
parent::convertInclude($element, array('include_file' => '-'. strtr($element->getValue(),array('"' => '', "'" => '','.' => '-'))));
$this->page_summary->append('includes',array('sdesc' => $docblock['sdesc'],
'desc' => $docblock['desc'],
'tags' => $docblock['tags'],
'utags' => $docblock['utags'],
'include_name' => $element->getName(),
'line_number' => $element->getLineNumber(),
'include_file' => '-'. strtr($element->getValue(),array('"' => '', "'" => '','.' => '-'))));
* Converts defines for template output
* @see prepareDocBlock(), getFormattedConflicts()
$this->page_summary->append('defines',array('sdesc' => $docblock['sdesc'],
'desc' => $docblock['desc'],
'tags' => $docblock['tags'],
'name' => $element->getName(),
'value' => $element->getValue(),
'line_number' => $element->getLineNumber(),
'id' => $this->getId($element)));
* Converts global variables for template output
* @see prepareDocBlock(), getFormattedConflicts()
$this->page_summary->append('globals',array('sdesc' => $docblock['sdesc'],
'desc' => $docblock['desc'],
'tags' => $docblock['tags'],
'name' => $element->getName(),
'type' => $element->getDataType($this),
'line_number' => $element->getLineNumber(),
'id' => $this->getId($element)));
* converts procedural pages for template output
* @see prepareDocBlock(), getClassesOnPage()
$this->page_dir = $element->parent->package;
// registering stuff on the template
$this->page_data->assign("function_ids",array());
if ($t = $element->getTutorial())
$this->page_summary = new Smarty;
// registering stuff on the template
$this->page_summary->assign("source_location",$element->parent->getSourceLocation($this,$this->template_options['usepear']));
$this->page_summary->assign("date",date("r",time()));
$this->page_summary->assign("functions",array());
$this->page_summary->assign("includes",array());
$this->page_summary->assign("defines",array());
$this->page_summary->assign("globals",array());
$this->page_summary->assign("name",$element->parent->getFile());
$this->page_summary->assign("function_ids",array());
$this->page_summary->assign("sdesc",$docblock['sdesc']);
$this->page_summary->assign("desc",$docblock['desc']);
$this->page_summary->assign("tags",$docblock['tags']);
$this->page_summary->assign("utags",$docblock['utags']);
$this->page_summary->assign("name", $element->parent->getFile());
$this->page_summary->assign("id", $this->getId($element). '.'. $this->getPageName($element->parent). '-summary');
* returns an array containing the class inheritance tree from the root object to the class
* @param parserClass class variable
* @return array Format: array(root,child,child,child,...,$class)
* @uses parserClass::getParentClassTree()
$tree = $class->getParentClassTree($this);
$result = array($class->getName());
$parent = $tree[$class->getName()];
$subpackage = $parent->docblock->subpackage;
$package = $parent->docblock->package;
$x = $parent->getLink($this);
if (!$x) $x = $parent->getName();
$parent = $tree[$parent->getName()];
elseif (isset ($tree[$parent]))
$parent = $tree[$parent];
return array($class->getName());
function sortMethod($a, $b)
if ($a->isConstructor) return - 1;
if ($b->isConstructor) return 1;
* returns a template-enabled array of class trees
* @param string $package package to generate a class tree for
* @see $roots, HTMLConverter::getRootTree()
if (!isset ($this->roots[$package])) return array();
$roots = $trees = array();
$roots = $this->roots[$package];
for($i= 0;$i< count($roots);$i++ )
* return formatted class tree for the Class Trees page
* @param array $tree output from {@link getSortedClassTreeFromClass()}
* @see Classes::$definitechild, generateFormattedClassTrees()
if ($tree[$cur]['parent'])
// debug("parent ".$tree[$cur]['parent']." not found");
$my_tree .= '<listitem>' . $tree[$cur]['parent'] . '<itemizedlist>';
// debug("parent ".$this->returnSee($tree[$cur]['parent'], false, false)." in other package");
$my_tree .= '<listitem>' . $this->returnSee($tree[$cur]['parent'], false, false);
if ($tree[$cur]['parent']->package != $package) $my_tree .= ' <emphasis>(Different package)</emphasis><itemizedlist>';
// fancy_debug($cur,$lastcur,$kids);
if (count($tree[$cur]['children']))
// debug("$cur has children");
// debug("set $cur kids");
$my_tree .= '<listitem>'. $this->returnSee($tree[$cur]['link'], false, false);
$my_tree .= '<itemizedlist>'. "\n";
list (,$cur) = each($tree[$cur]['children']);
// var_dump('listed',$cur);
$cur = $cur['package'] . '#' . $cur['class'];
// debug("set cur to child $cur");
// $my_tree .= '<li>'.$this->returnSee($tree[$cur]['link'], false, false);
// debug("end of children for $cur");
$my_tree .= '</itemizedlist></listitem>'. "\n";
if ($dopar && ($cur == '#root' || !$cur)) $my_tree .= '</itemizedlist></listitem>';
// debug("$cur has no children");
$my_tree .= '<listitem>'. $this->returnSee($tree[$cur]['link'], false, false). "</listitem>";
if ($dopar && $cur == '#root') $my_tree .= '</itemizedlist></listitem>';
* Generate alphabetical index of all elements
foreach($this->elements as $letter => $nutoh)
$letters[]['letter'] = $letter;
$elindex['letter'] = $letter;
foreach($this->elements[$letter] as $i => $yuh)
switch($this->elements[$letter][$i]->type)
$aa = $this->elements[$letter][$i]->docblock->getSDesc($this);
$oo['name'] = $this->elements[$letter][$i]->getName();
$this->elements[$letter][$i]->docblock->package,
$this->elements[$letter][$i]->getPath(),
$elindex['index'][] = $oo;
$aa = $this->elements[$letter][$i]->docblock->getSDesc($this);
$oo['name'] = $this->elements[$letter][$i]->getName();
$this->elements[$letter][$i]->docblock->package,
$this->elements[$letter][$i]->getPath(),
$elindex['index'][] = $oo;
$aa = $this->elements[$letter][$i]->docblock->getSDesc($this);
$oo['name'] = $this->elements[$letter][$i]->getName();
$this->elements[$letter][$i]->docblock->package,
$this->elements[$letter][$i]->getPath(),
$elindex['index'][] = $oo;
$aa = $this->elements[$letter][$i]->docblock->getSDesc($this);
$oo['name'] = $this->elements[$letter][$i]->getName();
$this->elements[$letter][$i]->docblock->package,
$this->elements[$letter][$i]->getPath(),
$this->elements[$letter][$i]->getName(). '()'
$elindex['index'][] = $oo;
$aa = $this->elements[$letter][$i]->docblock->getSDesc($this);
$oo['name'] = $this->elements[$letter][$i]->getName();
$this->elements[$letter][$i]->docblock->package,
$this->elements[$letter][$i]->getPath(),
$this->elements[$letter][$i]->class. '::'. $this->elements[$letter][$i]->getName(). '()'
$elindex['index'][] = $oo;
$aa = $this->elements[$letter][$i]->docblock->getSDesc($this);
$oo['name'] = $this->elements[$letter][$i]->getName();
$this->elements[$letter][$i]->docblock->package,
$this->elements[$letter][$i]->getPath(),
$this->elements[$letter][$i]->class. '::'. $this->elements[$letter][$i]->getName()
$elindex['index'][] = $oo;
$oo['name'] = $this->elements[$letter][$i]->getFile();
$this->elements[$letter][$i]->getPath(),
$elindex['index'][] = $oo;
if (isset ($elindex['index']))
$elementindex[] = $elindex;
unset ($letters[count($letters) - 1]);
return array($elementindex,$letters);
* calls the converter setTargetDir, and then copies any template images and the stylesheet if they haven't been copied
* @see Converter::setTargetDir()
$template_images = array();
$template_images = array();
while($entry = $d->read())
$template_images[] = $entry;
while($entry = $d->read())
foreach($stylesheets as $image)
foreach($template_images as $image)
* Generate alphabetical index of all elements by package and subpackage
* @param string $package name of a package
* @see $pkg_elements, walk(), generatePkgElementIndexes()
foreach($this->pkg_elements[$package] as $subpackage => $els)
if (empty($els)) continue;
foreach($els as $letter => $yuh)
if (!isset ($used[$letter]))
$letters[]['letter'] = $letter;
$letterind[$letter] = count($letters) - 1;
$elindex[$letter]['letter'] = $letter;
foreach($els[$letter] as $i => $yuh)
switch($els[$letter][$i]->type)
$aa = $els[$letter][$i]->docblock->getSDesc($this);
$oo['name'] = $els[$letter][$i]->getName();
'in file '. $els[$letter][$i]->file. ', class '. $this->getClassLink($els[$letter][$i]->getName(),
$els[$letter][$i]->docblock->package,
$els[$letter][$i]->getPath(),
$els[$letter][$i]->getName()
$oo['subpackage'] = $subpackage;
$elindex[$letter]['index'][] = $oo;
$aa = $els[$letter][$i]->docblock->getSDesc($this);
$oo['name'] = $els[$letter][$i]->getName();
'in file '. $els[$letter][$i]->file. ', constant '. $this->getDefineLink($els[$letter][$i]->getName(),
$els[$letter][$i]->docblock->package,
$els[$letter][$i]->getPath(),
$els[$letter][$i]->getName()
$oo['subpackage'] = $subpackage;
$elindex[$letter]['index'][] = $oo;
$aa = $els[$letter][$i]->docblock->getSDesc($this);
$oo['name'] = $els[$letter][$i]->getName();
'in file '. $els[$letter][$i]->file. ', global variable '. $this->getGlobalLink($els[$letter][$i]->getName(),
$els[$letter][$i]->docblock->package,
$els[$letter][$i]->getPath(),
$els[$letter][$i]->getName()
$oo['subpackage'] = $subpackage;
$elindex[$letter]['index'][] = $oo;
$aa = $els[$letter][$i]->docblock->getSDesc($this);
$oo['name'] = $els[$letter][$i]->getName();
'in file '. $els[$letter][$i]->file. ', function '. $this->getFunctionLink($els[$letter][$i]->getName(),
$els[$letter][$i]->docblock->package,
$els[$letter][$i]->getPath(),
$els[$letter][$i]->getName(). '()'
$oo['subpackage'] = $subpackage;
$elindex[$letter]['index'][] = $oo;
$aa = $els[$letter][$i]->docblock->getSDesc($this);
$oo['name'] = $els[$letter][$i]->getName();
'in file '. $els[$letter][$i]->file. ', method '. $this->getMethodLink($els[$letter][$i]->getName(),
$els[$letter][$i]->class,
$els[$letter][$i]->docblock->package,
$els[$letter][$i]->getPath(),
$els[$letter][$i]->class. '::'. $els[$letter][$i]->getName(). '()'
$oo['subpackage'] = $subpackage;
$elindex[$letter]['index'][] = $oo;
$aa = $els[$letter][$i]->docblock->getSDesc($this);
$oo['name'] = $els[$letter][$i]->getName();
'in file '. $els[$letter][$i]->file. ', variable '. $this->getVarLink($els[$letter][$i]->getName(),
$els[$letter][$i]->class,
$els[$letter][$i]->docblock->package,
$els[$letter][$i]->getPath(),
$els[$letter][$i]->class. '::'. $els[$letter][$i]->getName()
$oo['subpackage'] = $subpackage;
$elindex[$letter]['index'][] = $oo;
$oo['name'] = $els[$letter][$i]->getFile();
'procedural page '. $this->getPageLink($els[$letter][$i]->getFile(),
$els[$letter][$i]->package,
$els[$letter][$i]->getPath(),
$els[$letter][$i]->getFile()
$oo['subpackage'] = $subpackage;
$elindex[$letter]['index'][] = $oo;
usort($letters,'XMLDocBook_lettersort');
while(list ($letter,$tempel) = each($elindex))
unset ($letters[$letterind[$tempel['letter']]]);
$elementindex[] = $tempel;
} else $letters = array();
return array($elementindex,$letters);
* @see generatePkgElementIndex()
$package_names = array();
$pkgs['package'] = $package;
$pkg['package'] = $package;
if (count($pkg['pindex']))
$package_names[] = $pkgs;
foreach($packages as $i => $package)
for($j= 0;$j< count($package_names);$j++ )
if ($package_names[$j]['package'] != $package['package']) $pnames[] = $package_names[$j];
$packages[$i]['packageindexes'] = $pnames;
return array($packages,$package_names,$letters);
* @param string name of class
* @param string package name
* @param string full path to look in (used in index generation)
* @param boolean deprecated
* @param boolean return just the URL, or enclose it in an html a tag
* @return mixed false if not found, or an html a link to the class's documentation
* @see parent::getClassLink()
function getClassLink($expr,$package, $file = false,$text = false, $local = true, $with_a = true)
return $this->returnSee($a, $text, $local, $with_a);
* @param string name of function
* @param string package name
* @param string full path to look in (used in index generation)
* @param boolean deprecated
* @param boolean return just the URL, or enclose it in an html a tag
* @return mixed false if not found, or an html a link to the function's documentation
* @see parent::getFunctionLink()
function getFunctionLink($expr,$package, $file = false,$text = false, $local = true)
* @param string name of define
* @param string package name
* @param string full path to look in (used in index generation)
* @param boolean deprecated
* @param boolean return just the URL, or enclose it in an html a tag
* @return mixed false if not found, or an html a link to the define's documentation
* @see parent::getDefineLink()
function getDefineLink($expr,$package, $file = false,$text = false, $local = true)
* @param string name of global variable
* @param string package name
* @param string full path to look in (used in index generation)
* @param boolean deprecated
* @param boolean return just the URL, or enclose it in an html a tag
* @return mixed false if not found, or an html a link to the global variable's documentation
* @see parent::getGlobalLink()
function getGlobalLink($expr,$package, $file = false,$text = false, $local = true)
* @param string name of procedural page
* @param string package name
* @param string full path to look in (used in index generation)
* @param boolean deprecated
* @param boolean return just the URL, or enclose it in an html a tag
* @return mixed false if not found, or an html a link to the procedural page's documentation
* @see parent::getPageLink()
function getPageLink($expr,$package, $path = false,$text = false, $local = true)
* @param string name of method
* @param string class containing method
* @param string package name
* @param string full path to look in (used in index generation)
* @param boolean deprecated
* @param boolean return just the URL, or enclose it in an html a tag
* @return mixed false if not found, or an html a link to the method's documentation
* @see parent::getMethodLink()
function getMethodLink($expr,$class,$package, $file = false,$text = false, $local = true)
* @param string name of var
* @param string class containing var
* @param string package name
* @param string full path to look in (used in index generation)
* @param boolean deprecated
* @param boolean return just the URL, or enclose it in an html a tag
* @return mixed false if not found, or an html a link to the var's documentation
* @see parent::getVarLink()
function getVarLink($expr,$class,$package, $file = false,$text = false, $local = true)
* does a nat case sort on the specified second level value of the array
* does a nat case sort on the specified second level value of the array.
* this one puts constructors first
if (strpos($aa,'CONSTRUCTOR') === 0)
if (strpos($bb,'CONSTRUCTOR') === 0)
* This function is not used by HTMLdefaultConverter, but is required by Converter
function XMLDocBook_lettersort($a, $b)
|