From a56bf4c1eaf5d33c5097d56676c93f7e816237d9 Mon Sep 17 00:00:00 2001
From: Ere Maijala <ere.maijala@helsinki.fi>
Date: Thu, 23 Apr 2015 09:33:23 -0400
Subject: [PATCH] Separated public and protected methods.

---
 .../VuFind/Hierarchy/TreeRenderer/JSTree.php  | 94 +++++++++----------
 1 file changed, 47 insertions(+), 47 deletions(-)

diff --git a/module/VuFind/src/VuFind/Hierarchy/TreeRenderer/JSTree.php b/module/VuFind/src/VuFind/Hierarchy/TreeRenderer/JSTree.php
index 0b697eb7e00..eec0d74e2a3 100644
--- a/module/VuFind/src/VuFind/Hierarchy/TreeRenderer/JSTree.php
+++ b/module/VuFind/src/VuFind/Hierarchy/TreeRenderer/JSTree.php
@@ -138,53 +138,6 @@ class JSTree extends AbstractBase
         return false;
     }
 
-    /**
-     * Convert JSTree JSON structure to HTML
-     *
-     * @param object $node        JSON object of a the JSTree
-     * @param string $context     Record or Collection
-     * @param string $hierarchyID Collection ID
-     * @param string $recordID    The currently active record
-     *
-     * @return string
-     */
-    protected function jsonToHTML($node, $context, $hierarchyID, $recordID = false)
-    {
-        $escaper = new \Zend\Escaper\Escaper('utf-8');
-
-        $name = strlen($node->title) > 100
-            ? substr($node->title, 0, 100) . '...'
-            : $node->title;
-        $href = $this->getContextualUrl($node, $context, $hierarchyID);
-        $icon = $node->type == 'record' ? 'file-o' : 'folder-open';
-
-        $html = '<li';
-        if ($node->type == 'collection') {
-            $html .= ' class="hierarchy';
-            if ($recordID && $recordID == $node->id) {
-                $html .= ' currentHierarchy';
-            }
-            $html .= '"';
-        } elseif ($recordID && $recordID == $node->id) {
-            $html .= ' class="currentRecord"';
-        }
-        $html .= '><i class="fa fa-li fa-' . $icon . '"></i> '
-            . '<a name="tree-' . $escaper->escapeHtmlAttr($node->id) . '" href="'
-            . $escaper->escapeHtmlAttr($href) . '" title="'
-            . $escaper->escapeHtml($node->title) . '">'
-            . $escaper->escapeHtml($name) . '</a>';
-        if (isset($node->children)) {
-            $html .= '<ul class="fa-ul">';
-            foreach ($node->children as $child) {
-                $html .= $this->jsonToHTML(
-                    $child, $context, $hierarchyID, $recordID
-                );
-            }
-            $html .= '</ul>';
-        }
-        return $html . '</li>';
-    }
-
     /**
      * Render the Hierarchy Tree
      *
@@ -270,6 +223,53 @@ class JSTree extends AbstractBase
         }
     }
 
+    /**
+     * Convert JSTree JSON structure to HTML
+     *
+     * @param object $node        JSON object of a the JSTree
+     * @param string $context     Record or Collection
+     * @param string $hierarchyID Collection ID
+     * @param string $recordID    The currently active record
+     *
+     * @return string
+     */
+    protected function jsonToHTML($node, $context, $hierarchyID, $recordID = false)
+    {
+        $escaper = new \Zend\Escaper\Escaper('utf-8');
+
+        $name = strlen($node->title) > 100
+            ? substr($node->title, 0, 100) . '...'
+            : $node->title;
+        $href = $this->getContextualUrl($node, $context, $hierarchyID);
+        $icon = $node->type == 'record' ? 'file-o' : 'folder-open';
+
+        $html = '<li';
+        if ($node->type == 'collection') {
+            $html .= ' class="hierarchy';
+            if ($recordID && $recordID == $node->id) {
+                $html .= ' currentHierarchy';
+            }
+            $html .= '"';
+        } elseif ($recordID && $recordID == $node->id) {
+            $html .= ' class="currentRecord"';
+        }
+        $html .= '><i class="fa fa-li fa-' . $icon . '"></i> '
+            . '<a name="tree-' . $escaper->escapeHtmlAttr($node->id) . '" href="'
+            . $escaper->escapeHtmlAttr($href) . '" title="'
+            . $escaper->escapeHtml($node->title) . '">'
+            . $escaper->escapeHtml($name) . '</a>';
+        if (isset($node->children)) {
+            $html .= '<ul class="fa-ul">';
+            foreach ($node->children as $child) {
+                $html .= $this->jsonToHTML(
+                    $child, $context, $hierarchyID, $recordID
+                );
+            }
+            $html .= '</ul>';
+        }
+        return $html . '</li>';
+    }
+
     /**
      * Transforms Collection XML to Desired Format
      *
-- 
GitLab