give admin tags a link href :)
This commit is contained in:
parent
24e344f787
commit
b812deefa1
2 changed files with 22 additions and 3 deletions
|
@ -17,7 +17,9 @@ if (!isset($GLOBALS['root'])) {
|
||||||
$rootTmp = '/';
|
$rootTmp = '/';
|
||||||
foreach ($pieces as $piece) {
|
foreach ($pieces as $piece) {
|
||||||
//we eliminate possible sscuttle subfolders (like gsearch for example)
|
//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 .'/';
|
$rootTmp .= $piece .'/';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -41,11 +41,28 @@ function assembleTagData($tag, SemanticScuttle_Service_Tag2Tag $t2t)
|
||||||
return $tagData;
|
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)
|
function createTagArray($tag, $hasChildren = true)
|
||||||
{
|
{
|
||||||
$ar = array(
|
$ar = array(
|
||||||
'data' => $tag,
|
'data' => array(
|
||||||
'attr' => array('rel' => $tag),
|
//<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) {
|
if ($hasChildren) {
|
||||||
//jstree needs that to show the arrows
|
//jstree needs that to show the arrows
|
||||||
|
|
Loading…
Reference in a new issue