Commit 8ce653527f572910e3599c8bfcc0e6259a015231
1 parent
ade872da
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@6242 c91229c3-7414-0410-bfa2-8a42b809f60b
Showing
1 changed file
with
48 additions
and
48 deletions
lib/browse/BrowseColumns.inc.php
| ... | ... | @@ -36,7 +36,7 @@ |
| 36 | 36 | * renderData returns the _content_ of the body row. |
| 37 | 37 | */ |
| 38 | 38 | |
| 39 | -require_once(KT_LIB_DIR . "/database/dbutil.inc"); | |
| 39 | +require_once(KT_LIB_DIR . '/database/dbutil.inc'); | |
| 40 | 40 | require_once(KT_LIB_DIR . '/users/User.inc'); |
| 41 | 41 | |
| 42 | 42 | require_once(KT_LIB_DIR . '/workflow/workflowutil.inc.php'); |
| ... | ... | @@ -46,8 +46,8 @@ require_once(KT_LIB_DIR . '/browse/browseutil.inc.php'); |
| 46 | 46 | class BrowseColumn { |
| 47 | 47 | var $label = null; |
| 48 | 48 | var $sort_on = false; |
| 49 | - var $sort_direction = "asc"; | |
| 50 | - var $name = "-"; | |
| 49 | + var $sort_direction = 'asc'; | |
| 50 | + var $name = '-'; | |
| 51 | 51 | |
| 52 | 52 | function BrowseColumn($sLabel, $sName) { |
| 53 | 53 | $this->label = $sLabel; |
| ... | ... | @@ -55,22 +55,22 @@ class BrowseColumn { |
| 55 | 55 | } |
| 56 | 56 | // FIXME is it _really_ worth using a template here? |
| 57 | 57 | function renderHeader($sReturnURL) { |
| 58 | - $text = _kt("Abstract") . ": " . $this->label; | |
| 59 | - $href = $sReturnURL . "&sort_on=" . $this->name . "&sort_order="; | |
| 58 | + $text = _kt('Abstract') . ': ' . $this->label; | |
| 59 | + $href = $sReturnURL . '&sort_on=' . $this->name . '&sort_order='; | |
| 60 | 60 | if ($this->sort_on) { |
| 61 | - $href .= $this->sort_direction == "asc" ? "desc" : "asc" ; | |
| 61 | + $href .= $this->sort_direction == 'asc' ? 'desc' : 'asc' ; | |
| 62 | 62 | } else { |
| 63 | - $href .= $this->sort_direction = "asc"; | |
| 63 | + $href .= $this->sort_direction = 'asc'; | |
| 64 | 64 | } |
| 65 | 65 | |
| 66 | 66 | return '<a href="' . $href . '">'.$text.'</a>'; |
| 67 | 67 | } |
| 68 | 68 | |
| 69 | 69 | function renderData($aDataRow) { |
| 70 | - if ($aDataRow["type"] == "folder") { | |
| 71 | - return $this->name . ": ". print_r($aDataRow["folder"]->getName(), true); | |
| 70 | + if ($aDataRow['type'] == 'folder') { | |
| 71 | + return $this->name . ': '. print_r($aDataRow['folder']->getName(), true); | |
| 72 | 72 | } else { |
| 73 | - return $this->name . ": ". print_r($aDataRow["document"]->getName(), true); | |
| 73 | + return $this->name . ': '. print_r($aDataRow['document']->getName(), true); | |
| 74 | 74 | } |
| 75 | 75 | } |
| 76 | 76 | function setSortedOn($bIsSortedOn) { $this->sort_on = $bIsSortedOn; } |
| ... | ... | @@ -91,12 +91,12 @@ class TitleColumn extends BrowseColumn { |
| 91 | 91 | } |
| 92 | 92 | // unlike others, this DOESN'T give its name. |
| 93 | 93 | function renderHeader($sReturnURL) { |
| 94 | - $text = _kt("Title"); | |
| 95 | - $href = $sReturnURL . "&sort_on=" . $this->name . "&sort_order="; | |
| 94 | + $text = _kt('Title'); | |
| 95 | + $href = $sReturnURL . '&sort_on=' . $this->name . '&sort_order='; | |
| 96 | 96 | if ($this->sort_on) { |
| 97 | - $href .= $this->sort_direction == "asc" ? "desc" : "asc" ; | |
| 97 | + $href .= $this->sort_direction == 'asc' ? 'desc' : 'asc' ; | |
| 98 | 98 | } else { |
| 99 | - $href .= $this->sort_direction = "asc"; | |
| 99 | + $href .= $this->sort_direction = 'asc'; | |
| 100 | 100 | } |
| 101 | 101 | |
| 102 | 102 | return '<a href="' . $href . '">'.$text.'</a>'; |
| ... | ... | @@ -105,25 +105,25 @@ class TitleColumn extends BrowseColumn { |
| 105 | 105 | |
| 106 | 106 | function renderFolderLink($aDataRow) { |
| 107 | 107 | $outStr = '<a href="' . $this->buildFolderLink($aDataRow) . '">'; |
| 108 | - $outStr .= htmlentities($aDataRow["folder"]->getName(), ENT_NOQUOTES, 'UTF-8'); | |
| 108 | + $outStr .= htmlentities($aDataRow['folder']->getName(), ENT_NOQUOTES, 'UTF-8'); | |
| 109 | 109 | $outStr .= '</a> '; |
| 110 | 110 | return $outStr; |
| 111 | 111 | } |
| 112 | 112 | |
| 113 | 113 | function renderDocumentLink($aDataRow) { |
| 114 | - $outStr = '<a href="' . $this->buildDocumentLink($aDataRow) . '" title="' . $aDataRow["document"]->getFilename().'">'; | |
| 115 | - $outStr .= htmlentities($aDataRow["document"]->getName(), ENT_NOQUOTES, 'UTF-8'); | |
| 114 | + $outStr = '<a href="' . $this->buildDocumentLink($aDataRow) . '" title="' . $aDataRow['document']->getFilename().'">'; | |
| 115 | + $outStr .= htmlentities($aDataRow['document']->getName(), ENT_NOQUOTES, 'UTF-8'); | |
| 116 | 116 | $outStr .= '</a>'; |
| 117 | 117 | return $outStr; |
| 118 | 118 | } |
| 119 | 119 | |
| 120 | 120 | function buildDocumentLink($aDataRow) { |
| 121 | - return KTBrowseUtil::getUrlForDocument($aDataRow["document"]->getId()); | |
| 121 | + return KTBrowseUtil::getUrlForDocument($aDataRow['document']->getId()); | |
| 122 | 122 | } |
| 123 | 123 | |
| 124 | 124 | function buildFolderLink($aDataRow) { |
| 125 | 125 | if (is_null(KTUtil::arrayGet($this->aOptions, 'direct_folder'))) { |
| 126 | - return KTUtil::addQueryStringSelf('fFolderId='.$aDataRow["folder"]->getId()); | |
| 126 | + return KTUtil::addQueryStringSelf('fFolderId='.$aDataRow['folder']->getId()); | |
| 127 | 127 | } else { |
| 128 | 128 | return KTBrowseUtil::getUrlForFolder($aDataRow['folder']); |
| 129 | 129 | } |
| ... | ... | @@ -132,12 +132,12 @@ class TitleColumn extends BrowseColumn { |
| 132 | 132 | // use inline, since its just too heavy to even _think_ about using smarty. |
| 133 | 133 | function renderData($aDataRow) { |
| 134 | 134 | $outStr = ''; |
| 135 | - if ($aDataRow["type"] == "folder") { | |
| 135 | + if ($aDataRow['type'] == 'folder') { | |
| 136 | 136 | $outStr .= '<span class="contenttype folder">'; |
| 137 | 137 | $outStr .= $this->renderFolderLink($aDataRow); |
| 138 | 138 | $outStr .= '</span>'; |
| 139 | 139 | } else { |
| 140 | - $outStr .= '<span class="contenttype '.$this->_mimeHelper($aDataRow["document"]->getMimeTypeId()).'">'; | |
| 140 | + $outStr .= '<span class="contenttype '.$this->_mimeHelper($aDataRow['document']->getMimeTypeId()).'">'; | |
| 141 | 141 | $outStr .= $this->renderDocumentLink($aDataRow); |
| 142 | 142 | $outStr .= ' (' . $this->prettySize($aDataRow["document"]->getSize()) . ')'; |
| 143 | 143 | $outStr .= '</span>'; |
| ... | ... | @@ -174,11 +174,11 @@ class DateColumn extends BrowseColumn { |
| 174 | 174 | |
| 175 | 175 | function renderHeader($sReturnURL) { |
| 176 | 176 | $text = $this->label; |
| 177 | - $href = $sReturnURL . "&sort_on=" . $this->name . "&sort_order="; | |
| 177 | + $href = $sReturnURL . '&sort_on=' . $this->name . '&sort_order='; | |
| 178 | 178 | if ($this->sort_on) { |
| 179 | - $href .= $this->sort_direction == "asc" ? "desc" : "asc" ; | |
| 179 | + $href .= $this->sort_direction == 'asc' ? 'desc' : 'asc' ; | |
| 180 | 180 | } else { |
| 181 | - $href .= $this->sort_direction = "asc"; | |
| 181 | + $href .= $this->sort_direction = 'asc'; | |
| 182 | 182 | } |
| 183 | 183 | |
| 184 | 184 | return '<a href="' . $href . '">'.$text.'</a>'; |
| ... | ... | @@ -188,14 +188,14 @@ class DateColumn extends BrowseColumn { |
| 188 | 188 | // use inline, since its just too heavy to even _think_ about using smarty. |
| 189 | 189 | function renderData($aDataRow) { |
| 190 | 190 | $outStr = ''; |
| 191 | - if ($aDataRow["type"] == "folder") { | |
| 191 | + if ($aDataRow['type'] == 'folder') { | |
| 192 | 192 | $outStr = ' '; // no-op on folders. |
| 193 | 193 | } else { |
| 194 | 194 | $fn = $this->field_function; |
| 195 | - $dColumnDate = strtotime($aDataRow["document"]->$fn()); | |
| 195 | + $dColumnDate = strtotime($aDataRow['document']->$fn()); | |
| 196 | 196 | |
| 197 | 197 | // now reformat this into something "pretty" |
| 198 | - $outStr = date("Y-m-d H:i", $dColumnDate); | |
| 198 | + $outStr = date('Y-m-d H:i', $dColumnDate); | |
| 199 | 199 | } |
| 200 | 200 | return $outStr; |
| 201 | 201 | } |
| ... | ... | @@ -233,9 +233,9 @@ class UserColumn extends BrowseColumn { |
| 233 | 233 | |
| 234 | 234 | function renderHeader($sReturnURL) { |
| 235 | 235 | $text = $this->label; |
| 236 | - $href = $sReturnURL . "&sort_on=" . $this->name . "&sort_order="; | |
| 236 | + $href = $sReturnURL . '&sort_on=' . $this->name . '&sort_order='; | |
| 237 | 237 | if ($this->sort_on) { |
| 238 | - $href .= $this->sort_direction == "asc" ? "desc" : "asc" ; | |
| 238 | + $href .= $this->sort_direction == 'asc' ? 'desc' : 'asc' ; | |
| 239 | 239 | } else { |
| 240 | 240 | $href .= $this->sort_direction = "asc"; |
| 241 | 241 | } |
| ... | ... | @@ -249,7 +249,7 @@ class UserColumn extends BrowseColumn { |
| 249 | 249 | $outStr = ''; |
| 250 | 250 | $fn = $this->field_function; |
| 251 | 251 | $iUserId = null; |
| 252 | - if ($aDataRow["type"] == "folder") { | |
| 252 | + if ($aDataRow['type'] == 'folder') { | |
| 253 | 253 | if (method_exists($aDataRow['folder'], $fn)) { |
| 254 | 254 | $iUserId = $aDataRow['folder']->$fn(); // FIXME this should check if the function exists first. |
| 255 | 255 | } |
| ... | ... | @@ -273,7 +273,7 @@ class UserColumn extends BrowseColumn { |
| 273 | 273 | function addToDocumentQuery() { |
| 274 | 274 | $sUsersTable = KTUtil::getTableName('users'); |
| 275 | 275 | $sJoinSQL = "LEFT JOIN $sUsersTable AS users_order_join ON D.{$this->name} = users_order_join.id"; |
| 276 | - return array($sJoinSQL, null, "users_order_join.name"); | |
| 276 | + return array($sJoinSQL, null, 'users_order_join.name'); | |
| 277 | 277 | } |
| 278 | 278 | } |
| 279 | 279 | |
| ... | ... | @@ -292,7 +292,7 @@ class SelectionColumn extends BrowseColumn { |
| 292 | 292 | function renderHeader($sReturnURL) { |
| 293 | 293 | // FIXME clean up access to oPage. |
| 294 | 294 | global $main; |
| 295 | - $main->requireJSResource("resources/js/toggleselect.js"); | |
| 295 | + $main->requireJSResource('resources/js/toggleselect.js'); | |
| 296 | 296 | |
| 297 | 297 | return '<input type="checkbox" title="toggle all" onclick="toggleSelectFor(this, \''.$this->name.'\')">'; |
| 298 | 298 | |
| ... | ... | @@ -302,16 +302,16 @@ class SelectionColumn extends BrowseColumn { |
| 302 | 302 | function renderData($aDataRow) { |
| 303 | 303 | $localname = $this->name; |
| 304 | 304 | |
| 305 | - if (($aDataRow["type"] === "folder") && ($this->show_folders)) { | |
| 305 | + if (($aDataRow['type'] === 'folder') && ($this->show_folders)) { | |
| 306 | 306 | if ($this->show_documents) { |
| 307 | - $localname .= "_f[]"; | |
| 307 | + $localname .= '_f[]'; | |
| 308 | 308 | } |
| 309 | - $v = $aDataRow["folderid"]; | |
| 310 | - } else if (($aDataRow["type"] === "document") && $this->show_documents) { | |
| 309 | + $v = $aDataRow['folderid']; | |
| 310 | + } else if (($aDataRow['type'] === 'document') && $this->show_documents) { | |
| 311 | 311 | if ($this->show_folders) { |
| 312 | - $localname .= "_d[]"; | |
| 312 | + $localname .= '_d[]'; | |
| 313 | 313 | } |
| 314 | - $v = $aDataRow["docid"]; | |
| 314 | + $v = $aDataRow['docid']; | |
| 315 | 315 | } else { |
| 316 | 316 | return ' '; |
| 317 | 317 | } |
| ... | ... | @@ -340,16 +340,16 @@ class SingleSelectionColumn extends SelectionColumn { |
| 340 | 340 | function renderData($aDataRow) { |
| 341 | 341 | $localname = $this->name; |
| 342 | 342 | |
| 343 | - if (($aDataRow["type"] === "folder") && ($this->show_folders)) { | |
| 343 | + if (($aDataRow['type'] === 'folder') && ($this->show_folders)) { | |
| 344 | 344 | if ($this->show_documents) { |
| 345 | - $localname .= "_f"; | |
| 345 | + $localname .= '_f'; | |
| 346 | 346 | } |
| 347 | - $v = $aDataRow["folderid"]; | |
| 348 | - } else if (($aDataRow["type"] === "document") && $this->show_documents) { | |
| 347 | + $v = $aDataRow['folderid']; | |
| 348 | + } else if (($aDataRow['type'] === 'document') && $this->show_documents) { | |
| 349 | 349 | if ($this->show_folders) { |
| 350 | - $localname .= "_d"; | |
| 350 | + $localname .= '_d'; | |
| 351 | 351 | } |
| 352 | - $v = $aDataRow["docid"]; | |
| 352 | + $v = $aDataRow['docid']; | |
| 353 | 353 | } else { |
| 354 | 354 | return ' '; |
| 355 | 355 | } |
| ... | ... | @@ -364,11 +364,11 @@ class WorkflowColumn extends BrowseColumn { |
| 364 | 364 | |
| 365 | 365 | function renderHeader($sReturnURL) { |
| 366 | 366 | $text = $this->label; |
| 367 | - $href = $sReturnURL . "&sort_on=" . $this->name . "&sort_order="; | |
| 367 | + $href = $sReturnURL . '&sort_on=' . $this->name . '&sort_order='; | |
| 368 | 368 | if ($this->sort_on) { |
| 369 | - $href .= $this->sort_direction == "asc" ? "desc" : "asc" ; | |
| 369 | + $href .= $this->sort_direction == 'asc' ? 'desc' : 'asc' ; | |
| 370 | 370 | } else { |
| 371 | - $href .= $this->sort_direction = "asc"; | |
| 371 | + $href .= $this->sort_direction = 'asc'; | |
| 372 | 372 | } |
| 373 | 373 | |
| 374 | 374 | return '<a href="' . $href . '">'.$text.'</a>'; |
| ... | ... | @@ -380,7 +380,7 @@ class WorkflowColumn extends BrowseColumn { |
| 380 | 380 | |
| 381 | 381 | |
| 382 | 382 | // only _ever_ show this folder documents. |
| 383 | - if ($aDataRow["type"] === "folder") { | |
| 383 | + if ($aDataRow['type'] === 'folder') { | |
| 384 | 384 | return ' '; |
| 385 | 385 | } |
| 386 | 386 | ... | ... |