From: Michael M Slusarz Date: Mon, 23 Aug 2010 22:00:35 +0000 (-0600) Subject: Move HTML-specific code out of base Tree class X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=d4307e69e5a13f78fc9f65cab0e2305b9dd6bba7;p=horde.git Move HTML-specific code out of base Tree class --- diff --git a/framework/Tree/lib/Horde/Tree.php b/framework/Tree/lib/Horde/Tree.php index eecbead5a..6ec307374 100644 --- a/framework/Tree/lib/Horde/Tree.php +++ b/framework/Tree/lib/Horde/Tree.php @@ -144,12 +144,6 @@ class Horde_Tree implements Countable * @param string $name The name of this tree instance. * @param array $params Additional parameters. *
-     * 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:
-     * 
-     * 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
-     * 
+ * information. */ public function setHeader($header) { diff --git a/framework/Tree/lib/Horde/Tree/Html.php b/framework/Tree/lib/Horde/Tree/Html.php index 587bfe972..3b46c64f7 100644 --- a/framework/Tree/lib/Horde/Tree/Html.php +++ b/framework/Tree/lib/Horde/Tree/Html.php @@ -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: + *
+     * 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?
+     * 
+ */ + 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). + *
+     * 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
+     * 
+ */ + 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: + *
+     * 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
+     * 
+ */ + 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.