Author: dr
Date: Mon Jan 21 09:40:42 2008
New Revision: 7193

Log:
- Fixed issue #12395: Tree docs lacking XHTML visualizaton.

Added:
    trunk/Tree/docs/tutorial_example_xhtml.php   (with props)
Modified:
    trunk/Tree/ChangeLog
    trunk/Tree/docs/tutorial.txt
    trunk/Tree/src/options/visitor_xhtml.php
    trunk/Tree/src/visitors/xhtml.php
    trunk/Tree/src/visitors/yui.php

Modified: trunk/Tree/ChangeLog
==============================================================================
--- trunk/Tree/ChangeLog [iso-8859-1] (original)
+++ trunk/Tree/ChangeLog [iso-8859-1] Mon Jan 21 09:40:42 2008
@@ -2,6 +2,7 @@
 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 - Implemented issue #12139: Allow tree node keys to be auto-generated.
+- Fixed issue #12395: Tree docs lacking XHTML visualizaton.
 
 
 1.0 - Monday 17 December 2007

Modified: trunk/Tree/docs/tutorial.txt
==============================================================================
--- trunk/Tree/docs/tutorial.txt [iso-8859-1] (original)
+++ trunk/Tree/docs/tutorial.txt [iso-8859-1] Mon Jan 21 09:40:42 2008
@@ -409,6 +409,46 @@
       ├─Br
       └─I
 
+XHTML-based visualization
+-------------------------
+
+The ezcTreeVisitorXHTML class implements another visitor that renders the trees
+as nested XHTML lists. In the following example we render the same tree again
+with the default options for this visitor:
+
+.. include:: tutorial_example_xhtml.php
+   :literal:
+
+This outputs the following XHTML::
+
+  <ul>
+    <li><a href="/idNonMetals">Non-Metals</a>
+      <ul>
+        <li><a href="/idNonMetals/idH">Hydrogen</a></li>
+        <li><a href="/idNonMetals/idC">Carbon</a></li>
+        <li><a href="/idNonMetals/idN">Nitrogen</a></li>
+        <li><a href="/idNonMetals/idO">Oxygen</a></li>
+        <li><a href="/idNonMetals/idP">Phosphorus</a></li>
+        <li><a href="/idNonMetals/idS">Sulfur</a></li>
+        <li><a href="/idNonMetals/idSe">Selenium</a></li>
+      </ul>
+    </li>
+    <li><a href="/idNobleGasses">Noble Gasses</a>
+      <ul>
+        <li><a href="/idNobleGasses/idF">Fluorine</a></li>
+        <li><a href="/idNobleGasses/idCl">Chlorine</a></li>
+        <li><a href="/idNobleGasses/idBr">Bromine</a></li>
+        <li><a href="/idNobleGasses/idI">Iodine</a></li>
+      </ul>
+    </li>
+  </ul>
+
+
+The ezcTreeVisitorXHTML visitor allows some options that can be set through the
+constructor. Options include whether links should be added (addLinks), whether
+the root node should be shown (displayRootNode) and others. The options are
+documented with the ezcTreeVisitorXHTMLOptions class.
+
 
 GraphViz-based visualization
 ----------------------------
@@ -471,6 +511,10 @@
 The result of this is as follows (scaled):
 
 .. figure:: img/yui1.gif
+
+The ezcTreeVisitorYUI visitor allows some options that can be set through the
+constructor. The options are documented with the ezcTreeVisitorYUIOptions
+class.
 
 
 .. _DatabaseSchema: introduction_DatabaseSchema.html

Added: trunk/Tree/docs/tutorial_example_xhtml.php
==============================================================================
--- trunk/Tree/docs/tutorial_example_xhtml.php (added)
+++ trunk/Tree/docs/tutorial_example_xhtml.php [iso-8859-1] Mon Jan 21 09:40:42 
2008
@@ -1,0 +1,10 @@
+<?php
+require_once 'tutorial_autoload.php';
+
+$store = new ezcTreeXmlInternalDataStore();
+$tree = new ezcTreeXml( 'files/example1.xml', $store );
+
+$visitor = new ezcTreeVisitorXHTML();
+$tree->accept( $visitor );
+echo (string) $visitor;
+?>

Propchange: trunk/Tree/docs/tutorial_example_xhtml.php
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: trunk/Tree/src/options/visitor_xhtml.php
==============================================================================
--- trunk/Tree/src/options/visitor_xhtml.php [iso-8859-1] (original)
+++ trunk/Tree/src/options/visitor_xhtml.php [iso-8859-1] Mon Jan 21 09:40:42 
2008
@@ -18,10 +18,10 @@
  *           Whether links should be generated or not.
  * @property bool $displayRootNode
  *           Whether the root node should be displayed. The root node will
- *           still be disabled from the links that the visitor create when
+ *           still be disabled from the links that the visitor creates when
  *           $selectedNodeLink is set to true.
  * @property string $xmlId
- *           The ID that should be set on the top level &lt;ul&gt; tag.
+ *           The ID that should be set on the top level <ul> tag.
  * @property array(string) $highlightNodeIds
  *           Which IDs should have the 'highlight' CSS class added.
  * @property array(string) $subtreeHighlightNodeIds

Modified: trunk/Tree/src/visitors/xhtml.php
==============================================================================
--- trunk/Tree/src/visitors/xhtml.php [iso-8859-1] (original)
+++ trunk/Tree/src/visitors/xhtml.php [iso-8859-1] Mon Jan 21 09:40:42 2008
@@ -15,7 +15,9 @@
  *
  * <code>
  * <?php
- *     $visitor = new ezcTreeVisitorXHTML( 'menu_tree', 'menu' );
+ *     $options = new ezcTreeVisitorXHTMLOptions;
+ *     $options->xmlId = 'menu_tree';
+ *     $visitor = new ezcTreeVisitorXHTML( $options );
  *     $tree->accept( $visitor );
  *     echo (string) $visitor; // print the plot
  * ?>
@@ -45,25 +47,18 @@
     protected $root = null;
 
     /**
-     * Holds the XML ID.
-     *
-     * @var string
-     */
-    protected $id;
-
-    /**
-     * Holds the XHTML class.
-     *
-     * @var string
-     */
-    protected $class;
-
-    /**
      * Whether the XML ID has been set.
      *
      * @var bool
      */
     private $treeIdSet;
+
+    /**
+     * Holds the options for this class
+     *
+     * @var ezcTreeVisitorXHTMLOptions
+     */
+    protected $options;
 
     /**
      * Constructs a new ezcTreeVisitorXHTML visualizer.

Modified: trunk/Tree/src/visitors/yui.php
==============================================================================
--- trunk/Tree/src/visitors/yui.php [iso-8859-1] (original)
+++ trunk/Tree/src/visitors/yui.php [iso-8859-1] Mon Jan 21 09:40:42 2008
@@ -63,6 +63,13 @@
     private $treeIdSet;
 
     /**
+     * Holds the options for this class
+     *
+     * @var ezcTreeVisitorYUIOptions
+     */
+    protected $options;
+
+    /**
      * Constructs a new ezcTreeVisitorYUI visualizer.
      *
      * @param ezcTreeVisitorYUIOptions $options


-- 
svn-components mailing list
svn-components@lists.ez.no
http://lists.ez.no/mailman/listinfo/svn-components

Reply via email to