home *** CD-ROM | disk | FTP | other *** search
/ Enter 2004 June / ENTER.ISO / files / xampp-win32-1.4.5-installer.exe / xampp / LinkClasses.inc < prev    next >
Encoding:
Text File  |  2004-03-24  |  5.2 KB  |  195 lines

  1. <?php
  2. //
  3. // +------------------------------------------------------------------------+
  4. // | phpDocumentor                                                          |
  5. // +------------------------------------------------------------------------+
  6. // | Copyright (c) 2000-2003 Joshua Eichorn, Gregory Beaver                 |
  7. // | Email         jeichorn@phpdoc.org, cellog@phpdoc.org                   |
  8. // | Web           http://www.phpdoc.org                                    |
  9. // | Mirror        http://phpdocu.sourceforge.net/                          |
  10. // | PEAR          http://pear.php.net/package-info.php?pacid=137           |
  11. // +------------------------------------------------------------------------+
  12. // | This source file is subject to version 3.00 of the PHP License,        |
  13. // | that is available at http://www.php.net/license/3_0.txt.               |
  14. // | If you did not receive a copy of the PHP license and are unable to     |
  15. // | obtain it through the world-wide-web, please send a note to            |
  16. // | license@php.net so we can mail you a copy immediately.                 |
  17. // +------------------------------------------------------------------------+
  18. //
  19.  
  20. /**
  21.  * Linking to element documentation is performed by the classes in this file.
  22.  *
  23.  * abstractLink descendants contain enough information to differentiate every
  24.  * documentable element, and so can be converted to a link string by
  25.  * {@link Converter::returnSee()}
  26.  * @package phpDocumentor
  27.  * @subpackage Links
  28.  */
  29.  
  30. /**
  31.  * linking classes parent
  32.  * @package phpDocumentor
  33.  * @subpackage Links
  34.  */
  35. class abstractLink
  36. {
  37.     /**#@+ @var string */
  38.     var $path;
  39.     /**
  40.      * phpdoc alias _phpdoc_inc for phpdoc.inc
  41.      */
  42.     var $fileAlias = '';
  43.     /**
  44.      * element type linked to.
  45.      * can only be a documentable element
  46.      */
  47.     var $type = '';
  48.     var $name = '';
  49.     var $category = '';
  50.     var $package = '';
  51.     var $subpackage = '';
  52.     /**#@-*/
  53.  
  54.     /**
  55.      * @param string full path to file containing element
  56.      * @param string page name, as configured by {@link Parser::parse}
  57.      * @param string element name
  58.      * @param string package element is in
  59.      * @param string subpackage element is in
  60.      * @param string optional category that documentation is in
  61.      */
  62.     function addLink($path, $fileAlias, $name, $package, $subpackage, $category = false)
  63.     {
  64.         $this->path = $path;
  65.         $this->fileAlias = $fileAlias;
  66.         $this->name = $name;
  67.         $this->category = $category;
  68.         $this->package = $package;
  69.         $this->subpackage = $subpackage;
  70.     }
  71. }
  72.  
  73. /**
  74.  * procedural page link
  75.  * @package phpDocumentor
  76.  * @subpackage Links
  77.  */
  78. class pageLink extends abstractLink
  79. {
  80.     /** @var string */
  81.     var $type = 'page';
  82. }
  83.  
  84. /**
  85.  * function link
  86.  * @package phpDocumentor
  87.  * @subpackage Links
  88.  */
  89. class functionLink extends abstractLink
  90. {
  91.     /** @var string */
  92.     var $type = 'function';
  93. }
  94.  
  95. /**
  96.  * define link
  97.  * @package phpDocumentor
  98.  * @subpackage Links
  99.  */
  100. class defineLink extends abstractLink
  101. {
  102.     /** @var string */
  103.     var $type = 'define';
  104. }
  105.  
  106. /**
  107.  * global variable link
  108.  * @package phpDocumentor
  109.  * @subpackage Links
  110.  */
  111. class globalLink extends abstractLink
  112. {
  113.     /** @var string */
  114.     var $type = 'global';
  115. }
  116.  
  117. /**
  118.  * class link
  119.  * @package phpDocumentor
  120.  * @subpackage Links
  121.  */
  122. class classLink extends abstractLink
  123. {
  124.     /** @var string */
  125.     var $type = 'class';
  126. }
  127.  
  128. /**
  129.  * method link
  130.  * @package phpDocumentor
  131.  * @subpackage Links
  132.  */
  133. class methodLink extends abstractLink
  134. {
  135.     /** @var string */
  136.     var $type = 'method';
  137.     /** @var string */
  138.     var $class = '';
  139.     
  140.     /**
  141.      * @param string class name
  142.      * @param string full path to file containing element
  143.      * @param string page name, as configured by {@link Parser::parse}
  144.      * @param string element name
  145.      * @param string package element is in
  146.      * @param string subpackage element is in
  147.      */
  148.     function addLink($class, $path ,$fileAlias,$name,$package,$subpackage, $category = false)
  149.     {
  150.         $this->class = $class;
  151.         abstractLink::addLink($path, $fileAlias,$name,$package,$subpackage, $category);
  152.     }
  153. }
  154.  
  155. /**
  156.  * class variable link
  157.  * @package phpDocumentor
  158.  * @subpackage Links
  159.  */
  160. class varLink extends methodLink
  161. {
  162.     /** @var string */
  163.     var $type = 'var';
  164. }
  165.  
  166. /**
  167.  * tutorial link
  168.  * @package phpDocumentor
  169.  * @subpackage Links
  170.  */
  171. class tutorialLink extends abstractLink
  172. {
  173.     /**#@+ @var string */
  174.     var $type = 'tutorial';
  175.     var $section = '';
  176.     var $title = false;
  177.     /**#@-*/
  178.     
  179.     /**
  180.      * @param string section/subsection name
  181.      * @param string full path to file containing element
  182.      * @param string page name, as configured by {@link Parser::parse}
  183.      * @param string element name
  184.      * @param string package element is in
  185.      * @param string subpackage element is in
  186.      * @param string title of tutorial
  187.      */
  188.     function addLink($section,$path,$name,$package,$subpackage,$title = false, $category = false)
  189.     {
  190.         $this->section = $section;
  191.         $this->title = $title;
  192.         parent::addLink($path,'',$name,$package,$subpackage, $category);
  193.     }
  194. }
  195. ?>