Commit 8268245c8a896321f48e08dc96a480cae244ab2a
1 parent
63396e03
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@6257 c91229c3-7414-0410-bfa2-8a42b809f60b
Showing
1 changed file
with
38 additions
and
37 deletions
plugins/ktcore/KTWidgets.php
| 1 | <?php | 1 | <?php |
| 2 | 2 | ||
| 3 | -require_once(KT_LIB_DIR . "/widgets/basewidget.inc.php"); | ||
| 4 | -require_once(KT_LIB_DIR . "/templating/templating.inc.php"); | 3 | +require_once(KT_LIB_DIR . '/widgets/basewidget.inc.php'); |
| 4 | +require_once(KT_LIB_DIR . '/templating/templating.inc.php'); | ||
| 5 | require_once(KT_LIB_DIR . '/browse/DocumentCollection.inc.php'); | 5 | require_once(KT_LIB_DIR . '/browse/DocumentCollection.inc.php'); |
| 6 | 6 | ||
| 7 | class KTCoreStringWidget extends KTWidget { | 7 | class KTCoreStringWidget extends KTWidget { |
| @@ -14,13 +14,13 @@ class KTCoreFileWidget extends KTWidget { | @@ -14,13 +14,13 @@ class KTCoreFileWidget extends KTWidget { | ||
| 14 | var $sTemplate = 'ktcore/forms/widgets/file'; | 14 | var $sTemplate = 'ktcore/forms/widgets/file'; |
| 15 | 15 | ||
| 16 | function wrapName($outer) { | 16 | function wrapName($outer) { |
| 17 | - $this->sName = sprintf("_kt_attempt_unique_%s", $this->sName); | 17 | + $this->sName = sprintf('_kt_attempt_unique_%s', $this->sName); |
| 18 | // we don't have access via "wrap" when processing, so we can't actually | 18 | // we don't have access via "wrap" when processing, so we can't actually |
| 19 | // wrap. just don't use a lot of names | 19 | // wrap. just don't use a lot of names |
| 20 | } | 20 | } |
| 21 | 21 | ||
| 22 | function process($data){ | 22 | function process($data){ |
| 23 | - $tname = sprintf("_kt_attempt_unique_%s", $this->sName); | 23 | + $tname = sprintf('_kt_attempt_unique_%s', $this->sName); |
| 24 | return array($this->sBasename => $_FILES[$tname]); | 24 | return array($this->sBasename => $_FILES[$tname]); |
| 25 | } | 25 | } |
| 26 | 26 | ||
| @@ -31,7 +31,7 @@ class KTCoreFileWidget extends KTWidget { | @@ -31,7 +31,7 @@ class KTCoreFileWidget extends KTWidget { | ||
| 31 | 31 | ||
| 32 | $oVF =& KTValidatorFactory::getSingleton(); | 32 | $oVF =& KTValidatorFactory::getSingleton(); |
| 33 | return $oVF->get('ktcore.validators.requiredfile', array( | 33 | return $oVF->get('ktcore.validators.requiredfile', array( |
| 34 | - 'test' => sprintf("_kt_attempt_unique_%s", $this->sName), | 34 | + 'test' => sprintf('_kt_attempt_unique_%s', $this->sName), |
| 35 | 'basename' => $this->sBasename, | 35 | 'basename' => $this->sBasename, |
| 36 | )); | 36 | )); |
| 37 | } | 37 | } |
| @@ -188,7 +188,7 @@ class KTCoreSelectionWidget extends KTWidget { | @@ -188,7 +188,7 @@ class KTCoreSelectionWidget extends KTWidget { | ||
| 188 | 188 | ||
| 189 | // make sure its the selected one if there's no value specified. | 189 | // make sure its the selected one if there's no value specified. |
| 190 | if (empty($this->value)) { | 190 | if (empty($this->value)) { |
| 191 | - $this->value = "0"; | 191 | + $this->value = '0'; |
| 192 | } | 192 | } |
| 193 | } | 193 | } |
| 194 | 194 | ||
| @@ -202,13 +202,13 @@ class KTCoreSelectionWidget extends KTWidget { | @@ -202,13 +202,13 @@ class KTCoreSelectionWidget extends KTWidget { | ||
| 202 | } | 202 | } |
| 203 | 203 | ||
| 204 | $aTemplateData = array( | 204 | $aTemplateData = array( |
| 205 | - "context" => $this, | ||
| 206 | - "name" => $this->sName, | ||
| 207 | - "has_id" => ($this->sId !== null), | ||
| 208 | - "id" => $this->sId, | ||
| 209 | - "has_value" => ($this->value !== null), | ||
| 210 | - "value" => $this->value, | ||
| 211 | - "options" => $this->aOptions, | 205 | + 'context' => $this, |
| 206 | + 'name' => $this->sName, | ||
| 207 | + 'has_id' => ($this->sId !== null), | ||
| 208 | + 'id' => $this->sId, | ||
| 209 | + 'has_value' => ($this->value !== null), | ||
| 210 | + 'value' => $this->value, | ||
| 211 | + 'options' => $this->aOptions, | ||
| 212 | 'vocab' => $this->aVocab, | 212 | 'vocab' => $this->aVocab, |
| 213 | ); | 213 | ); |
| 214 | return $oTemplate->render($aTemplateData); | 214 | return $oTemplate->render($aTemplateData); |
| @@ -294,7 +294,7 @@ class KTDescriptorSelectionWidget extends KTWidget { | @@ -294,7 +294,7 @@ class KTDescriptorSelectionWidget extends KTWidget { | ||
| 294 | $oTemplate = $oTemplating->loadTemplate($this->sTemplate); | 294 | $oTemplate = $oTemplating->loadTemplate($this->sTemplate); |
| 295 | 295 | ||
| 296 | $src_location = $this->aOptions['src']; | 296 | $src_location = $this->aOptions['src']; |
| 297 | - $sJS = sprintf("addLoadEvent(initJSONLookup(\"%s\", \"%s\"));", $this->sBasename, $src_location); | 297 | + $sJS = sprintf('addLoadEvent(initJSONLookup("%s", "%s"));', $this->sBasename, $src_location); |
| 298 | 298 | ||
| 299 | 299 | ||
| 300 | // its bad, but that's life. | 300 | // its bad, but that's life. |
| @@ -304,19 +304,19 @@ class KTDescriptorSelectionWidget extends KTWidget { | @@ -304,19 +304,19 @@ class KTDescriptorSelectionWidget extends KTWidget { | ||
| 304 | $this->aOptions['multi'] = true; | 304 | $this->aOptions['multi'] = true; |
| 305 | 305 | ||
| 306 | $aTemplateData = array( | 306 | $aTemplateData = array( |
| 307 | - "context" => $this, | ||
| 308 | - "label" => $this->sLabel, | ||
| 309 | - "description" => $this->sDescription, | ||
| 310 | - "name" => $this->sName, | ||
| 311 | - "required" => $this->bRequired, | ||
| 312 | - "has_id" => ($this->sId !== null), | ||
| 313 | - "id" => $this->sId, | ||
| 314 | - "has_value" => ($this->value !== null), | ||
| 315 | - "value" => $this->value, | ||
| 316 | - "has_errors" => $bHasErrors, | ||
| 317 | - "errors" => $this->aErrors, | 307 | + 'context' => $this, |
| 308 | + 'label' => $this->sLabel, | ||
| 309 | + 'description' => $this->sDescription, | ||
| 310 | + 'name' => $this->sName, | ||
| 311 | + 'required' => $this->bRequired, | ||
| 312 | + 'has_id' => ($this->sId !== null), | ||
| 313 | + 'id' => $this->sId, | ||
| 314 | + 'has_value' => ($this->value !== null), | ||
| 315 | + 'value' => $this->value, | ||
| 316 | + 'has_errors' => $bHasErrors, | ||
| 317 | + 'errors' => $this->aErrors, | ||
| 318 | 'short_name' => $this->sBasename, | 318 | 'short_name' => $this->sBasename, |
| 319 | - "options" => $this->aOptions, | 319 | + 'options' => $this->aOptions, |
| 320 | ); | 320 | ); |
| 321 | return $oTemplate->render($aTemplateData); | 321 | return $oTemplate->render($aTemplateData); |
| 322 | } | 322 | } |
| @@ -335,7 +335,7 @@ class KTCoreTreeMetadataWidget extends KTWidget { | @@ -335,7 +335,7 @@ class KTCoreTreeMetadataWidget extends KTWidget { | ||
| 335 | 335 | ||
| 336 | $this->iFieldId = KTUtil::arrayGet($aOptions, 'field_id'); | 336 | $this->iFieldId = KTUtil::arrayGet($aOptions, 'field_id'); |
| 337 | if (is_null($this->iFieldId)) { | 337 | if (is_null($this->iFieldId)) { |
| 338 | - return PEAR::raiseError(_kt("Tree metadata fields must be associated with a particular type.")); | 338 | + return PEAR::raiseError(_kt('Tree metadata fields must be associated with a particular type.')); |
| 339 | } | 339 | } |
| 340 | } | 340 | } |
| 341 | 341 | ||
| @@ -344,7 +344,7 @@ class KTCoreTreeMetadataWidget extends KTWidget { | @@ -344,7 +344,7 @@ class KTCoreTreeMetadataWidget extends KTWidget { | ||
| 344 | // just override the template being used. | 344 | // just override the template being used. |
| 345 | $bHasErrors = false; | 345 | $bHasErrors = false; |
| 346 | 346 | ||
| 347 | - require_once(KT_LIB_DIR . "/documentmanagement/MDTree.inc"); | 347 | + require_once(KT_LIB_DIR . '/documentmanagement/MDTree.inc'); |
| 348 | 348 | ||
| 349 | $fieldTree = new MDTree(); | 349 | $fieldTree = new MDTree(); |
| 350 | $fieldTree->buildForField($this->iFieldId); | 350 | $fieldTree->buildForField($this->iFieldId); |
| @@ -401,10 +401,10 @@ class KTCoreFieldsetWidget extends KTWidget { | @@ -401,10 +401,10 @@ class KTCoreFieldsetWidget extends KTWidget { | ||
| 401 | $oTemplate = $oTemplating->loadTemplate('ktcore/forms/widgets/fieldset'); | 401 | $oTemplate = $oTemplating->loadTemplate('ktcore/forms/widgets/fieldset'); |
| 402 | 402 | ||
| 403 | $aTemplateData = array( | 403 | $aTemplateData = array( |
| 404 | - "context" => $this, | ||
| 405 | - "label" => $this->sLabel, | ||
| 406 | - "description" => $this->sDescription, | ||
| 407 | - "widgets" => $this->renderWidgets(), | 404 | + 'context' => $this, |
| 405 | + 'label' => $this->sLabel, | ||
| 406 | + 'description' => $this->sDescription, | ||
| 407 | + 'widgets' => $this->renderWidgets(), | ||
| 408 | ); | 408 | ); |
| 409 | return $oTemplate->render($aTemplateData); | 409 | return $oTemplate->render($aTemplateData); |
| 410 | } | 410 | } |
| @@ -514,7 +514,7 @@ class KTCoreTransparentFieldsetWidget extends KTCoreFieldsetWidget { | @@ -514,7 +514,7 @@ class KTCoreTransparentFieldsetWidget extends KTCoreFieldsetWidget { | ||
| 514 | $oTemplate = $oTemplating->loadTemplate('ktcore/forms/widgets/transparent_fieldset'); | 514 | $oTemplate = $oTemplating->loadTemplate('ktcore/forms/widgets/transparent_fieldset'); |
| 515 | 515 | ||
| 516 | $aTemplateData = array( | 516 | $aTemplateData = array( |
| 517 | - "widgets" => $this->renderWidgets(), | 517 | + 'widgets' => $this->renderWidgets(), |
| 518 | ); | 518 | ); |
| 519 | return $oTemplate->render($aTemplateData); | 519 | return $oTemplate->render($aTemplateData); |
| 520 | } | 520 | } |
| @@ -530,9 +530,9 @@ class KTExtraConditionalFieldsetWidget extends KTCoreFieldsetWidget { | @@ -530,9 +530,9 @@ class KTExtraConditionalFieldsetWidget extends KTCoreFieldsetWidget { | ||
| 530 | $oTemplate = $oTemplating->loadTemplate('ktcore/forms/widgets/conditionalfieldset'); | 530 | $oTemplate = $oTemplating->loadTemplate('ktcore/forms/widgets/conditionalfieldset'); |
| 531 | 531 | ||
| 532 | $aTemplateData = array( | 532 | $aTemplateData = array( |
| 533 | - "context" => $this, | ||
| 534 | - "label" => $this->sLabel, | ||
| 535 | - "description" => $this->sDescription, | 533 | + 'context' => $this, |
| 534 | + 'label' => $this->sLabel, | ||
| 535 | + 'description' => $this->sDescription, | ||
| 536 | ); | 536 | ); |
| 537 | return $oTemplate->render($aTemplateData); | 537 | return $oTemplate->render($aTemplateData); |
| 538 | } | 538 | } |
| @@ -598,6 +598,7 @@ class KTCoreCollectionWidget extends KTWidget { | @@ -598,6 +598,7 @@ class KTCoreCollectionWidget extends KTWidget { | ||
| 598 | $oCR =& KTColumnRegistry::getSingleton(); | 598 | $oCR =& KTColumnRegistry::getSingleton(); |
| 599 | //print '<pre>'; | 599 | //print '<pre>'; |
| 600 | foreach($this->aCols as $ns) { | 600 | foreach($this->aCols as $ns) { |
| 601 | + | ||
| 601 | $oCR->getColumn($ns); | 602 | $oCR->getColumn($ns); |
| 602 | } | 603 | } |
| 603 | $this->oCollection = unserialize($this->sCollection); | 604 | $this->oCollection = unserialize($this->sCollection); |
| @@ -671,7 +672,7 @@ class KTCoreCollectionPage extends KTStandardDispatcher { | @@ -671,7 +672,7 @@ class KTCoreCollectionPage extends KTStandardDispatcher { | ||
| 671 | 672 | ||
| 672 | $aParams = kt_array_merge($aURLParams, array('fFolderId'=>$id, 'code'=>$sCode, 'varname'=>$sName)); | 673 | $aParams = kt_array_merge($aURLParams, array('fFolderId'=>$id, 'code'=>$sCode, 'varname'=>$sName)); |
| 673 | $url = KTUtil::addQueryString($_SERVER['PHP_SELF'], $aParams); | 674 | $url = KTUtil::addQueryString($_SERVER['PHP_SELF'], $aParams); |
| 674 | - $aBreadcrumbs[] = array("url" => $url, "name" => $folder_path_names[$index]); | 675 | + $aBreadcrumbs[] = array('url' => $url, 'name' => $folder_path_names[$index]); |
| 675 | } | 676 | } |
| 676 | 677 | ||
| 677 | return $aBreadcrumbs; | 678 | return $aBreadcrumbs; |