Commit ac17bf2638a62f79c9db3da338daea2099bb57bb
1 parent
fa808f3b
KTS-1687
"Double quote to single quote conversion" Fixed. Reviewed by: Kevin Fourie git-svn-id: https://kt-dms.svn.sourceforge.net/svnroot/kt-dms/trunk@6253 c91229c3-7414-0410-bfa2-8a42b809f60b
Showing
1 changed file
with
49 additions
and
49 deletions
lib/browse/DocumentCollection.inc.php
| ... | ... | @@ -24,9 +24,9 @@ |
| 24 | 24 | * |
| 25 | 25 | */ |
| 26 | 26 | |
| 27 | -require_once(KT_LIB_DIR . "/templating/templating.inc.php"); | |
| 28 | -require_once(KT_LIB_DIR . "/documentmanagement/Document.inc"); | |
| 29 | -require_once(KT_LIB_DIR . "/foldermanagement/Folder.inc"); | |
| 27 | +require_once(KT_LIB_DIR . '/templating/templating.inc.php'); | |
| 28 | +require_once(KT_LIB_DIR . '/documentmanagement/Document.inc'); | |
| 29 | +require_once(KT_LIB_DIR . '/foldermanagement/Folder.inc'); | |
| 30 | 30 | require_once(KT_LIB_DIR . '/browse/PartialQuery.inc.php'); |
| 31 | 31 | |
| 32 | 32 | class DocumentCollection { |
| ... | ... | @@ -66,7 +66,7 @@ class DocumentCollection { |
| 66 | 66 | /* initialisation */ |
| 67 | 67 | |
| 68 | 68 | function DocumentCollection() { |
| 69 | - $this->empty_message = _kt("No folders or documents in this location."); | |
| 69 | + $this->empty_message = _kt('No folders or documents in this location.'); | |
| 70 | 70 | } |
| 71 | 71 | |
| 72 | 72 | // columns should be added in the "correct" order (e.g. display order) |
| ... | ... | @@ -90,8 +90,8 @@ class DocumentCollection { |
| 90 | 90 | // FIXME affect the column based on this. |
| 91 | 91 | |
| 92 | 92 | // defaults |
| 93 | - $this->_sDocumentSortField = "DM.name"; | |
| 94 | - $this->_sFolderSortField = "F.name"; | |
| 93 | + $this->_sDocumentSortField = 'DM.name'; | |
| 94 | + $this->_sFolderSortField = 'F.name'; | |
| 95 | 95 | |
| 96 | 96 | // then we start. |
| 97 | 97 | $this->sort_column = $sSortColumn; |
| ... | ... | @@ -176,8 +176,8 @@ class DocumentCollection { |
| 176 | 176 | } |
| 177 | 177 | //var_dump($folderSet); |
| 178 | 178 | $this->activeset = array( |
| 179 | - "folders" => $folderSet, | |
| 180 | - "documents" => $documentSet, | |
| 179 | + 'folders' => $folderSet, | |
| 180 | + 'documents' => $documentSet, | |
| 181 | 181 | ); |
| 182 | 182 | } |
| 183 | 183 | |
| ... | ... | @@ -191,9 +191,9 @@ class DocumentCollection { |
| 191 | 191 | } |
| 192 | 192 | } |
| 193 | 193 | function _retrieveDocumentInfo($iDocumentId) { |
| 194 | - $row_info = array("docid" => $iDocumentId); | |
| 195 | - $row_info["type"] = "document"; | |
| 196 | - $row_info["document"] =& Document::get($iDocumentId); | |
| 194 | + $row_info = array('docid' => $iDocumentId); | |
| 195 | + $row_info['type'] = 'document'; | |
| 196 | + $row_info['document'] =& Document::get($iDocumentId); | |
| 197 | 197 | |
| 198 | 198 | return $row_info; |
| 199 | 199 | } |
| ... | ... | @@ -210,9 +210,9 @@ class DocumentCollection { |
| 210 | 210 | |
| 211 | 211 | // FIXME get more folder info. |
| 212 | 212 | function _retrieveFolderInfo($iFolderId) { |
| 213 | - $row_info = array("folderid" => $iFolderId); | |
| 214 | - $row_info["type"] = "folder"; | |
| 215 | - $row_info["folder"] =& Folder::get($iFolderId); | |
| 213 | + $row_info = array('folderid' => $iFolderId); | |
| 214 | + $row_info['type'] = 'folder'; | |
| 215 | + $row_info['folder'] =& Folder::get($iFolderId); | |
| 216 | 216 | |
| 217 | 217 | return $row_info; |
| 218 | 218 | } |
| ... | ... | @@ -221,7 +221,7 @@ class DocumentCollection { |
| 221 | 221 | function renderRow($iDocumentId) { ; } |
| 222 | 222 | // link url for a particular page. |
| 223 | 223 | function pageLink($iPageNumber) { |
| 224 | - return $this->returnURL . "&page=" . $iPageNumber . "&sort_on=" . $this->sort_column . "&sort_order=" . $this->sort_order; | |
| 224 | + return $this->returnURL . '&page=' . $iPageNumber . '&sort_on=' . $this->sort_column . '&sort_order=' . $this->sort_order; | |
| 225 | 225 | } |
| 226 | 226 | |
| 227 | 227 | function render() { |
| ... | ... | @@ -233,13 +233,13 @@ class DocumentCollection { |
| 233 | 233 | // FIXME expose the current set of rows to the document. |
| 234 | 234 | |
| 235 | 235 | $oTemplating =& KTTemplating::getSingleton(); |
| 236 | - $oTemplate = $oTemplating->loadTemplate("kt3/document_collection"); | |
| 236 | + $oTemplate = $oTemplating->loadTemplate('kt3/document_collection'); | |
| 237 | 237 | $aTemplateData = array( |
| 238 | - "context" => $this, | |
| 239 | - "pagecount" => $pagecount, | |
| 240 | - "currentpage" => $this->batchPage, | |
| 241 | - "returnURL" => $this->returnURL, | |
| 242 | - "columncount" => count($this->columns), | |
| 238 | + 'context' => $this, | |
| 239 | + 'pagecount' => $pagecount, | |
| 240 | + 'currentpage' => $this->batchPage, | |
| 241 | + 'returnURL' => $this->returnURL, | |
| 242 | + 'columncount' => count($this->columns), | |
| 243 | 243 | ); |
| 244 | 244 | |
| 245 | 245 | // in order to allow OTHER things than batch to move us around, we do: |
| ... | ... | @@ -311,7 +311,7 @@ class AdvancedCollection { |
| 311 | 311 | $this->is_browse = KTUtil::arrayGet($aOptions, 'is_browse', false); |
| 312 | 312 | |
| 313 | 313 | // sorting |
| 314 | - $this->sort_column = KTUtil::arrayGet($aOptions, 'sort_on', "ktcore.columns.title"); | |
| 314 | + $this->sort_column = KTUtil::arrayGet($aOptions, 'sort_on', 'ktcore.columns.title'); | |
| 315 | 315 | $this->sort_order = KTUtil::arrayGet($aOptions, 'sort_order', 'asc'); |
| 316 | 316 | |
| 317 | 317 | // url options |
| ... | ... | @@ -321,7 +321,7 @@ class AdvancedCollection { |
| 321 | 321 | } |
| 322 | 322 | $this->returnURL = $sURL; |
| 323 | 323 | |
| 324 | - $this->empty_message = KTUtil::arrayGet($aOptions, 'empty_message', _kt("No folders or documents in this location.")); | |
| 324 | + $this->empty_message = KTUtil::arrayGet($aOptions, 'empty_message', _kt('No folders or documents in this location.')); | |
| 325 | 325 | } |
| 326 | 326 | |
| 327 | 327 | |
| ... | ... | @@ -331,10 +331,10 @@ class AdvancedCollection { |
| 331 | 331 | $aNewOptions = array(); |
| 332 | 332 | |
| 333 | 333 | // batching |
| 334 | - $aNewOptions['batch_page'] = (int) KTUtil::arrayGet($_REQUEST, "page", 0); | |
| 334 | + $aNewOptions['batch_page'] = (int) KTUtil::arrayGet($_REQUEST, 'page', 0); | |
| 335 | 335 | |
| 336 | 336 | // evil with cookies. |
| 337 | - $batch_size = KTUtil::arrayGet($_REQUEST, "page_size"); | |
| 337 | + $batch_size = KTUtil::arrayGet($_REQUEST, 'page_size'); | |
| 338 | 338 | if (empty($batch_size)) { |
| 339 | 339 | // try for a cookie |
| 340 | 340 | $batch_size = KTUtil::arrayGet($_COOKIE, '__kt_batch_size', 25); |
| ... | ... | @@ -344,9 +344,9 @@ class AdvancedCollection { |
| 344 | 344 | $aNewOptions['batch_size'] = (int) $batch_size; |
| 345 | 345 | |
| 346 | 346 | // ordering. (direction and column) |
| 347 | - $aNewOptions['sort_on'] = KTUtil::arrayGet($_REQUEST, 'sort_on', "ktcore.columns.title"); | |
| 348 | - $displayOrder = KTUtil::arrayGet($_REQUEST, 'sort_order', "asc"); | |
| 349 | - if ($displayOrder !== "asc") { $displayOrder = "desc"; } | |
| 347 | + $aNewOptions['sort_on'] = KTUtil::arrayGet($_REQUEST, 'sort_on', 'ktcore.columns.title'); | |
| 348 | + $displayOrder = KTUtil::arrayGet($_REQUEST, 'sort_order', 'asc'); | |
| 349 | + if ($displayOrder !== 'asc') { $displayOrder = 'desc'; } | |
| 350 | 350 | $aNewOptions['sort_order'] = $displayOrder; |
| 351 | 351 | |
| 352 | 352 | // probably URL |
| ... | ... | @@ -383,8 +383,8 @@ class AdvancedCollection { |
| 383 | 383 | $this->_sorted = true; |
| 384 | 384 | |
| 385 | 385 | // defaults |
| 386 | - $this->_sDocumentSortField = "DM.name"; | |
| 387 | - $this->_sFolderSortField = "F.name"; | |
| 386 | + $this->_sDocumentSortField = 'DM.name'; | |
| 387 | + $this->_sFolderSortField = 'F.name'; | |
| 388 | 388 | |
| 389 | 389 | foreach ($this->columns as $key => $oColumn) { |
| 390 | 390 | if ($oColumn->namespace == $this->sort_column) { |
| ... | ... | @@ -501,13 +501,13 @@ class AdvancedCollection { |
| 501 | 501 | } |
| 502 | 502 | |
| 503 | 503 | if (PEAR::isError($folderSet)) { |
| 504 | - $_SESSION['KTErrorMessage'][] = sprintf(_kt("Failed to retrieve folders: %s"), $folderSet->getMessage()); | |
| 504 | + $_SESSION['KTErrorMessage'][] = sprintf(_kt('Failed to retrieve folders: %s'), $folderSet->getMessage()); | |
| 505 | 505 | $folderSet = array(); |
| 506 | 506 | $this->folderCount = 0; |
| 507 | 507 | } |
| 508 | 508 | |
| 509 | 509 | if (PEAR::isError($documentSet)) { |
| 510 | - $_SESSION['KTErrorMessage'][] = sprintf(_kt("Failed to retrieve documents: %s"), $documentSet->getMessage()); | |
| 510 | + $_SESSION['KTErrorMessage'][] = sprintf(_kt('Failed to retrieve documents: %s'), $documentSet->getMessage()); | |
| 511 | 511 | //var_dump($documentSet); exit(0); |
| 512 | 512 | $documentSet = array(); |
| 513 | 513 | $this->documentCount = 0; |
| ... | ... | @@ -517,8 +517,8 @@ class AdvancedCollection { |
| 517 | 517 | $this->itemCount = $this->documentCount + $this->folderCount; |
| 518 | 518 | |
| 519 | 519 | $this->activeset = array( |
| 520 | - "folders" => $folderSet, | |
| 521 | - "documents" => $documentSet, | |
| 520 | + 'folders' => $folderSet, | |
| 521 | + 'documents' => $documentSet, | |
| 522 | 522 | ); |
| 523 | 523 | |
| 524 | 524 | $this->_gotInfo = true; // don't do this twice ... |
| ... | ... | @@ -535,9 +535,9 @@ class AdvancedCollection { |
| 535 | 535 | } |
| 536 | 536 | |
| 537 | 537 | function _retrieveDocumentInfo($iDocumentId) { |
| 538 | - $row_info = array("docid" => $iDocumentId); | |
| 539 | - $row_info["type"] = "document"; | |
| 540 | - $row_info["document"] =& Document::get($iDocumentId); | |
| 538 | + $row_info = array('docid' => $iDocumentId); | |
| 539 | + $row_info['type'] = 'document'; | |
| 540 | + $row_info['document'] =& Document::get($iDocumentId); | |
| 541 | 541 | return $row_info; |
| 542 | 542 | } |
| 543 | 543 | |
| ... | ... | @@ -553,9 +553,9 @@ class AdvancedCollection { |
| 553 | 553 | |
| 554 | 554 | // FIXME get more folder info. |
| 555 | 555 | function _retrieveFolderInfo($iFolderId) { |
| 556 | - $row_info = array("folderid" => $iFolderId); | |
| 557 | - $row_info["type"] = "folder"; | |
| 558 | - $row_info["folder"] =& Folder::get($iFolderId); | |
| 556 | + $row_info = array('folderid' => $iFolderId); | |
| 557 | + $row_info['type'] = 'folder'; | |
| 558 | + $row_info['folder'] =& Folder::get($iFolderId); | |
| 559 | 559 | |
| 560 | 560 | return $row_info; |
| 561 | 561 | } |
| ... | ... | @@ -565,7 +565,7 @@ class AdvancedCollection { |
| 565 | 565 | |
| 566 | 566 | // link url for a particular page. |
| 567 | 567 | function pageLink($iPageNumber) { |
| 568 | - $qs = sprintf("page=%s&sort_on=%s&sort_order=%s", $iPageNumber, $this->sort_column, $this->sort_order); | |
| 568 | + $qs = sprintf('page=%s&sort_on=%s&sort_order=%s', $iPageNumber, $this->sort_column, $this->sort_order); | |
| 569 | 569 | return KTUtil::addQueryString($this->returnURL, $qs); |
| 570 | 570 | } |
| 571 | 571 | |
| ... | ... | @@ -588,17 +588,17 @@ class AdvancedCollection { |
| 588 | 588 | |
| 589 | 589 | // ick. |
| 590 | 590 | global $main; |
| 591 | - $main->requireJSResource("resources/js/browsehelper.js"); | |
| 591 | + $main->requireJSResource('resources/js/browsehelper.js'); | |
| 592 | 592 | |
| 593 | 593 | $oTemplating =& KTTemplating::getSingleton(); |
| 594 | - $oTemplate = $oTemplating->loadTemplate("kt3/document_collection"); | |
| 594 | + $oTemplate = $oTemplating->loadTemplate('kt3/document_collection'); | |
| 595 | 595 | $aTemplateData = array( |
| 596 | - "context" => $this, | |
| 597 | - "pagecount" => $pagecount, | |
| 598 | - "currentpage" => $this->batchPage, | |
| 599 | - "returnURL" => $this->returnURL, | |
| 600 | - "columncount" => count($this->columns), | |
| 601 | - "bIsBrowseCollection" => $this->is_browse, | |
| 596 | + 'context' => $this, | |
| 597 | + 'pagecount' => $pagecount, | |
| 598 | + 'currentpage' => $this->batchPage, | |
| 599 | + 'returnURL' => $this->returnURL, | |
| 600 | + 'columncount' => count($this->columns), | |
| 601 | + 'bIsBrowseCollection' => $this->is_browse, | |
| 602 | 602 | 'batch_size' => $this->batchSize, |
| 603 | 603 | ); |
| 604 | 604 | ... | ... |