@@ -179,8 +179,7 @@ discard block |
||
| 179 | 179 | |
| 180 | 180 | /*@var $customfield AppCustomField */ |
| 181 | 181 | } |
| 182 | - } |
|
| 183 | - catch (ORMBackEndSelectException $e){ |
|
| 182 | + } catch (ORMBackEndSelectException $e){ |
|
| 184 | 183 | // table does not exist, this error is thrown by the install program while creating the sets |
| 185 | 184 | } |
| 186 | 185 | } |
@@ -217,8 +216,7 @@ discard block |
||
| 217 | 216 | if($ormField instanceof ORMFkField){ |
| 218 | 217 | $this->hasOne($customField->fieldname, $ormField->getForeignSetName()) |
| 219 | 218 | ->setDescription($description); |
| 220 | - } |
|
| 221 | - else{ |
|
| 219 | + } else{ |
|
| 222 | 220 | $this->addFields($ormField); |
| 223 | 221 | } |
| 224 | 222 | } |
@@ -275,8 +273,7 @@ discard block |
||
| 275 | 273 | $linkSet = $this->App()->LinkSet(); |
| 276 | 274 | if(is_array($source) || ($source instanceof \Iterator)){ |
| 277 | 275 | return $linkSet->selectForSources($source, $this->getRecordClassName(), $linkType); |
| 278 | - } |
|
| 279 | - else{ |
|
| 276 | + } else{ |
|
| 280 | 277 | return $linkSet->selectForSource($source, $this->getRecordClassName(), $linkType); |
| 281 | 278 | } |
| 282 | 279 | } |
@@ -296,8 +293,7 @@ discard block |
||
| 296 | 293 | $linkSet = $this->App()->LinkSet(); |
| 297 | 294 | if(is_array($target) || ($target instanceof \Iterator)){ |
| 298 | 295 | return $linkSet->selectForTargets($target, $this->getRecordClassName(), $linkType); |
| 299 | - } |
|
| 300 | - else{ |
|
| 296 | + } else{ |
|
| 301 | 297 | return $linkSet->selectForTarget($target, $this->getRecordClassName(), $linkType); |
| 302 | 298 | } |
| 303 | 299 | } |
@@ -324,8 +320,7 @@ discard block |
||
| 324 | 320 | if(isset($linkType)){ |
| 325 | 321 | if(is_array($linkType)){ |
| 326 | 322 | $criteria = $criteria->_AND_($linkSet->type->in($linkType)); |
| 327 | - } |
|
| 328 | - else{ |
|
| 323 | + } else{ |
|
| 329 | 324 | $criteria = $criteria->_AND_($linkSet->type->is($linkType)); |
| 330 | 325 | } |
| 331 | 326 | } |
@@ -356,8 +351,7 @@ discard block |
||
| 356 | 351 | if(isset($linkType)){ |
| 357 | 352 | if(is_array($linkType)){ |
| 358 | 353 | $criteria = $criteria->_AND_($linkSet->type->in($linkType)); |
| 359 | - } |
|
| 360 | - else{ |
|
| 354 | + } else{ |
|
| 361 | 355 | $criteria = $criteria->_AND_($linkSet->type->is($linkType)); |
| 362 | 356 | } |
| 363 | 357 | } |
@@ -400,8 +394,7 @@ discard block |
||
| 400 | 394 | if(isset($linkType)){ |
| 401 | 395 | if(is_array($linkType)){ |
| 402 | 396 | $criteria = $criteria->_AND_($linkSet->type->in($linkType)); |
| 403 | - } |
|
| 404 | - else{ |
|
| 397 | + } else{ |
|
| 405 | 398 | $criteria = $criteria->_AND_($linkSet->type->is($linkType)); |
| 406 | 399 | } |
| 407 | 400 | } |
@@ -444,8 +437,7 @@ discard block |
||
| 444 | 437 | if(isset($linkType)){ |
| 445 | 438 | if(is_array($linkType)){ |
| 446 | 439 | $criteria = $criteria->_AND_($linkSet->type->in($linkType)); |
| 447 | - } |
|
| 448 | - else{ |
|
| 440 | + } else{ |
|
| 449 | 441 | $criteria = $criteria->_AND_($linkSet->type->is($linkType)); |
| 450 | 442 | } |
| 451 | 443 | } |
@@ -562,8 +554,7 @@ discard block |
||
| 562 | 554 | |
| 563 | 555 | if(is_array($tagLabels)){ |
| 564 | 556 | $criteria = $criteria->_AND_($linkSet->targetId->label->in($tagLabels)); |
| 565 | - } |
|
| 566 | - else{ |
|
| 557 | + } else{ |
|
| 567 | 558 | $criteria = $criteria->_AND_($linkSet->targetId->label->is($tagLabels)); |
| 568 | 559 | } |
| 569 | 560 | if(isset($linkType)){ |
@@ -159,13 +159,11 @@ discard block |
||
| 159 | 159 | |
| 160 | 160 | if($foreignRecordSetField instanceof ORMBoolInterface){ |
| 161 | 161 | $booleanFieldPathes[] = $foreignPath; |
| 162 | - } |
|
| 163 | - else{ |
|
| 162 | + } else{ |
|
| 164 | 163 | $defaultFieldPathes[] = $foreignPath; |
| 165 | 164 | } |
| 166 | 165 | } |
| 167 | - } |
|
| 168 | - elseif($recordSetField instanceof ORMFkField){ |
|
| 166 | + } elseif($recordSetField instanceof ORMFkField){ |
|
| 169 | 167 | /* @var $recordSetField ORMFkField */ |
| 170 | 168 | $fieldDescription = $fieldName; |
| 171 | 169 | $path = $fieldName; |
@@ -182,13 +180,11 @@ discard block |
||
| 182 | 180 | |
| 183 | 181 | if($foreignRecordSetField instanceof ORMBoolInterface){ |
| 184 | 182 | $booleanFieldPathes[] = $foreignPath; |
| 185 | - } |
|
| 186 | - else{ |
|
| 183 | + } else{ |
|
| 187 | 184 | $defaultFieldPathes[] = $foreignPath; |
| 188 | 185 | } |
| 189 | 186 | } |
| 190 | - } |
|
| 191 | - else{ |
|
| 187 | + } else{ |
|
| 192 | 188 | /* @var $recordSetField ORMField */ |
| 193 | 189 | $fieldName = $recordSetField->getName(); |
| 194 | 190 | $fieldDescription = $recordSetField->getDescription(); |
@@ -204,8 +200,7 @@ discard block |
||
| 204 | 200 | |
| 205 | 201 | if($recordSetField instanceof ORMBoolInterface){ |
| 206 | 202 | $booleanFieldPathes[] = $path; |
| 207 | - } |
|
| 208 | - else{ |
|
| 203 | + } else{ |
|
| 209 | 204 | $defaultFieldPathes[] = $path; |
| 210 | 205 | } |
| 211 | 206 | } |
@@ -264,8 +264,7 @@ discard block |
||
| 264 | 264 | $customSectionSet = $App->CustomContainerSet(); |
| 265 | 265 | if(isset($id)){ |
| 266 | 266 | $record = $customSectionSet->request($id); |
| 267 | - } |
|
| 268 | - else{ |
|
| 267 | + } else{ |
|
| 269 | 268 | $record = $customSectionSet->newRecord(); |
| 270 | 269 | $record->object = $object; |
| 271 | 270 | } |
@@ -522,8 +521,7 @@ discard block |
||
| 522 | 521 | |
| 523 | 522 | if($selectedManyField instanceof ORMBoolInterface){ |
| 524 | 523 | $condition = $condition['bool']; |
| 525 | - } |
|
| 526 | - else{ |
|
| 524 | + } else{ |
|
| 527 | 525 | $condition = $condition['default']; |
| 528 | 526 | } |
| 529 | 527 | |
@@ -551,8 +549,7 @@ discard block |
||
| 551 | 549 | |
| 552 | 550 | if($selectedOneField instanceof ORMBoolInterface){ |
| 553 | 551 | $condition = $condition['bool']; |
| 554 | - } |
|
| 555 | - else{ |
|
| 552 | + } else{ |
|
| 556 | 553 | $condition = $condition['default']; |
| 557 | 554 | } |
| 558 | 555 | |
@@ -561,15 +558,13 @@ discard block |
||
| 561 | 558 | } |
| 562 | 559 | break; |
| 563 | 560 | } |
| 564 | - } |
|
| 565 | - else{ |
|
| 561 | + } else{ |
|
| 566 | 562 | |
| 567 | 563 | $field = $objectRecordSet->$field; |
| 568 | 564 | |
| 569 | 565 | if($field instanceof ORMBoolInterface){ |
| 570 | 566 | $condition = $condition['bool']; |
| 571 | - } |
|
| 572 | - else{ |
|
| 567 | + } else{ |
|
| 573 | 568 | $condition = $condition['default']; |
| 574 | 569 | } |
| 575 | 570 | |
@@ -506,8 +506,7 @@ discard block |
||
| 506 | 506 | $customSectionSet = $App->CustomSectionSet(); |
| 507 | 507 | if(isset($id)){ |
| 508 | 508 | $record = $customSectionSet->request($id); |
| 509 | - } |
|
| 510 | - else{ |
|
| 509 | + } else{ |
|
| 511 | 510 | $record = $customSectionSet->newRecord(); |
| 512 | 511 | $record->container = $container->id; |
| 513 | 512 | } |
@@ -813,8 +812,7 @@ discard block |
||
| 813 | 812 | |
| 814 | 813 | if($selectedManyField instanceof ORMBoolInterface){ |
| 815 | 814 | $condition = $condition['bool']; |
| 816 | - } |
|
| 817 | - else{ |
|
| 815 | + } else{ |
|
| 818 | 816 | $condition = $condition['default']; |
| 819 | 817 | } |
| 820 | 818 | |
@@ -842,8 +840,7 @@ discard block |
||
| 842 | 840 | |
| 843 | 841 | if($selectedOneField instanceof ORMBoolInterface){ |
| 844 | 842 | $condition = $condition['bool']; |
| 845 | - } |
|
| 846 | - else{ |
|
| 843 | + } else{ |
|
| 847 | 844 | $condition = $condition['default']; |
| 848 | 845 | } |
| 849 | 846 | |
@@ -852,15 +849,13 @@ discard block |
||
| 852 | 849 | } |
| 853 | 850 | break; |
| 854 | 851 | } |
| 855 | - } |
|
| 856 | - else{ |
|
| 852 | + } else{ |
|
| 857 | 853 | |
| 858 | 854 | $field = $objectRecordSet->$field; |
| 859 | 855 | |
| 860 | 856 | if($field instanceof ORMBoolInterface){ |
| 861 | 857 | $condition = $condition['bool']; |
| 862 | - } |
|
| 863 | - else{ |
|
| 858 | + } else{ |
|
| 864 | 859 | $condition = $condition['default']; |
| 865 | 860 | } |
| 866 | 861 | |
@@ -1268,12 +1263,10 @@ discard block |
||
| 1268 | 1263 | foreach ($sections[$currentSection->id . '.fieldsGroups'][$fieldName] as $subKey => $subValue){ |
| 1269 | 1264 | $rawSectionData[$currentSectionId][$fieldName]['fields'][$subKey] = $field['fields'][$subKey]; |
| 1270 | 1265 | } |
| 1271 | - } |
|
| 1272 | - elseif($fieldName != 'fieldsGroups'){ |
|
| 1266 | + } elseif($fieldName != 'fieldsGroups'){ |
|
| 1273 | 1267 | $rawSectionData[$currentSectionId][$fieldName] = $field; |
| 1274 | 1268 | } |
| 1275 | - } |
|
| 1276 | - else{ |
|
| 1269 | + } else{ |
|
| 1277 | 1270 | $field = null; |
| 1278 | 1271 | $tmpSection = $customSectionSet->get($customSectionSet->id->is($fieldSectionId)); |
| 1279 | 1272 | if($tmpSection){ |
@@ -187,8 +187,7 @@ discard block |
||
| 187 | 187 | { |
| 188 | 188 | if($this->isAjaxRequest()){ |
| 189 | 189 | $authType = 'Basic'; |
| 190 | - } |
|
| 191 | - else{ |
|
| 190 | + } else{ |
|
| 192 | 191 | $authType = ''; |
| 193 | 192 | } |
| 194 | 193 | |
@@ -263,8 +262,7 @@ discard block |
||
| 263 | 262 | |
| 264 | 263 | if($parameter->isDefaultValueAvailable()){ |
| 265 | 264 | $parametersStr[] = '$' . $parameter->name . ' = ' . var_export($parameter->getDefaultValue(), true); |
| 266 | - } |
|
| 267 | - else{ |
|
| 265 | + } else{ |
|
| 268 | 266 | $parametersStr[] = '$' . $parameter->name; |
| 269 | 267 | } |
| 270 | 268 | } |
@@ -358,11 +356,9 @@ discard block |
||
| 358 | 356 | $parameterName = $parameter->getName(); |
| 359 | 357 | if(isset($args[$argNumber])){ |
| 360 | 358 | $actionParams[$parameterName] = $args[$argNumber]; |
| 361 | - } |
|
| 362 | - elseif($parameter->isDefaultValueAvailable()){ |
|
| 359 | + } elseif($parameter->isDefaultValueAvailable()){ |
|
| 363 | 360 | $actionParams[$parameterName] = $parameter->getDefaultValue(); |
| 364 | - } |
|
| 365 | - else{ |
|
| 361 | + } else{ |
|
| 366 | 362 | $actionParams[$parameterName] = null; |
| 367 | 363 | } |
| 368 | 364 | $argNumber ++; |
@@ -440,8 +436,7 @@ discard block |
||
| 440 | 436 | if($component){ |
| 441 | 437 | $this->app->setCurrentComponent($component); |
| 442 | 438 | $objectController = $component->controller(false); |
| 443 | - } |
|
| 444 | - else{ |
|
| 439 | + } else{ |
|
| 445 | 440 | header('HTTP/1.0 400 Bad Request'); |
| 446 | 441 | throw new AppUnknownActionException($action); |
| 447 | 442 | } |
@@ -456,13 +451,11 @@ discard block |
||
| 456 | 451 | |
| 457 | 452 | try{ |
| 458 | 453 | $returnedValue = $objectController->execAction($action); |
| 459 | - } |
|
| 460 | - catch (AppAccessException $e){ |
|
| 454 | + } catch (AppAccessException $e){ |
|
| 461 | 455 | |
| 462 | 456 | if(! bab_isUserLogged() && $e->requireCredential){ |
| 463 | 457 | bab_requireCredential($e->getMessage()); |
| 464 | - } |
|
| 465 | - else{ |
|
| 458 | + } else{ |
|
| 466 | 459 | if($this->isAjaxRequest()){ |
| 467 | 460 | |
| 468 | 461 | header($_SERVER['SERVER_PROTOCOL'] . ' 403 Forbidden', true, 403); |
@@ -475,8 +468,7 @@ discard block |
||
| 475 | 468 | } |
| 476 | 469 | $this->accessPage($e); |
| 477 | 470 | } |
| 478 | - } |
|
| 479 | - catch (AppSaveException $e){ |
|
| 471 | + } catch (AppSaveException $e){ |
|
| 480 | 472 | |
| 481 | 473 | if($this->isAjaxRequest()){ |
| 482 | 474 | header($_SERVER['SERVER_PROTOCOL'] . ' 403 Forbidden', true, 403); |
@@ -490,17 +482,13 @@ discard block |
||
| 490 | 482 | 'errorMessage' => bab_convertStringFromDatabase($e->getMessage(), 'UTF-8') |
| 491 | 483 | ))); |
| 492 | 484 | } |
| 493 | - } |
|
| 494 | - catch (AppDeletedRecordException $e){ |
|
| 485 | + } catch (AppDeletedRecordException $e){ |
|
| 495 | 486 | $this->deletedItemPage($action, $e); |
| 496 | - } |
|
| 497 | - catch (AppNotFoundException $e){ |
|
| 487 | + } catch (AppNotFoundException $e){ |
|
| 498 | 488 | $this->notFoundPage($action, $e); |
| 499 | - } |
|
| 500 | - catch (ORMException $e){ |
|
| 489 | + } catch (ORMException $e){ |
|
| 501 | 490 | $this->errorPage($e); |
| 502 | - } |
|
| 503 | - catch (\Exception $e){ |
|
| 491 | + } catch (\Exception $e){ |
|
| 504 | 492 | $this->unexpectedErrorPage($e); |
| 505 | 493 | } |
| 506 | 494 | |
@@ -512,8 +500,7 @@ discard block |
||
| 512 | 500 | |
| 513 | 501 | // If the action returned a page, we display it. |
| 514 | 502 | $returnedValue->displayHtml(); |
| 515 | - } |
|
| 516 | - else{ |
|
| 503 | + } else{ |
|
| 517 | 504 | |
| 518 | 505 | $htmlCanvas = $W->HtmlCanvas(); |
| 519 | 506 | if(self::$acceptJson){ |
@@ -525,8 +512,7 @@ discard block |
||
| 525 | 512 | header('Expires: Mon, 26 Jul 1997 05:00:00 GMT'); |
| 526 | 513 | header('Content-type: application/json'); |
| 527 | 514 | die(bab_json_encode($returnArray)); |
| 528 | - } |
|
| 529 | - else{ |
|
| 515 | + } else{ |
|
| 530 | 516 | header('Cache-Control: no-cache, must-revalidate'); |
| 531 | 517 | header('Expires: Mon, 26 Jul 1997 05:00:00 GMT'); |
| 532 | 518 | header('Content-type: text/html'); |
@@ -535,8 +521,7 @@ discard block |
||
| 535 | 521 | |
| 536 | 522 | if(method_exists($htmlCanvas, 'sendPageTitle')){ |
| 537 | 523 | $htmlCanvas->sendPageTitle($pageTitle); |
| 538 | - } |
|
| 539 | - else{ |
|
| 524 | + } else{ |
|
| 540 | 525 | header('X-Cto-PageTitle: ' . $pageTitle); |
| 541 | 526 | } |
| 542 | 527 | } |
@@ -544,16 +529,14 @@ discard block |
||
| 544 | 529 | die($html); |
| 545 | 530 | } |
| 546 | 531 | } |
| 547 | - } |
|
| 548 | - elseif(is_array($returnedValue)){ |
|
| 532 | + } elseif(is_array($returnedValue)){ |
|
| 549 | 533 | |
| 550 | 534 | $htmlCanvas = $W->HtmlCanvas(); |
| 551 | 535 | $returnedArray = array(); |
| 552 | 536 | foreach ($returnedValue as $key => &$item){ |
| 553 | 537 | if($item instanceof WidgetDisplayableInterface){ |
| 554 | 538 | $returnedArray[$item->getId()] = $item->display($htmlCanvas); |
| 555 | - } |
|
| 556 | - else{ |
|
| 539 | + } else{ |
|
| 557 | 540 | $returnedArray[$key] = $item; |
| 558 | 541 | } |
| 559 | 542 | } |
@@ -561,8 +544,7 @@ discard block |
||
| 561 | 544 | header('Expires: Mon, 26 Jul 1997 05:00:00 GMT'); |
| 562 | 545 | header('Content-type: application/json'); |
| 563 | 546 | die(bab_convertStringFromDatabase(bab_json_encode($returnedArray), \bab_charset::UTF_8)); |
| 564 | - } |
|
| 565 | - elseif(true === $returnedValue || is_string($returnedValue)){ |
|
| 547 | + } elseif(true === $returnedValue || is_string($returnedValue)){ |
|
| 566 | 548 | |
| 567 | 549 | if($this->isAjaxRequest()){ |
| 568 | 550 | $body = bab_getBody(); |
@@ -739,8 +721,7 @@ discard block |
||
| 739 | 721 | foreach ($traces as $trace){ |
| 740 | 722 | $stackTraceBox->addItem($W->Label($trace)); |
| 741 | 723 | } |
| 742 | - } |
|
| 743 | - else{ |
|
| 724 | + } else{ |
|
| 744 | 725 | $section->addItem($W->Label($App->translate('Please contact the administrator'))); |
| 745 | 726 | } |
| 746 | 727 | |
@@ -803,8 +784,7 @@ discard block |
||
| 803 | 784 | foreach ($traces as $trace){ |
| 804 | 785 | $stackTraceBox->addItem($W->Label($trace)); |
| 805 | 786 | } |
| 806 | - } |
|
| 807 | - else{ |
|
| 787 | + } else{ |
|
| 808 | 788 | $section->addItem($W->Label($App->translate('Please contact the administrator'))); |
| 809 | 789 | } |
| 810 | 790 | |
@@ -163,7 +163,7 @@ discard block |
||
| 163 | 163 | { |
| 164 | 164 | if(isset($this->components[$componentName])){ |
| 165 | 165 | return $this->components[$componentName]; |
| 166 | - }else{ |
|
| 166 | + } else{ |
|
| 167 | 167 | return null; |
| 168 | 168 | } |
| 169 | 169 | } |
@@ -431,8 +431,7 @@ discard block |
||
| 431 | 431 | if(empty($component->getPackageName())){ |
| 432 | 432 | $noPackageNames[] = $component->getName(); |
| 433 | 433 | } |
| 434 | - } |
|
| 435 | - catch (\Exception $e){ |
|
| 434 | + } catch (\Exception $e){ |
|
| 436 | 435 | |
| 437 | 436 | } |
| 438 | 437 | } |
@@ -892,7 +891,7 @@ discard block |
||
| 892 | 891 | { |
| 893 | 892 | if(get_class($this) == "Capwelton\LibApp\Func_App"){ |
| 894 | 893 | return bab_getInstance("Capwelton\LibApp\Ui\AppUi")->setApp($this); |
| 895 | - }else{ |
|
| 894 | + } else{ |
|
| 896 | 895 | return bab_getInstance($this->classPrefix . 'Ui')->setApp($this); |
| 897 | 896 | } |
| 898 | 897 | } |