diff --git a/ktapi/KTAPIFolder.inc.php b/ktapi/KTAPIFolder.inc.php index b0e4fec..6e0976f 100644 --- a/ktapi/KTAPIFolder.inc.php +++ b/ktapi/KTAPIFolder.inc.php @@ -5,7 +5,7 @@ * KnowledgeTree Community Edition * Document Management Made Simple * Copyright (C) 2008, 2009 KnowledgeTree Inc. - * + * * * This program is free software; you can redistribute it and/or modify it under * the terms of the GNU General Public License version 3 as published by the @@ -227,7 +227,7 @@ class KTAPI_Folder extends KTAPI_FolderItem return $detail; } - + /** * This clears the global object cache of the folder class. * @@ -545,7 +545,8 @@ class KTAPI_Folder extends KTAPI_FolderItem if (strpos($what,'F') !== false) { - $folder_children = Folder::getList(array('parent_id = ?', $this->folderid)); + $aOptions['orderby'] = 'name'; + $folder_children = Folder::getList(array('parent_id = ?', $this->folderid), $aOptions); foreach ($folder_children as $folder) { @@ -798,7 +799,7 @@ class KTAPI_Folder extends KTAPI_FolderItem return $contents; } - + /** * Get's a folder listing, recursing to the maximum depth. * Derived from the get_listing function. @@ -836,7 +837,8 @@ class KTAPI_Folder extends KTAPI_FolderItem if (strpos($what,'F') !== false) { - $folder_children = Folder::getList(array('parent_id = ?', $this->folderid)); + $aOptions['orderby'] = 'name'; + $folder_children = Folder::getList(array('parent_id = ?', $this->folderid), $aOptions); foreach ($folder_children as $folder) { @@ -903,9 +905,9 @@ class KTAPI_Folder extends KTAPI_FolderItem $array['item_type'] = "S"; } } - + $array['items']=$items; - if($wsversion<3 || (strpos($what,'F') !== false && !$folder->isSymbolicLink()) || + if($wsversion<3 || (strpos($what,'F') !== false && !$folder->isSymbolicLink()) || ($folder->isSymbolicLink() && strpos($what,'S') !== false)) { $contents[] = $array; }