diff options
author | Christian Weiske <cweiske@cweiske.de> | 2010-10-07 18:59:27 +0200 |
---|---|---|
committer | Christian Weiske <cweiske@cweiske.de> | 2010-10-07 18:59:27 +0200 |
commit | b812deefa1ab85c542c13dc97432ca2fe90958f1 (patch) | |
tree | 166c078fa8691ab652b1438c9b03eaebb38a349f /www/ajax | |
parent | 24e344f7879a932cc9a5a3491d460a05651c08a3 (diff) | |
download | semanticscuttle-b812deefa1ab85c542c13dc97432ca2fe90958f1.tar.gz semanticscuttle-b812deefa1ab85c542c13dc97432ca2fe90958f1.tar.bz2 |
give admin tags a link href :)
Diffstat (limited to 'www/ajax')
-rw-r--r-- | www/ajax/getadminlinkedtags.php | 21 |
1 files changed, 19 insertions, 2 deletions
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( + //<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 |