|
|
@ -1115,24 +1115,25 @@ function get_cats_and_terms($item) { |
|
|
|
if (count($categories)) $categories[count($categories)-1]['last'] = true; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$matches = false; $first = true; |
|
|
|
$cnt = preg_match_all('/\[(.*?)\]/',$item['file'],$matches,PREG_SET_ORDER); |
|
|
|
if($cnt) { |
|
|
|
foreach($matches as $mtch) { |
|
|
|
$folders[] = array( |
|
|
|
'name' => xmlify(file_tag_decode($mtch[1])), |
|
|
|
'url' => "#", |
|
|
|
'removeurl' => ((local_user() == $item['uid'])?$a->get_baseurl() . '/filerm/' . $item['id'] . '?f=&term=' . xmlify(file_tag_decode($mtch[1])):""), |
|
|
|
'first' => $first, |
|
|
|
'last' => false |
|
|
|
); |
|
|
|
$first = false; |
|
|
|
if(local_user() == $item['uid']) { |
|
|
|
$matches = false; $first = true; |
|
|
|
$cnt = preg_match_all('/\[(.*?)\]/',$item['file'],$matches,PREG_SET_ORDER); |
|
|
|
if($cnt) { |
|
|
|
foreach($matches as $mtch) { |
|
|
|
$folders[] = array( |
|
|
|
'name' => xmlify(file_tag_decode($mtch[1])), |
|
|
|
'url' => "#", |
|
|
|
'removeurl' => ((local_user() == $item['uid'])?$a->get_baseurl() . '/filerm/' . $item['id'] . '?f=&term=' . xmlify(file_tag_decode($mtch[1])):""), |
|
|
|
'first' => $first, |
|
|
|
'last' => false |
|
|
|
); |
|
|
|
$first = false; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
if (count($folders)) $folders[count($folders)-1]['last'] = true; |
|
|
|
|
|
|
|
|
|
|
|
return array($categories, $folders); |
|
|
|
} |
|
|
|
|
|
|
|