give admin tags a link href :)

This commit is contained in:
Christian Weiske 2010-10-07 18:59:27 +02:00
parent 24e344f787
commit b812deefa1
2 changed files with 22 additions and 3 deletions

View 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 .'/';
}
}

View 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