From b812deefa1ab85c542c13dc97432ca2fe90958f1 Mon Sep 17 00:00:00 2001 From: Christian Weiske Date: Thu, 7 Oct 2010 18:59:27 +0200 Subject: give admin tags a link href :) --- src/SemanticScuttle/constants.php | 4 +++- www/ajax/getadminlinkedtags.php | 21 +++++++++++++++++++-- 2 files changed, 22 insertions(+), 3 deletions(-) diff --git a/src/SemanticScuttle/constants.php b/src/SemanticScuttle/constants.php index 95c4384..aebc059 100644 --- a/src/SemanticScuttle/constants.php +++ b/src/SemanticScuttle/constants.php @@ -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 .'/'; } } diff --git a/www/ajax/getadminlinkedtags.php b/www/ajax/getadminlinkedtags.php index 5581c43..1004f29 100644 --- a/www/ajax/getadminlinkedtags.php +++ b/www/ajax/getadminlinkedtags.php @@ -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( + // attributes + 'title' => $tag, + 'attr' => array( + 'href' => createUrl('tags', $tag) + ) + ), + //
  • attributes + 'attr' => array( + 'rel' => $tag,//needed for identifying the tag in html + ), ); if ($hasChildren) { //jstree needs that to show the arrows -- cgit v1.2.3