]> gitweb.fluxo.info Git - semanticscuttle.git/commitdiff
give admin tags a link href :)
authorChristian Weiske <cweiske@cweiske.de>
Thu, 7 Oct 2010 16:59:27 +0000 (18:59 +0200)
committerChristian Weiske <cweiske@cweiske.de>
Thu, 7 Oct 2010 16:59:27 +0000 (18:59 +0200)
src/SemanticScuttle/constants.php
www/ajax/getadminlinkedtags.php

index 95c4384379ff151c0fb8ea398db02b1cd05c1e24..aebc0599f6919b4caf7d57626a485e24003470f0 100644 (file)
@@ -17,7 +17,9 @@ if (!isset($GLOBALS['root'])) {
        $rootTmp = '/';
        foreach ($pieces as $piece) {
                //we eliminate possible sscuttle subfolders (like gsearch for example)
-               if ($piece != '' && !strstr($piece, '.php') && $piece != 'gsearch') {
+        if ($piece != '' && !strstr($piece, '.php')
+            && $piece != 'gsearch' && $piece != 'ajax'
+        ) {
                        $rootTmp .= $piece .'/';
                }
        }
index 5581c43e17a9cb88f3851848f1b8bdd9e36dcda9..1004f29267283ede3d551ea11d013a94eb24e7c2 100644 (file)
@@ -41,11 +41,28 @@ function assembleTagData($tag, SemanticScuttle_Service_Tag2Tag $t2t)
        return $tagData;
 }
 
+/**
+ * Creates an jsTree json array for the given tag
+ *
+ * @param string  $tag         Tag name
+ * @param boolean $hasChildren If the tag has subtags (children) or not
+ *
+ * @return array Array to be sent back to the browser as json
+ */
 function createTagArray($tag, $hasChildren = true)
 {
     $ar = array(
-        'data' => $tag,
-        'attr' => array('rel' => $tag),
+        'data' => array(
+            //<a> attributes
+            'title' => $tag,
+            'attr' => array(
+                'href' => createUrl('tags', $tag)
+            )
+        ),
+        //<li> attributes
+        'attr' => array(
+            'rel'  => $tag,//needed for identifying the tag in html
+        ),
     );
     if ($hasChildren) {
         //jstree needs that to show the arrows