6 var $imap = array(); //Hash, <key>:type, <value>: array
7 var $max_col = 0; //Max column for the display, TODO: define in constance instead?
10 function Phpdoc_images() {
12 * $imap_<type> defines the definition of each of the images
13 * <key> : The definition of the image
14 * <value> : File name of the image; images must be in the same folder
18 'Class' => 'class.png',
19 'Private Class' => 'private_class.png',
20 'Abstract Class' => 'abstract_class.png',
21 'Abstract Private Class' => 'abstract_private_class.png'
26 'Method' => 'method.png',
27 'Private Method' => 'private_method.png',
28 'Abstract Method' => 'abstract_method.png',
29 'Constructor' => 'constructor_method.png',
30 'Destructor' => 'destructor_method.png',
31 'Function' => 'function.png'
36 'Folder' => 'folder.png',
37 'Class Folder' => 'class_folder.png',
38 'Function Folder' => 'function_folder.png',
39 'Tutorial Folder' => 'tutorial_folder.png',
40 'Package Folder' => 'package_folder.png'
44 $imap_variable = array(
45 'Variables' => 'variable.png',
46 'Private Variable' => 'private_variable.png',
47 'Global Variable' => 'global.png',
48 'Constant' => 'constant.png'
54 'Index' => 'index.png',
55 'Tutorial' => 'tutorial.png',
56 'Package' => 'package.png'
59 //Instantiate variables
62 'Class' => $imap_class,
63 'Method' => $imap_method,
64 'Folder' => $imap_folder,
65 'Variable' => $imap_variable,
66 'Others' => $imap_others
72 * Generate images dynamically.
73 * @param the path to the image, used by the <a> tag
75 function printImageTable($image_dir){
76 $html = ''; //html code
77 $counter = 1; //row counter
78 $html = '<table id="api_legend_outter"><tr>';
81 foreach ($this->imap as $type=>$type_array){
82 if ($counter > $this->max_col){
84 $counter = 1; //reset counter once it overloads
88 //Run a loop through each of the images inside the array
89 $html .= '<table id="api_legend_inner">';
90 $html .= '<tr><th colspan="2">'.$type.'</th></tr>';
91 foreach($type_array as $image_name => $file_name){
92 $html .= '<tr><td>'.$image_name.'</td>';
93 $html .= '<td>'.$this->getImgTag($image_name, $image_dir.$file_name).'</td></tr>';
100 $html .= "</tr></table>";
107 * @param String the name of the image which will be shown in the title and alt
108 * @param String the path for the image
110 function getImgTag($image_name, $file_name, $width='16'){
111 return '<img src="'.$file_name.'" title="'.$image_name.'" title="'.$image_name.'" width="'.$width.'" />';