3 // +----------------------------------------------------------------------+
5 // +----------------------------------------------------------------------+
6 // | Copyright (c) 1997-2002 The PHP Group |
7 // +----------------------------------------------------------------------+
8 // | This source file is subject to version 2.02 of the PHP license, |
9 // | that is bundled with this package in the file LICENSE, and is |
10 // | available at through the world-wide-web at |
11 // | http://www.php.net/license/2_02.txt. |
12 // | If you did not receive a copy of the PHP license and are unable to |
13 // | obtain it through the world-wide-web, please send a note to |
14 // | license@php.net so we can mail you a copy immediately. |
15 // +----------------------------------------------------------------------+
16 // | Authors: Alan Knowles <alan@akbkhome.com> |
17 // +----------------------------------------------------------------------+
19 require_once 'PHP/CodeDoc/Data.php';
21 * Class Data Container
23 * @package PHP_CodeDoc
25 * @author Alan Knowles <alan@akbkhome.com>
28 class PHP_CodeDoc_Data_Class {
29 var $id; // id in the big classes array.
30 var $name; // the name of the class
31 var $filename; // original filename
32 var $rfilename; // relative filename in relation to root directory.
33 var $rdir; // relative directory
34 var $Parent; // Parent Class (maybe an array in PHP5?)
35 var $Operations =array(); // Array of Method Classes
36 var $Attributes =array(); // Array of Var Classes
37 var $iOperations =array(); // Array of inherited Method Classes
38 var $iAttributes =array(); // Array of inherited Var Classes
40 var $package=""; // package name if any
41 var $copyright; // copyright
42 var $extends = array(); // Array of Parents (names)
44 var $description; // phpdoc class
47 function output_extends() { // cheesy tree?? = better ideas;
49 $t = count($this->extends) -1;
50 for ($i=0;$i<$t+1;$i++) {
53 echo str_repeat(' ',$i) . "|\n". str_repeat(' --',$i);
55 //if ($i != $t) { // last one = no link
56 echo '<a href="'.$this->extends[$i].'.html">'.$this->extends[$i].'</a>';
58 //echo $this->extends[$i];
62 // move later to inherited
67 $cls = str_replace('_','-',strtolower($this->name));
68 foreach($this->Operations as $op) {
70 if (!isset($op->description->category)) {
71 echo "missing Category for {$this->name}::{$op->name}\n";
73 $cats[$op->description->category] = isset($cats[$op->description->category]) ? $cats[$op->description->category] : array();
74 $cats[$op->description->category][] = $op;
76 $n = $cls . '/'. ($op->name == '__construct' ? 'new' : $op->name);
77 $ret[$n] = $op->toJS();
79 foreach($this->Attributes as $op) {
80 // $ret[$this->name . '.'.$op->name] = $op->toJS();
82 $ret[ $this->name] = array();
83 foreach($cats as $k=>$v ) {
84 $ret[ $this->name][$k] = $this->catsToJs($v);
91 function catsToJs($ar)
95 '|xns' => 'Roo.bootstrap',
96 'xtype' => 'NavGroup',
101 foreach($ar as $op) {
102 $c = $cname = $op->name;
103 if ($c == '__construct') {
104 $cname = 'new ' . $op->{'class'};
107 $ret['items'][] = array(
108 '|xns' => 'Roo.bootstrap',
109 'xtype' => 'NavItem',
110 'href' => '#' . str_replace('_','-',strtolower($this->name)). '/'.$c,