Ver Fonte

Zasoby Tree: fix alias path info

Piotr Labudda há 10 anos atrás
pai
commit
6bf4902473
1 ficheiros alterados com 8 adições e 2 exclusões
  1. 8 2
      SE/procesy/ajax.php

+ 8 - 2
SE/procesy/ajax.php

@@ -39,12 +39,18 @@ SQL;
 			$outLines[] = '<span title="'.$outTitle.'">'.$outLabel.'</span>';
 		}
 		if (!empty($info->PATH)) {
-			$outLines[] = 'Ścieżka: ' . $info->PATH;
+			$outPaths = array();
+			$paths = explode(',', $info->PATH);
+			foreach ($paths as $path) {
+				$js = "return treeAddToFiltr(this, {$path});";
+				$outPaths[] = '<a href="#" onclick="' . $js . '">' . $path . '</a>';
+			}
+			$outLines[] = 'Ścieżka: ' . implode(', ', $outPaths);
 		}
 		if (!empty($info->CHILDS)) {
 			$outChilds = array();
 			$childs = explode(',', $info->CHILDS);
-			foreach($childs as $child) {
+			foreach ($childs as $child) {
 				$js = "return treeAddToFiltr(this, {$child});";
 				$outChilds[] = '<a href="#" onclick="' . $js . '">' . $child . '</a>';
 			}