Move HTML-specific code out of base Tree class
authorMichael M Slusarz <slusarz@curecanti.org>
Mon, 23 Aug 2010 22:00:35 +0000 (16:00 -0600)
committerMichael M Slusarz <slusarz@curecanti.org>
Tue, 24 Aug 2010 06:00:58 +0000 (00:00 -0600)
framework/Tree/lib/Horde/Tree.php
framework/Tree/lib/Horde/Tree/Html.php

index eecbead..6ec3073 100644 (file)
@@ -144,12 +144,6 @@ class Horde_Tree implements Countable
      * @param string $name   The name of this tree instance.
      * @param array $params  Additional parameters.
      * <pre>
-     * alternate - (boolean) Alternate shading in the table?
-     * class - (string) The class to use for the table.
-     * hideHeaders - (boolean) Don't render any HTML for the header row, just
-     *               use the widths.
-     * lines - (boolean) Show tree lines?
-     * multiline - (boolean) Do the node labels contain linebreaks?
      * session - (string) The name of the session array key to store data.
      *           If this is an empty string, session storage will be disabled.
      *           DEFAULT: No session storage
@@ -261,7 +255,7 @@ class Horde_Tree implements Countable
      *                            based on the parent node.
      * @param boolean $expanded   Is this level expanded or not.
      * @param array $params       Any other parameters to set (@see
-     *                            addNodeParams() for full details).
+     *                            self::addNodeParams() for full details).
      * @param array $extra_right  Any other columns to display to the right of
      *                            the tree.
      * @param array $extra_left   Any other columns to display to the left of
@@ -440,13 +434,7 @@ class Horde_Tree implements Countable
      * Adds column headers to the tree table.
      *
      * @param array $header  An array containing hashes with header
-     *                       information. The following keys are allowed:
-     * <pre>
-     * align - The alignment inside the header cell
-     * class - The CSS class of the header cell
-     * html - The HTML content of the header cell
-     * width - The width of the header cell
-     * </pre>
+     *                       information.
      */
     public function setHeader($header)
     {
index 587bfe9..3b46c64 100644 (file)
@@ -83,6 +83,23 @@ class Horde_Tree_Html extends Horde_Tree
     );
 
     /**
+     * Constructor.
+     *
+     * @param string $name   The name of this tree instance.
+     * @param array $params  Additional parameters:
+     * <pre>
+     * alternate - (boolean) Alternate shading in the table?
+     * class - (string) The class to use for the table.
+     * lines - (boolean) Show tree lines?
+     * multiline - (boolean) Do the node labels contain linebreaks?
+     * </pre>
+     */
+    public function __construct($name, array $params = array())
+    {
+        parent::__construct($name, $params);
+    }
+
+    /**
      * Returns the tree.
      *
      * @param boolean $static  If true the tree nodes can't be expanded and
@@ -103,6 +120,45 @@ class Horde_Tree_Html extends Horde_Tree
     }
 
     /**
+     * Adds additional parameters to a node.
+     *
+     * @param string $id     The unique node id.
+     * @param array $params  Parameters to set (key/value pairs).
+     * <pre>
+     * class - CSS class to use with this node
+     * icon - Icon to display next node
+     * iconalt - Alt text to use for the icon
+     * iconopen - Icon to indicate this node as expanded
+     * onclick - Onclick event attached to this node
+     * url - URL to link the node to
+     * urlclass - CSS class for the node's URL
+     * target - Target for the 'url' link
+     * title - Link tooltip title
+     * </pre>
+     */
+    public function addNodeParams($id, $params = array())
+    {
+        parent::addNodeParams($id, $params);
+    }
+
+    /**
+     * Adds column headers to the tree table.
+     *
+     * @param array $header  An array containing hashes with header
+     *                       information. The following keys are allowed:
+     * <pre>
+     * align - The alignment inside the header cell
+     * class - The CSS class of the header cell
+     * html - The HTML content of the header cell
+     * width - The width of the header cell
+     * </pre>
+     */
+    public function setHeader($header)
+    {
+        parent::setHeader($header);
+    }
+
+    /**
      * Returns the HTML code for a header row, if necessary.
      *
      * @return string  The HTML code of the header row or an empty string.