diff --git a/browse.php b/browse.php index c78a185..a1174f2 100755 --- a/browse.php +++ b/browse.php @@ -234,7 +234,7 @@ class BrowseDispatcher extends KTStandardDispatcher { $collection->setColumnOptions('ktcore.columns.selection', array( 'rangename' => 'selection', 'show_folders' => true, - 'show_document' => true, + 'show_documents' => true, )); $oTemplating =& KTTemplating::getSingleton(); diff --git a/lib/browse/DocumentCollection.inc.php b/lib/browse/DocumentCollection.inc.php index 61d6342..17159b4 100644 --- a/lib/browse/DocumentCollection.inc.php +++ b/lib/browse/DocumentCollection.inc.php @@ -304,15 +304,15 @@ class AdvancedCollection { $this->batchStart = $this->batchPage * $this->batchSize; // visibility - $this->bShowFolders = KTUtil::arrayGet($aOptions, 'show_folders', true); - $this->bShowDocuments = KTUtil::arrayGet($aOptions, 'show_documents', true); + $this->bShowFolders = KTUtil::arrayGet($aOptions, 'show_folders', true, false); + $this->bShowDocuments = KTUtil::arrayGet($aOptions, 'show_documents', true, false); // sorting $this->sort_column = KTUtil::arrayGet($aOptions, 'sort_on', "ktcore.columns.title"); $this->sort_order = KTUtil::arrayGet($aOptions, 'sort_order', 'asc'); // url options - $this->returnURL = KTUtil::arrayGet($aOptions, 'return_url', $_SERVER['PHP_SELF']); + $this->returnURL = KTUtil::arrayGet($aOptions, 'result_url', $_SERVER['PHP_SELF']); $this->empty_message = KTUtil::arrayGet($aOptions, 'empty_message', _kt("No folders or documents in this location.")); } @@ -431,7 +431,11 @@ class AdvancedCollection { // assume we have not documents. This impacts "where" our documents start. // $no_folders = true; - $documents_to_get = $this->batchSize; + if ($this->bShowDocuments) { + $documents_to_get = $this->batchSize; + } else { + $documents_to_get = 0; + } $folders_to_get = 0; if ($this->batchStart < $this->folderCount) { diff --git a/plugins/ktcore/KTColumns.inc.php b/plugins/ktcore/KTColumns.inc.php index 274cedb..630b429 100644 --- a/plugins/ktcore/KTColumns.inc.php +++ b/plugins/ktcore/KTColumns.inc.php @@ -59,7 +59,12 @@ class AdvancedTitleColumn extends AdvancedColumn { function buildFolderLink($aDataRow) { if (is_null(KTUtil::arrayGet($this->aOptions, 'direct_folder'))) { - return KTUtil::addQueryStringSelf('fFolderId='.$aDataRow["folder"]->getId()); + $dest = KTUtil::arrayGet($this->aOptions, 'folder_link'); + if (empty($dest)) { + return KTUtil::addQueryStringSelf('fFolderId='.$aDataRow["folder"]->getId()); + } else { + return KTUtil::addQueryString($dest, 'fFolderId='.$aDataRow["folder"]->getId()); + } } else { return KTBrowseUtil::getUrlForFolder($aDataRow['folder']); } @@ -244,8 +249,8 @@ class AdvancedSelectionColumn extends AdvancedColumn { function setOptions($aOptions) { AdvancedColumn::setOptions($aOptions); $this->rangename = KTUtil::arrayGet($this->aOptions, 'rangename', $this->rangename); - $this->show_folders = KTUtil::arrayGet($this->aOptions, 'show_folders', $this->show_folders); - $this->show_documents = KTUtil::arrayGet($this->aOptions, 'show_documents', $this->show_documents); + $this->show_folders = KTUtil::arrayGet($this->aOptions, 'show_folders', $this->show_folders, false); + $this->show_documents = KTUtil::arrayGet($this->aOptions, 'show_documents', $this->show_documents, false); } function renderHeader($sReturnURL) { @@ -299,7 +304,7 @@ class AdvancedSingleSelectionColumn extends AdvancedSelectionColumn { // only include the _f or _d IF WE HAVE THE OTHER TYPE. function renderData($aDataRow) { - $localname = $this->name; + $localname = $this->rangename; if (($aDataRow["type"] === "folder") && ($this->show_folders)) { if ($this->show_documents) {