Commit 099af5d24f2df3f21aa003ae3e7cdf397d6ea285
1 parent
d71619f9
Folder ID now return with search results. Added function to get folder path
Committed by: Tohir Solomons
Showing
1 changed file
with
29 additions
and
1 deletions
webservice/clienttools/services/0.9/kt.php
| ... | ... | @@ -263,7 +263,7 @@ class kt extends client_service { |
| 263 | 263 | if ($item ['filesize'] == 'n/a') { |
| 264 | 264 | $item ['filesize'] = - 1; |
| 265 | 265 | } |
| 266 | - return array ('text' => htmlspecialchars ( $item ['title'] ), 'originaltext' => $item ['title'], 'id' => $item ['document_id'], 'filename' => $item ['filename'], 'cls' => $class, 'leaf' => true, 'document_type' => $item ['document_type'], 'item_type' => 'D', 'permissions' => $item ['permissions'], 'content_id' => $item ['content_id'], 'filesize' => $item ['filesize'], 'modified' => $item ['modified_date'], 'created_date' => $item ['created_date'], 'checked_out_by' => $item ['checked_out_by'], 'relevance' => $item ['relevance'], 'qtip' => $qtip, 'version' => $item ['version'], 'is_immutable' => $item ['is_immutable'] ); | |
| 266 | + return array ('text' => htmlspecialchars ( $item ['title'] ), 'originaltext' => $item ['title'], 'id' => $item ['document_id'], 'filename' => $item ['filename'], 'cls' => $class, 'leaf' => true, 'document_type' => $item ['document_type'], 'item_type' => 'D', 'permissions' => $item ['permissions'], 'content_id' => $item ['content_id'], 'filesize' => $item ['filesize'], 'modified' => $item ['modified_date'], 'created_date' => $item ['created_date'], 'checked_out_by' => $item ['checked_out_by'], 'relevance' => $item ['relevance'], 'qtip' => $qtip, 'version' => $item ['version'], 'is_immutable' => $item ['is_immutable'], 'folder_id' => $item['folder_id'] ); | |
| 267 | 267 | } |
| 268 | 268 | |
| 269 | 269 | private function _processItemInclusion_grid($item, $class, $qtip) { |
| ... | ... | @@ -1431,6 +1431,34 @@ Fatal error: Cannot unset string offsets in on line 981 |
| 1431 | 1431 | } |
| 1432 | 1432 | |
| 1433 | 1433 | |
| 1434 | + function get_folder_path($arr) | |
| 1435 | + { | |
| 1436 | + $kt=&$this->KT; | |
| 1437 | + | |
| 1438 | + $folderObj = &$kt->get_folder_by_id ( $arr ['folderId'] ); | |
| 1439 | + if (PEAR::isError ( $folderObj )) { | |
| 1440 | + $this->setError ( "Could not get folder by Id: {$arr['folderId']}" ); | |
| 1441 | + $this->setDebug ( 'FolderError', array ('kt' => $kt, 'folder' => $folderObj ) ); | |
| 1442 | + return false; | |
| 1443 | + } | |
| 1444 | + | |
| 1445 | + $parentIds = explode(',', $folderObj->getParentFolderIds()); | |
| 1446 | + $path = '/F_0'; | |
| 1447 | + | |
| 1448 | + if (count($parentIds) > 0 && $folderObj->getParentFolderIds() != '') { | |
| 1449 | + foreach ($parentIds as $parentId) | |
| 1450 | + { | |
| 1451 | + $path .= '/F_'.$parentId; | |
| 1452 | + } | |
| 1453 | + } | |
| 1454 | + | |
| 1455 | + $path .= '/F_'.$folderObj->folderid; | |
| 1456 | + | |
| 1457 | + | |
| 1458 | + $this->setResponse ( array ('status_code' => 0, 'folderPath' => $path ) ); | |
| 1459 | + } | |
| 1460 | + | |
| 1461 | + | |
| 1434 | 1462 | |
| 1435 | 1463 | |
| 1436 | 1464 | } | ... | ... |