Пример #1
0
 /** Build the project overview page.
  *
  * @param Doclet doclet
  */
 public function __construct(&$doclet)
 {
     parent::__construct($doclet);
     $this->_id = 'namespaces';
     $rootDoc =& $this->_doclet->rootDoc();
     $phpdoctor =& $this->_doclet->phpdoctor();
     $packages =& $rootDoc->packages();
     ksort($packages);
     ob_start();
     echo '<header>';
     echo '<h1>' . $this->_doclet->_docTitle . '</h1>';
     echo '<h2>Overview</h2>';
     echo '</header>';
     echo '<table>';
     foreach ($packages as $packageName => $package) {
         echo '<tr><td><a href="' . $package->asPath() . '.html">' . $package->name() . '</a></td></tr>';
     }
     echo '</table>';
     $textTag =& $rootDoc->tags('@text');
     if ($textTag) {
         $description = $this->_processInlineTags($textTag);
         if ($description) {
             echo '<h3>Description</h3>';
             echo '<div class="comment">', $description, "</div>\n\n";
         }
     }
     $this->_output = ob_get_contents();
     ob_end_clean();
     $this->_write('namespaces.html', 'Namespaces', true);
 }
Пример #2
0
    /** Build the package summaries.
     *
     * @param Doclet doclet
     */
    public function __construct(&$doclet)
    {
        parent::__construct($doclet);
        $this->_id = 'frame';
        $rootDoc = $this->_doclet->rootDoc();
        $phpdoctor = $this->_doclet->phpdoctor();
        $packages = $rootDoc->packages();
        ksort($packages);
        ob_start();
        #echo '<h1>'.$this->_doclet->_docTitle.'</h1>';
        $namespaces = array();
        foreach ($packages as $package) {
            $name = explode('\\', $package->name());
            $namespaces = $this->placeIntoNamespace($namespaces, $package, $name);
        }
        $this->outputNamespace($namespaces, $packages);
        echo <<<SCRIPT
<script>
window.onload = function () {
    var lis = document.getElementsByTagName("li");
    for (var foo = 0; foo < lis.length; foo++) {
        lis[foo].onclick = function (e) {
            e.stopPropagation();
            if (this.className == "parent open") {
                this.className = "parent";
            } else if (this.className == "parent") {
                this.className = "parent open";
            }
        };
    }
};
</script>
SCRIPT;
        $this->_output = ob_get_contents();
        ob_end_clean();
        $this->_write('frame.html', 'Frame', true, false);
    }
Пример #3
0
 /** Build the namespace summaries.
  *
  * @param Doclet doclet
  */
 public function __construct(&$doclet)
 {
     parent::__construct($doclet);
     $this->_id = 'namespace';
     $rootDoc =& $this->_doclet->rootDoc();
     $phpdoctor =& $this->_doclet->phpdoctor();
     $packages =& $rootDoc->packages();
     ksort($packages);
     foreach ($packages as $packageName => $package) {
         $this->_depth = $package->depth();
         ob_start();
         echo '<header>';
         echo '<h1>' . $this->_doclet->_docTitle . '</h1>';
         echo "<span>Namespace</span>\n\n";
         echo '<h2>', $package->name(), "</h2>\n\n";
         echo '</header>';
         $classes =& $package->allClasses();
         if ($classes) {
             ksort($classes);
             echo '<table>', "\n";
             foreach ($classes as $name => $class) {
                 $textTag =& $classes[$name]->tags('@text');
                 echo '<tr><td><a href="', str_repeat('../', $this->_depth), $classes[$name]->asPath(), '">', $classes[$name]->name(), '</a></td>';
                 echo '<td>';
                 if ($textTag) {
                     echo strip_tags($this->_processInlineTags($textTag, TRUE), '<a><b><strong><u><em>');
                 }
                 echo "</td></tr>\n";
             }
             echo "</table>\n\n";
         }
         $isSomething = false;
         $globals = $package->globals();
         if ($globals) {
             $isSomething = true;
             echo '<h3>Globals</h3>', "\n";
             echo '<table>', "\n";
             foreach ($globals as $field) {
                 $textTag =& $field->tags('@text');
                 echo "<tr>\n";
                 echo '<td class="type">', $field->modifiers(FALSE), ' ', $field->typeAsString(), "</td>\n";
                 echo '<td class="description">';
                 echo '<p class="name"><a href="#', $field->name(), '">';
                 if (is_null($field->constantValue())) {
                     echo '$';
                 }
                 echo $field->name(), '</a></p>';
                 if ($textTag) {
                     echo '<p class="description">', strip_tags($this->_processInlineTags($textTag, TRUE), '<a><b><strong><u><em>'), '</p>';
                 }
                 echo "</td>\n";
                 echo "</tr>\n";
             }
             echo "</table>\n\n";
         }
         $functions = $package->functions();
         if ($functions) {
             $isSomething = true;
             echo '<h3>Functions</h3>', "\n";
             echo '<table>', "\n";
             foreach ($functions as $function) {
                 $textTag =& $function->tags('@text');
                 echo "<tr>\n";
                 echo '<td class="type">', $function->modifiers(FALSE), ' ', $function->returnTypeAsString(), "</td>\n";
                 echo '<td class="description">';
                 echo '<p class="name"><a href="#', $function->name(), '()">', $function->name(), '</a>', $function->flatSignature(), '</p>';
                 if ($textTag) {
                     echo '<p class="description">', strip_tags($this->_processInlineTags($textTag, TRUE), '<a><b><strong><u><em>'), '</p>';
                 }
                 echo "</td>\n";
                 echo "</tr>\n";
             }
             echo "</table>\n\n";
         }
         if ($isSomething) {
             echo '<h3>Details</h3>', "\n";
             if ($globals) {
                 foreach ($globals as $field) {
                     $textTag =& $field->tags('@text');
                     $type =& $field->type();
                     echo '<code class="signature" id="' . $field->name() . '">', $field->modifiers(), ' ', $field->typeAsString(), ' <strong>';
                     if (is_null($field->constantValue())) {
                         echo '$';
                     }
                     echo $field->name(), '</strong>';
                     if (!is_null($field->value())) {
                         echo ' = ', htmlspecialchars($field->value());
                     }
                     echo "</code>\n";
                     echo '<div class="details">', "\n";
                     if ($textTag) {
                         echo $this->_processInlineTags($textTag);
                     }
                     $this->_processTags($field->tags());
                     echo "</div>\n\n";
                 }
             }
             if ($functions) {
                 foreach ($functions as $function) {
                     $textTag =& $function->tags('@text');
                     echo '<code class="signature" id="' . $function->name() . '">', $function->modifiers(), ' ', $function->returnTypeAsString(), ' <strong>';
                     echo $function->name(), '</strong>', $function->flatSignature();
                     echo "</code>\n";
                     echo '<div class="details">', "\n";
                     if ($textTag) {
                         echo $this->_processInlineTags($textTag);
                     }
                     $this->_processTags($function->tags());
                     echo "</div>\n\n";
                 }
             }
         }
         $textTag =& $package->tags('@text');
         if ($textTag) {
             $description = $this->_processInlineTags($textTag);
             if ($description) {
                 echo '<h3>Description</h3>';
                 echo '<div class="comment">', $description, "</div>\n\n";
             }
         }
         $this->_output = ob_get_contents();
         ob_end_clean();
         $this->_write($package->asPath() . '.html', $package->name(), TRUE);
     }
 }