@@ -75,8 +75,8 @@ |
||
75 | 75 | public function serialize(AppRecord $record) |
76 | 76 | { |
77 | 77 | $values = $record->getValues(); |
78 | - foreach ($values as $key => $value){ |
|
79 | - if($value instanceof ORMRecordSet){ |
|
78 | + foreach ($values as $key => $value) { |
|
79 | + if ($value instanceof ORMRecordSet) { |
|
80 | 80 | $values[$key] = $value->id; |
81 | 81 | } |
82 | 82 | } |
@@ -136,7 +136,7 @@ |
||
136 | 136 | |
137 | 137 | $displayable = $field->output($value); |
138 | 138 | |
139 | - switch(true) { |
|
139 | + switch (true) { |
|
140 | 140 | case ($field instanceof ORMTextField): |
141 | 141 | $displayable = $W->RichText($displayable)->setRenderingOptions(BAB_HTML_ALL ^ BAB_HTML_P); |
142 | 142 | break; |
@@ -71,17 +71,17 @@ discard block |
||
71 | 71 | */ |
72 | 72 | public function getRecordSet() |
73 | 73 | { |
74 | - if(isset($this->recordSet)){ |
|
74 | + if (isset($this->recordSet)) { |
|
75 | 75 | return $this->recordSet; |
76 | 76 | } |
77 | 77 | |
78 | 78 | $parentField = $this->criteria->getField(); |
79 | 79 | |
80 | - if(! isset($parentField)){ |
|
80 | + if (!isset($parentField)) { |
|
81 | 81 | return null; |
82 | 82 | } |
83 | 83 | |
84 | - do{ |
|
84 | + do { |
|
85 | 85 | $field = $parentField; |
86 | 86 | $parentField = $field->getParentSet(); |
87 | 87 | } |
@@ -134,8 +134,8 @@ discard block |
||
134 | 134 | |
135 | 135 | $classPrefix = $App->classPrefix; |
136 | 136 | |
137 | - foreach ($recordSetFields as $fieldName => $recordSetField){ |
|
138 | - if($recordSetField instanceof ORMManyRelation){ |
|
137 | + foreach ($recordSetFields as $fieldName => $recordSetField) { |
|
138 | + if ($recordSetField instanceof ORMManyRelation) { |
|
139 | 139 | /* @var $recordSetField ORMManyRelation */ |
140 | 140 | $fieldDescription = $fieldName; |
141 | 141 | $path = $fieldName; |
@@ -144,28 +144,28 @@ discard block |
||
144 | 144 | $foreignRecordSet = $App->$foreignSetName(); |
145 | 145 | $foreignRecordSetFields = $foreignRecordSet->getVisibilityCriteriaFields(); |
146 | 146 | |
147 | - foreach ($foreignRecordSetFields as $foreignFieldName => $foreignRecordSetField){ |
|
147 | + foreach ($foreignRecordSetFields as $foreignFieldName => $foreignRecordSetField) { |
|
148 | 148 | $foreignFieldName = $foreignRecordSetField->getName(); |
149 | 149 | $foreignFieldDescription = $foreignRecordSetField->getDescription(); |
150 | - if(substr($foreignFieldName, 0, 1) !== '_'){ |
|
150 | + if (substr($foreignFieldName, 0, 1) !== '_') { |
|
151 | 151 | $foreignFieldDescription = $App->translate($foreignFieldDescription); |
152 | 152 | } |
153 | - if(empty($foreignFieldDescription)){ |
|
153 | + if (empty($foreignFieldDescription)) { |
|
154 | 154 | $foreignFieldDescription = $foreignFieldName; |
155 | 155 | } |
156 | - $foreignPath = $path . '/' . $foreignRecordSetField->getPath(); |
|
156 | + $foreignPath = $path.'/'.$foreignRecordSetField->getPath(); |
|
157 | 157 | |
158 | 158 | $recordSetFieldSelect->addOption($foreignPath, $foreignFieldDescription, $fieldName); |
159 | 159 | |
160 | - if($foreignRecordSetField instanceof ORMBoolInterface){ |
|
160 | + if ($foreignRecordSetField instanceof ORMBoolInterface) { |
|
161 | 161 | $booleanFieldPathes[] = $foreignPath; |
162 | 162 | } |
163 | - else{ |
|
163 | + else { |
|
164 | 164 | $defaultFieldPathes[] = $foreignPath; |
165 | 165 | } |
166 | 166 | } |
167 | 167 | } |
168 | - elseif($recordSetField instanceof ORMFkField){ |
|
168 | + elseif ($recordSetField instanceof ORMFkField) { |
|
169 | 169 | /* @var $recordSetField ORMFkField */ |
170 | 170 | $fieldDescription = $fieldName; |
171 | 171 | $path = $fieldName; |
@@ -174,38 +174,38 @@ discard block |
||
174 | 174 | $foreignRecordSet = $App->$foreignSetName(); |
175 | 175 | $foreignRecordSetFields = $foreignRecordSet->getVisibilityCriteriaFields(); |
176 | 176 | |
177 | - foreach ($foreignRecordSetFields as $foreignFieldName => $foreignRecordSetField){ |
|
177 | + foreach ($foreignRecordSetFields as $foreignFieldName => $foreignRecordSetField) { |
|
178 | 178 | $foreignFieldDescription = $foreignFieldName; |
179 | - $foreignPath = $path . '/' . $foreignFieldName; |
|
179 | + $foreignPath = $path.'/'.$foreignFieldName; |
|
180 | 180 | |
181 | 181 | $recordSetFieldSelect->addOption($foreignPath, $foreignFieldDescription, $fieldName); |
182 | 182 | |
183 | - if($foreignRecordSetField instanceof ORMBoolInterface){ |
|
183 | + if ($foreignRecordSetField instanceof ORMBoolInterface) { |
|
184 | 184 | $booleanFieldPathes[] = $foreignPath; |
185 | 185 | } |
186 | - else{ |
|
186 | + else { |
|
187 | 187 | $defaultFieldPathes[] = $foreignPath; |
188 | 188 | } |
189 | 189 | } |
190 | 190 | } |
191 | - else{ |
|
191 | + else { |
|
192 | 192 | /* @var $recordSetField ORMField */ |
193 | 193 | $fieldName = $recordSetField->getName(); |
194 | 194 | $fieldDescription = $recordSetField->getDescription(); |
195 | - if(substr($fieldName, 0, 1) !== '_'){ |
|
195 | + if (substr($fieldName, 0, 1) !== '_') { |
|
196 | 196 | $fieldDescription = $App->translate($fieldDescription); |
197 | 197 | } |
198 | - if(empty($fieldDescription)){ |
|
198 | + if (empty($fieldDescription)) { |
|
199 | 199 | $fieldDescription = $fieldName; |
200 | 200 | } |
201 | 201 | $path = $recordSetField->getPath(); |
202 | 202 | |
203 | 203 | $recordSetFieldSelect->addOption($path, $fieldDescription); |
204 | 204 | |
205 | - if($recordSetField instanceof ORMBoolInterface){ |
|
205 | + if ($recordSetField instanceof ORMBoolInterface) { |
|
206 | 206 | $booleanFieldPathes[] = $path; |
207 | 207 | } |
208 | - else{ |
|
208 | + else { |
|
209 | 209 | $defaultFieldPathes[] = $path; |
210 | 210 | } |
211 | 211 | } |
@@ -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 |
@@ -65,15 +65,15 @@ discard block |
||
65 | 65 | ->_AND_($customSectionSet->object->is($customSection->object))); |
66 | 66 | |
67 | 67 | $allViewFieldNames = array(); |
68 | - foreach ($allViewSections as $viewSection){ |
|
68 | + foreach ($allViewSections as $viewSection) { |
|
69 | 69 | $fields = $viewSection->getFields(); |
70 | - foreach ($fields as $field){ |
|
71 | - $allViewFieldNames[$field['fieldname']] = $viewSection->view . ',' . $viewSection->rank . ',' . $viewSection->id; |
|
70 | + foreach ($fields as $field) { |
|
71 | + $allViewFieldNames[$field['fieldname']] = $viewSection->view.','.$viewSection->rank.','.$viewSection->id; |
|
72 | 72 | } |
73 | 73 | } |
74 | 74 | |
75 | 75 | $box = $W->VBoxItems(); |
76 | - if(isset($itemId)){ |
|
76 | + if (isset($itemId)) { |
|
77 | 77 | $box->setId($itemId); |
78 | 78 | } |
79 | 79 | |
@@ -88,7 +88,7 @@ discard block |
||
88 | 88 | |
89 | 89 | \bab_Sort::asort($availableFields, 'description', \bab_Sort::CASE_INSENSITIVE); |
90 | 90 | |
91 | - foreach ($availableFields as $field){ |
|
91 | + foreach ($availableFields as $field) { |
|
92 | 92 | $fieldName = $field['name']; |
93 | 93 | $fieldDescription = $field['description']; |
94 | 94 | |
@@ -142,7 +142,7 @@ discard block |
||
142 | 142 | |
143 | 143 | $field = $customSection->getField($fieldName); |
144 | 144 | |
145 | - if(! isset($field)){ |
|
145 | + if (!isset($field)) { |
|
146 | 146 | return null; |
147 | 147 | } |
148 | 148 | |
@@ -158,11 +158,11 @@ discard block |
||
158 | 158 | |
159 | 159 | $field = $availableFields[$fieldName]; |
160 | 160 | $fieldDescription = $field['description']; |
161 | - if(substr($fieldName, 0, 1) !== '_'){ |
|
161 | + if (substr($fieldName, 0, 1) !== '_') { |
|
162 | 162 | $fieldDescription = $App->translate($fieldDescription); |
163 | 163 | } |
164 | 164 | |
165 | - if(empty($field)){ |
|
165 | + if (empty($field)) { |
|
166 | 166 | // continue; |
167 | 167 | } |
168 | 168 | |
@@ -263,10 +263,10 @@ discard block |
||
263 | 263 | $W = bab_Widgets(); |
264 | 264 | |
265 | 265 | $customSectionSet = $App->CustomContainerSet(); |
266 | - if(isset($id)){ |
|
266 | + if (isset($id)) { |
|
267 | 267 | $record = $customSectionSet->request($id); |
268 | 268 | } |
269 | - else{ |
|
269 | + else { |
|
270 | 270 | $record = $customSectionSet->newRecord(); |
271 | 271 | $record->object = $object; |
272 | 272 | } |
@@ -279,7 +279,7 @@ discard block |
||
279 | 279 | $editor = new AppEditor($App); |
280 | 280 | $editor->setHiddenValue('tg', $App->controllerTg); |
281 | 281 | $editor->setHiddenValue('data[view]', $view); |
282 | - if($record->id){ |
|
282 | + if ($record->id) { |
|
283 | 283 | $editor->setHiddenValue('data[id]', $record->id); |
284 | 284 | } |
285 | 285 | $editor->setName('data'); |
@@ -357,10 +357,10 @@ discard block |
||
357 | 357 | $record = $recordSet->request($id); |
358 | 358 | |
359 | 359 | $object = $record->object; |
360 | - if(empty($object)){ |
|
360 | + if (empty($object)) { |
|
361 | 361 | $object = $record->container()->object; |
362 | 362 | } |
363 | - if(strpos($object, $App->classPrefix) !== false){ |
|
363 | + if (strpos($object, $App->classPrefix) !== false) { |
|
364 | 364 | $object = str_replace($App->classPrefix, '', $object); |
365 | 365 | } |
366 | 366 | $object .= 'Set'; |
@@ -375,25 +375,25 @@ discard block |
||
375 | 375 | $manySets = $objectRecordSet->getHasManyRelations(); |
376 | 376 | $oneSets = $objectRecordSet->getHasOneRelations(); |
377 | 377 | |
378 | - if(! empty($record->visibilityCriteria)){ |
|
378 | + if (!empty($record->visibilityCriteria)) { |
|
379 | 379 | $arrCriteria = json_decode($record->visibilityCriteria, true); |
380 | 380 | |
381 | 381 | $data = array(); |
382 | - foreach ($arrCriteria as $fieldName => $operation){ |
|
382 | + foreach ($arrCriteria as $fieldName => $operation) { |
|
383 | 383 | $data['field'] = $fieldName; |
384 | - foreach ($operation as $condition => $value){ |
|
384 | + foreach ($operation as $condition => $value) { |
|
385 | 385 | $data['condition']['default'] = $condition; |
386 | 386 | $data['condition']['bool'] = $condition; |
387 | - if(is_array($value)){ |
|
388 | - foreach ($value as $key => $subValue){ |
|
389 | - foreach ($manySets as $manyFieldName => $manyRelation){ |
|
390 | - if($key . 'Set' == $manyRelation->getForeignSetClassName()){ |
|
391 | - foreach ($subValue as $subFieldName => $subConditions){ |
|
392 | - if($subFieldName === '_foreignField'){ |
|
387 | + if (is_array($value)) { |
|
388 | + foreach ($value as $key => $subValue) { |
|
389 | + foreach ($manySets as $manyFieldName => $manyRelation) { |
|
390 | + if ($key.'Set' == $manyRelation->getForeignSetClassName()) { |
|
391 | + foreach ($subValue as $subFieldName => $subConditions) { |
|
392 | + if ($subFieldName === '_foreignField') { |
|
393 | 393 | continue; |
394 | 394 | } |
395 | 395 | $data['field'] = "{$manyFieldName}/{$subFieldName}"; |
396 | - foreach ($subConditions as $subCondition => $subConditionValue){ |
|
396 | + foreach ($subConditions as $subCondition => $subConditionValue) { |
|
397 | 397 | $data['condition']['default'] = $subCondition; |
398 | 398 | $data['condition']['bool'] = $subCondition; |
399 | 399 | $value = $subConditionValue; |
@@ -402,14 +402,14 @@ discard block |
||
402 | 402 | break; |
403 | 403 | } |
404 | 404 | } |
405 | - foreach ($oneSets as $oneFieldName => $oneRelation){ |
|
406 | - if($key . 'Set' == $oneRelation->getForeignSetClassName()){ |
|
407 | - foreach ($subValue as $subFieldName => $subConditions){ |
|
408 | - if($subFieldName === '_foreignField'){ |
|
405 | + foreach ($oneSets as $oneFieldName => $oneRelation) { |
|
406 | + if ($key.'Set' == $oneRelation->getForeignSetClassName()) { |
|
407 | + foreach ($subValue as $subFieldName => $subConditions) { |
|
408 | + if ($subFieldName === '_foreignField') { |
|
409 | 409 | continue; |
410 | 410 | } |
411 | 411 | $data['field'] = "{$oneFieldName}/{$subFieldName}"; |
412 | - foreach ($subConditions as $subCondition => $subConditionValue){ |
|
412 | + foreach ($subConditions as $subCondition => $subConditionValue) { |
|
413 | 413 | $data['condition']['default'] = $subCondition; |
414 | 414 | $data['condition']['bool'] = $subCondition; |
415 | 415 | $value = $subConditionValue; |
@@ -454,7 +454,7 @@ discard block |
||
454 | 454 | protected function preSave(ORMRecord $record, $data) |
455 | 455 | { |
456 | 456 | parent::preSave($record, $data); |
457 | - if(! isset($record->id) || empty($record->id)){ |
|
457 | + if (!isset($record->id) || empty($record->id)) { |
|
458 | 458 | $set = $record->getParentSet(); |
459 | 459 | $nbContainers = $set->select($set->all(array( |
460 | 460 | $set->object->is($record->object), |
@@ -489,10 +489,10 @@ discard block |
||
489 | 489 | $record = $recordSet->request($data['id']); |
490 | 490 | |
491 | 491 | $object = $record->object; |
492 | - if(empty($object)){ |
|
492 | + if (empty($object)) { |
|
493 | 493 | $object = $record->container()->object; |
494 | 494 | } |
495 | - if(strpos($object, $App->classPrefix) !== false){ |
|
495 | + if (strpos($object, $App->classPrefix) !== false) { |
|
496 | 496 | $object = str_replace($App->classPrefix, '', $object); |
497 | 497 | } |
498 | 498 | $object .= 'Set'; |
@@ -503,14 +503,14 @@ discard block |
||
503 | 503 | $field = $data['field']; |
504 | 504 | $condition = $data['condition']; |
505 | 505 | |
506 | - if(strpos($field, '/') !== false){ |
|
506 | + if (strpos($field, '/') !== false) { |
|
507 | 507 | // The selected field is a hasMany or a hasOne relation |
508 | 508 | list ($selectedRelation, $selectedField) = explode('/', $field); |
509 | 509 | $classPrefix = $App->classPrefix; |
510 | 510 | |
511 | 511 | $manyRelations = $objectRecordSet->getHasManyRelations(); |
512 | - foreach ($manyRelations as $manyRelation){ |
|
513 | - if($selectedRelation != $manyRelation->getOwnerSetFieldName()){ |
|
512 | + foreach ($manyRelations as $manyRelation) { |
|
513 | + if ($selectedRelation != $manyRelation->getOwnerSetFieldName()) { |
|
514 | 514 | continue; |
515 | 515 | } |
516 | 516 | $foreignSetName = str_replace($classPrefix, '', $manyRelation->getForeignSetClassName()); |
@@ -518,13 +518,13 @@ discard block |
||
518 | 518 | |
519 | 519 | $visibilityCriteria = ''; |
520 | 520 | |
521 | - if($foreignSet){ |
|
521 | + if ($foreignSet) { |
|
522 | 522 | $selectedManyField = $foreignSet->$selectedField; |
523 | 523 | |
524 | - if($selectedManyField instanceof ORMBoolInterface){ |
|
524 | + if ($selectedManyField instanceof ORMBoolInterface) { |
|
525 | 525 | $condition = $condition['bool']; |
526 | 526 | } |
527 | - else{ |
|
527 | + else { |
|
528 | 528 | $condition = $condition['default']; |
529 | 529 | } |
530 | 530 | |
@@ -536,9 +536,9 @@ discard block |
||
536 | 536 | } |
537 | 537 | |
538 | 538 | $oneRelations = $objectRecordSet->getHasOneRelations(); |
539 | - foreach ($oneRelations as $oneRelation){ |
|
539 | + foreach ($oneRelations as $oneRelation) { |
|
540 | 540 | /* @var $oneRelation ORMOneRelation*/ |
541 | - if($selectedRelation != $oneRelation->getOwnerSetFieldName()){ |
|
541 | + if ($selectedRelation != $oneRelation->getOwnerSetFieldName()) { |
|
542 | 542 | continue; |
543 | 543 | } |
544 | 544 | $foreignSetClassName = $oneRelation->getForeignSetClassName(); |
@@ -547,13 +547,13 @@ discard block |
||
547 | 547 | |
548 | 548 | $visibilityCriteria = ''; |
549 | 549 | |
550 | - if($foreignSet){ |
|
550 | + if ($foreignSet) { |
|
551 | 551 | $selectedOneField = $foreignSet->$selectedField; |
552 | 552 | |
553 | - if($selectedOneField instanceof ORMBoolInterface){ |
|
553 | + if ($selectedOneField instanceof ORMBoolInterface) { |
|
554 | 554 | $condition = $condition['bool']; |
555 | 555 | } |
556 | - else{ |
|
556 | + else { |
|
557 | 557 | $condition = $condition['default']; |
558 | 558 | } |
559 | 559 | |
@@ -563,20 +563,20 @@ discard block |
||
563 | 563 | break; |
564 | 564 | } |
565 | 565 | } |
566 | - else{ |
|
566 | + else { |
|
567 | 567 | |
568 | 568 | $field = $objectRecordSet->$field; |
569 | 569 | |
570 | - if($field instanceof ORMBoolInterface){ |
|
570 | + if ($field instanceof ORMBoolInterface) { |
|
571 | 571 | $condition = $condition['bool']; |
572 | 572 | } |
573 | - else{ |
|
573 | + else { |
|
574 | 574 | $condition = $condition['default']; |
575 | 575 | } |
576 | 576 | |
577 | 577 | $visibilityCriteria = ''; |
578 | 578 | |
579 | - if(! empty($condition)){ |
|
579 | + if (!empty($condition)) { |
|
580 | 580 | $criteria = $field->{$condition}($data['value']); |
581 | 581 | $visibilityCriteria = $criteria->toJson(); |
582 | 582 | } |
@@ -611,7 +611,7 @@ discard block |
||
611 | 611 | |
612 | 612 | $containerBoxes = $W->Items(); |
613 | 613 | |
614 | - foreach ($customContainers as $customContainer){ |
|
614 | + foreach ($customContainers as $customContainer) { |
|
615 | 615 | |
616 | 616 | $menu = $W->HBoxItems($W->Link('', $customSectionCtrl->edit($customContainer->id)) |
617 | 617 | ->addClass('icon', \Func_Icons::ACTIONS_LIST_ADD) |
@@ -626,7 +626,7 @@ discard block |
||
626 | 626 | $menu->setSizePolicy(\Func_Icons::ICON_LEFT_16); |
627 | 627 | |
628 | 628 | $hasVisibilityBox = $W->FlowItems()->addClass('widget-100'); |
629 | - if(! empty($customContainer->visibilityCriteria)){ |
|
629 | + if (!empty($customContainer->visibilityCriteria)) { |
|
630 | 630 | $hasVisibilityBox->addItem($W->HBoxItems($W->Label($App->translate('This container has a visibility condition'))) |
631 | 631 | ->setSizePolicy('alert alert-warning widget-100pc')); |
632 | 632 | } |
@@ -637,7 +637,7 @@ discard block |
||
637 | 637 | ->addClass($customContainer->classname)); |
638 | 638 | } |
639 | 639 | |
640 | - if(isset($itemId)){ |
|
640 | + if (isset($itemId)) { |
|
641 | 641 | $containerBoxes->setId($itemId); |
642 | 642 | } |
643 | 643 | |
@@ -663,7 +663,7 @@ discard block |
||
663 | 663 | $customSectionSet = $App->CustomSectionSet(); |
664 | 664 | |
665 | 665 | $containersValues = array(); |
666 | - foreach ($customContainers as $customContainer){ |
|
666 | + foreach ($customContainers as $customContainer) { |
|
667 | 667 | $values = $customContainer->getValues(); |
668 | 668 | unset($values['id']); |
669 | 669 | unset($values['uuid']); |
@@ -676,7 +676,7 @@ discard block |
||
676 | 676 | unset($values['deleted']); |
677 | 677 | $values['customSections'] = array(); |
678 | 678 | $customSections = $customSectionSet->select($customSectionSet->container->is($customContainer->id)); |
679 | - foreach ($customSections as $customSection){ |
|
679 | + foreach ($customSections as $customSection) { |
|
680 | 680 | $customSectionValues = $customSection->getValues(); |
681 | 681 | unset($customSectionValues['id']); |
682 | 682 | unset($customSectionValues['uuid']); |
@@ -695,8 +695,8 @@ discard block |
||
695 | 695 | } |
696 | 696 | |
697 | 697 | header('Content-type: application/json'); |
698 | - header('Content-Disposition: attachment; filename="' . $object . '.' . ($view === '' ? 'default' : $view) . '.json"' . "\n"); |
|
699 | - if(bab_charset::getIso() != bab_charset::UTF_8){ |
|
698 | + header('Content-Disposition: attachment; filename="'.$object.'.'.($view === '' ? 'default' : $view).'.json"'."\n"); |
|
699 | + if (bab_charset::getIso() != bab_charset::UTF_8) { |
|
700 | 700 | $containersValues = app_utf8Encode($containersValues); |
701 | 701 | } |
702 | 702 | $json = bab_json_encode($containersValues); |
@@ -755,12 +755,12 @@ discard block |
||
755 | 755 | $files->push($containersfile['uid']); |
756 | 756 | |
757 | 757 | $data = null; |
758 | - foreach ($files as $f){ |
|
758 | + foreach ($files as $f) { |
|
759 | 759 | $data = file_get_contents($f->toString()); |
760 | 760 | break; |
761 | 761 | } |
762 | 762 | |
763 | - if(! isset($data)){ |
|
763 | + if (!isset($data)) { |
|
764 | 764 | $this->addError($App->translate('Unable to get file content')); |
765 | 765 | return true; |
766 | 766 | } |
@@ -776,13 +776,13 @@ discard block |
||
776 | 776 | $customContainerSet->delete($customContainerSet->view->is($view) |
777 | 777 | ->_AND_($customContainerSet->object->is($object))); |
778 | 778 | |
779 | - foreach ($containersValues as $containerValues){ |
|
779 | + foreach ($containersValues as $containerValues) { |
|
780 | 780 | $customContainer = $customContainerSet->newRecord(); |
781 | 781 | $customContainer->setValues($containerValues); |
782 | 782 | $customContainer->object = $object; |
783 | 783 | $customContainer->view = $view; |
784 | 784 | $customContainer->save(); |
785 | - foreach ($containerValues['customSections'] as $sectionValues){ |
|
785 | + foreach ($containerValues['customSections'] as $sectionValues) { |
|
786 | 786 | $customSection = $customSectionSet->newRecord(); |
787 | 787 | $sectionValues['fields'] = json_encode($sectionValues['fields']); |
788 | 788 | $customSection->setValues($sectionValues); |
@@ -916,9 +916,9 @@ discard block |
||
916 | 916 | |
917 | 917 | $rank = 0; |
918 | 918 | $currentContainerId = 0; |
919 | - foreach (array_keys($containers) as $containerFieldId){ |
|
919 | + foreach (array_keys($containers) as $containerFieldId) { |
|
920 | 920 | |
921 | - if(substr($containerFieldId, 0, 1) === '#'){ |
|
921 | + if (substr($containerFieldId, 0, 1) === '#') { |
|
922 | 922 | $currentContainerId = substr($containerFieldId, 1); |
923 | 923 | |
924 | 924 | $customContainer = $customContainerSet->request($customContainerSet->id->is($currentContainerId)); |
@@ -927,7 +927,7 @@ discard block |
||
927 | 927 | $containersRawFields[$currentContainerId] = $customContainer->getRawFields(); |
928 | 928 | |
929 | 929 | $customContainer->rank = $rank; |
930 | - $rank ++; |
|
930 | + $rank++; |
|
931 | 931 | $customContainer->save(); |
932 | 932 | continue; |
933 | 933 | } |
@@ -935,18 +935,18 @@ discard block |
||
935 | 935 | $containersFields[$currentContainerId][] = $containerFieldId; |
936 | 936 | } |
937 | 937 | |
938 | - foreach ($containersFields as $containerId => $containerFieldIds){ |
|
939 | - foreach ($containerFieldIds as $containerFieldId){ |
|
938 | + foreach ($containersFields as $containerId => $containerFieldIds) { |
|
939 | + foreach ($containerFieldIds as $containerFieldId) { |
|
940 | 940 | list ($srcContainerId, $srcfieldId) = explode('.', $containerFieldId); |
941 | - if(! isset($containersRawFields[$srcContainerId][$srcfieldId])){ |
|
941 | + if (!isset($containersRawFields[$srcContainerId][$srcfieldId])) { |
|
942 | 942 | return true; |
943 | 943 | } |
944 | 944 | } |
945 | 945 | } |
946 | 946 | |
947 | - foreach ($containersFields as $containerId => $containerFieldIds){ |
|
947 | + foreach ($containersFields as $containerId => $containerFieldIds) { |
|
948 | 948 | $newRawFields = array(); |
949 | - foreach ($containerFieldIds as $containerFieldId){ |
|
949 | + foreach ($containerFieldIds as $containerFieldId) { |
|
950 | 950 | list ($srcContainerId, $srcfieldId) = explode('.', $containerFieldId); |
951 | 951 | $newRawFields[] = $containersRawFields[$srcContainerId][$srcfieldId]; |
952 | 952 | } |
@@ -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){ |
@@ -61,7 +61,7 @@ discard block |
||
61 | 61 | $customSection = $customSectionSet->request($customSectionSet->id->is($section)); |
62 | 62 | |
63 | 63 | $object = $customSection->container->object; |
64 | - if(strpos($object, $App->classPrefix) !== false){ |
|
64 | + if (strpos($object, $App->classPrefix) !== false) { |
|
65 | 65 | list (, $object) = explode($App->classPrefix, $object); |
66 | 66 | } |
67 | 67 | $objectCtrl = $App->Controller()->$object(false); |
@@ -70,18 +70,18 @@ discard block |
||
70 | 70 | ->_AND_($customSectionSet->object->is($customSection->object))); |
71 | 71 | |
72 | 72 | $allViewFieldNames = array(); |
73 | - foreach ($allViewSections as $viewSection){ |
|
73 | + foreach ($allViewSections as $viewSection) { |
|
74 | 74 | $fields = $viewSection->getFields(); |
75 | - foreach ($fields as $field){ |
|
76 | - $allViewFieldNames[$field['fieldname']] = $viewSection->view . ',' . $viewSection->rank . ',' . $viewSection->id; |
|
77 | - foreach ($field['fields'] as $subField){ |
|
78 | - $allViewFieldNames[$subField['fieldname']] = $viewSection->view . ',' . $viewSection->rank . ',' . $viewSection->id; |
|
75 | + foreach ($fields as $field) { |
|
76 | + $allViewFieldNames[$field['fieldname']] = $viewSection->view.','.$viewSection->rank.','.$viewSection->id; |
|
77 | + foreach ($field['fields'] as $subField) { |
|
78 | + $allViewFieldNames[$subField['fieldname']] = $viewSection->view.','.$viewSection->rank.','.$viewSection->id; |
|
79 | 79 | } |
80 | 80 | } |
81 | 81 | } |
82 | 82 | |
83 | 83 | $box = $W->VBoxItems(); |
84 | - if(isset($itemId)){ |
|
84 | + if (isset($itemId)) { |
|
85 | 85 | $box->setId($itemId); |
86 | 86 | } |
87 | 87 | |
@@ -96,7 +96,7 @@ discard block |
||
96 | 96 | |
97 | 97 | \bab_Sort::asort($availableFields, 'description', \bab_Sort::CASE_INSENSITIVE); |
98 | 98 | |
99 | - foreach ($availableFields as $field){ |
|
99 | + foreach ($availableFields as $field) { |
|
100 | 100 | $fieldName = $field['name']; |
101 | 101 | $fieldDescription = $field['description']; |
102 | 102 | |
@@ -151,7 +151,7 @@ discard block |
||
151 | 151 | |
152 | 152 | $field = $customSection->getField($fieldName); |
153 | 153 | |
154 | - if(! isset($field)){ |
|
154 | + if (!isset($field)) { |
|
155 | 155 | return null; |
156 | 156 | } |
157 | 157 | |
@@ -168,11 +168,11 @@ discard block |
||
168 | 168 | |
169 | 169 | $field = $availableFields[$fieldName]; |
170 | 170 | $fieldDescription = $field['description']; |
171 | - if(substr($fieldName, 0, 1) !== '_'){ |
|
171 | + if (substr($fieldName, 0, 1) !== '_') { |
|
172 | 172 | $fieldDescription = $App->translate($fieldDescription); |
173 | 173 | } |
174 | 174 | |
175 | - if(empty($field)){ |
|
175 | + if (empty($field)) { |
|
176 | 176 | // continue; |
177 | 177 | } |
178 | 178 | |
@@ -242,12 +242,12 @@ discard block |
||
242 | 242 | |
243 | 243 | $groupField = $customSection->getField($fieldGroupName); |
244 | 244 | |
245 | - if(! isset($groupField)){ |
|
245 | + if (!isset($groupField)) { |
|
246 | 246 | return null; |
247 | 247 | } |
248 | 248 | |
249 | 249 | $field = $groupField['fields'][$fieldName]; |
250 | - if(! isset($field)){ |
|
250 | + if (!isset($field)) { |
|
251 | 251 | return null; |
252 | 252 | } |
253 | 253 | |
@@ -263,11 +263,11 @@ discard block |
||
263 | 263 | |
264 | 264 | $field = $availableFields[$fieldName]; |
265 | 265 | $fieldDescription = $field['description']; |
266 | - if(substr($fieldName, 0, 1) !== '_'){ |
|
266 | + if (substr($fieldName, 0, 1) !== '_') { |
|
267 | 267 | $fieldDescription = $App->translate($fieldDescription); |
268 | 268 | } |
269 | 269 | |
270 | - if(empty($field)){ |
|
270 | + if (empty($field)) { |
|
271 | 271 | // continue; |
272 | 272 | } |
273 | 273 | |
@@ -350,12 +350,12 @@ discard block |
||
350 | 350 | |
351 | 351 | $customSection = $customSectionSet->request($customSectionSet->id->is($section)); |
352 | 352 | $fields = $customSection->getFields(); |
353 | - if(! isset($fields[$fieldGroupName])){ |
|
353 | + if (!isset($fields[$fieldGroupName])) { |
|
354 | 354 | throw new AppException($App->translate('This fields group does not seem to exist')); |
355 | 355 | } |
356 | 356 | |
357 | 357 | $object = $customSection->container->object; |
358 | - if(strpos($object, $App->classPrefix) !== false){ |
|
358 | + if (strpos($object, $App->classPrefix) !== false) { |
|
359 | 359 | list (, $object) = explode($App->classPrefix, $object); |
360 | 360 | } |
361 | 361 | |
@@ -365,18 +365,18 @@ discard block |
||
365 | 365 | ->_AND_($customSectionSet->object->is($customSection->object))); |
366 | 366 | |
367 | 367 | $allViewFieldNames = array(); |
368 | - foreach ($allViewSections as $viewSection){ |
|
368 | + foreach ($allViewSections as $viewSection) { |
|
369 | 369 | $fields = $viewSection->getFields(); |
370 | - foreach ($fields as $field){ |
|
371 | - $allViewFieldNames[$field['fieldname']] = $viewSection->view . ',' . $viewSection->rank . ',' . $viewSection->id; |
|
372 | - foreach ($field['fields'] as $subField){ |
|
373 | - $allViewFieldNames[$subField['fieldname']] = $viewSection->view . ',' . $viewSection->rank . ',' . $viewSection->id; |
|
370 | + foreach ($fields as $field) { |
|
371 | + $allViewFieldNames[$field['fieldname']] = $viewSection->view.','.$viewSection->rank.','.$viewSection->id; |
|
372 | + foreach ($field['fields'] as $subField) { |
|
373 | + $allViewFieldNames[$subField['fieldname']] = $viewSection->view.','.$viewSection->rank.','.$viewSection->id; |
|
374 | 374 | } |
375 | 375 | } |
376 | 376 | } |
377 | 377 | |
378 | 378 | $box = $W->VBoxItems(); |
379 | - if(isset($itemId)){ |
|
379 | + if (isset($itemId)) { |
|
380 | 380 | $box->setId($itemId); |
381 | 381 | } |
382 | 382 | |
@@ -393,7 +393,7 @@ discard block |
||
393 | 393 | |
394 | 394 | \bab_Sort::asort($availableFields, 'description', \bab_Sort::CASE_INSENSITIVE); |
395 | 395 | |
396 | - foreach ($availableFields as $field){ |
|
396 | + foreach ($availableFields as $field) { |
|
397 | 397 | $fieldName = $field['name']; |
398 | 398 | $fieldDescription = $field['description']; |
399 | 399 | |
@@ -505,10 +505,10 @@ discard block |
||
505 | 505 | $container = $customContainerSet->request($customContainerSet->id->is($container)); |
506 | 506 | |
507 | 507 | $customSectionSet = $App->CustomSectionSet(); |
508 | - if(isset($id)){ |
|
508 | + if (isset($id)) { |
|
509 | 509 | $record = $customSectionSet->request($id); |
510 | 510 | } |
511 | - else{ |
|
511 | + else { |
|
512 | 512 | $record = $customSectionSet->newRecord(); |
513 | 513 | $record->container = $container->id; |
514 | 514 | } |
@@ -520,7 +520,7 @@ discard block |
||
520 | 520 | |
521 | 521 | $editor = new AppEditor($App); |
522 | 522 | $editor->setHiddenValue('tg', $App->controllerTg); |
523 | - if($record->id){ |
|
523 | + if ($record->id) { |
|
524 | 524 | $editor->setHiddenValue('data[id]', $record->id); |
525 | 525 | } |
526 | 526 | $editor->setName('data'); |
@@ -536,16 +536,16 @@ discard block |
||
536 | 536 | |
537 | 537 | $options = array(); |
538 | 538 | $rank = 1; |
539 | - foreach ($containers as $container){ |
|
539 | + foreach ($containers as $container) { |
|
540 | 540 | $options[$container->id] = sprintf('%d (%s)', $rank, $container->name); |
541 | - $rank ++; |
|
541 | + $rank++; |
|
542 | 542 | } |
543 | 543 | |
544 | 544 | $containerSections = $customSectionSet->select($customSectionSet->container->is($container->id)) |
545 | 545 | ->orderDesc($customSectionSet->rank); |
546 | 546 | |
547 | 547 | $nbSections = 0; |
548 | - foreach ($containerSections as $containerSection){ |
|
548 | + foreach ($containerSections as $containerSection) { |
|
549 | 549 | $nbSections = $containerSection->rank + 1; |
550 | 550 | break; |
551 | 551 | } |
@@ -629,10 +629,10 @@ discard block |
||
629 | 629 | $record = $recordSet->request($id); |
630 | 630 | |
631 | 631 | $object = $record->object; |
632 | - if(empty($object)){ |
|
632 | + if (empty($object)) { |
|
633 | 633 | $object = $record->container()->object; |
634 | 634 | } |
635 | - if(strpos($object, $App->classPrefix) !== false){ |
|
635 | + if (strpos($object, $App->classPrefix) !== false) { |
|
636 | 636 | $object = str_replace($App->classPrefix, '', $object); |
637 | 637 | } |
638 | 638 | $object .= 'Set'; |
@@ -647,25 +647,25 @@ discard block |
||
647 | 647 | $manySets = $objectRecordSet->getHasManyRelations(); |
648 | 648 | $oneSets = $objectRecordSet->getHasOneRelations(); |
649 | 649 | |
650 | - if(! empty($record->visibilityCriteria)){ |
|
650 | + if (!empty($record->visibilityCriteria)) { |
|
651 | 651 | $arrCriteria = json_decode($record->visibilityCriteria, true); |
652 | 652 | |
653 | 653 | $data = array(); |
654 | - foreach ($arrCriteria as $fieldName => $operation){ |
|
654 | + foreach ($arrCriteria as $fieldName => $operation) { |
|
655 | 655 | $data['field'] = $fieldName; |
656 | - foreach ($operation as $condition => $value){ |
|
656 | + foreach ($operation as $condition => $value) { |
|
657 | 657 | $data['condition']['default'] = $condition; |
658 | 658 | $data['condition']['bool'] = $condition; |
659 | - if(is_array($value)){ |
|
660 | - foreach ($value as $key => $subValue){ |
|
661 | - foreach ($manySets as $manyFieldName => $manyRelation){ |
|
662 | - if($key . 'Set' == $manyRelation->getForeignSetClassName()){ |
|
663 | - foreach ($subValue as $subFieldName => $subConditions){ |
|
664 | - if($subFieldName === '_foreignField'){ |
|
659 | + if (is_array($value)) { |
|
660 | + foreach ($value as $key => $subValue) { |
|
661 | + foreach ($manySets as $manyFieldName => $manyRelation) { |
|
662 | + if ($key.'Set' == $manyRelation->getForeignSetClassName()) { |
|
663 | + foreach ($subValue as $subFieldName => $subConditions) { |
|
664 | + if ($subFieldName === '_foreignField') { |
|
665 | 665 | continue; |
666 | 666 | } |
667 | 667 | $data['field'] = "{$manyFieldName}/{$subFieldName}"; |
668 | - foreach ($subConditions as $subCondition => $subConditionValue){ |
|
668 | + foreach ($subConditions as $subCondition => $subConditionValue) { |
|
669 | 669 | $data['condition']['default'] = $subCondition; |
670 | 670 | $data['condition']['bool'] = $subCondition; |
671 | 671 | $value = $subConditionValue; |
@@ -674,14 +674,14 @@ discard block |
||
674 | 674 | break; |
675 | 675 | } |
676 | 676 | } |
677 | - foreach ($oneSets as $oneFieldName => $oneRelation){ |
|
678 | - if($key . 'Set' == $oneRelation->getForeignSetClassName()){ |
|
679 | - foreach ($subValue as $subFieldName => $subConditions){ |
|
680 | - if($subFieldName === '_foreignField'){ |
|
677 | + foreach ($oneSets as $oneFieldName => $oneRelation) { |
|
678 | + if ($key.'Set' == $oneRelation->getForeignSetClassName()) { |
|
679 | + foreach ($subValue as $subFieldName => $subConditions) { |
|
680 | + if ($subFieldName === '_foreignField') { |
|
681 | 681 | continue; |
682 | 682 | } |
683 | 683 | $data['field'] = "{$oneFieldName}/{$subFieldName}"; |
684 | - foreach ($subConditions as $subCondition => $subConditionValue){ |
|
684 | + foreach ($subConditions as $subCondition => $subConditionValue) { |
|
685 | 685 | $data['condition']['default'] = $subCondition; |
686 | 686 | $data['condition']['bool'] = $subCondition; |
687 | 687 | $value = $subConditionValue; |
@@ -716,7 +716,7 @@ discard block |
||
716 | 716 | */ |
717 | 717 | public function save($data = null) |
718 | 718 | { |
719 | - if(! isset($data['id']) && isset($data['container']) && $data['container'] != 0 && ! isset($data['rank'])){ |
|
719 | + if (!isset($data['id']) && isset($data['container']) && $data['container'] != 0 && !isset($data['rank'])) { |
|
720 | 720 | $set = $this->getRecordSet(); |
721 | 721 | $data['rank'] = $set->select($set->container->is($data['container'])) |
722 | 722 | ->count(); |
@@ -749,11 +749,11 @@ discard block |
||
749 | 749 | $set->rank->greaterThanOrEqual($record->rank) |
750 | 750 | ))); |
751 | 751 | |
752 | - $position ++; |
|
753 | - foreach ($afterSections as $afterSection){ |
|
752 | + $position++; |
|
753 | + foreach ($afterSections as $afterSection) { |
|
754 | 754 | $afterSection->rank = $position; |
755 | 755 | $afterSection->save(); |
756 | - $position ++; |
|
756 | + $position++; |
|
757 | 757 | } |
758 | 758 | } |
759 | 759 | |
@@ -781,10 +781,10 @@ discard block |
||
781 | 781 | $record = $recordSet->request($data['id']); |
782 | 782 | |
783 | 783 | $object = $record->object; |
784 | - if(empty($object)){ |
|
784 | + if (empty($object)) { |
|
785 | 785 | $object = $record->container()->object; |
786 | 786 | } |
787 | - if(strpos($object, $App->classPrefix) !== false){ |
|
787 | + if (strpos($object, $App->classPrefix) !== false) { |
|
788 | 788 | $object = str_replace($App->classPrefix, '', $object); |
789 | 789 | } |
790 | 790 | $object .= 'Set'; |
@@ -794,14 +794,14 @@ discard block |
||
794 | 794 | $field = $data['field']; |
795 | 795 | $condition = $data['condition']; |
796 | 796 | |
797 | - if(strpos($field, '/') !== false){ |
|
797 | + if (strpos($field, '/') !== false) { |
|
798 | 798 | // The selected field is a hasMany or a hasOne relation |
799 | 799 | list ($selectedRelation, $selectedField) = explode('/', $field); |
800 | 800 | $classPrefix = $App->classPrefix; |
801 | 801 | |
802 | 802 | $manyRelations = $objectRecordSet->getHasManyRelations(); |
803 | - foreach ($manyRelations as $manyRelation){ |
|
804 | - if($selectedRelation != $manyRelation->getOwnerSetFieldName()){ |
|
803 | + foreach ($manyRelations as $manyRelation) { |
|
804 | + if ($selectedRelation != $manyRelation->getOwnerSetFieldName()) { |
|
805 | 805 | continue; |
806 | 806 | } |
807 | 807 | $foreignSetName = str_replace($classPrefix, '', $manyRelation->getForeignSetClassName()); |
@@ -809,13 +809,13 @@ discard block |
||
809 | 809 | |
810 | 810 | $visibilityCriteria = ''; |
811 | 811 | |
812 | - if($foreignSet){ |
|
812 | + if ($foreignSet) { |
|
813 | 813 | $selectedManyField = $foreignSet->$selectedField; |
814 | 814 | |
815 | - if($selectedManyField instanceof ORMBoolInterface){ |
|
815 | + if ($selectedManyField instanceof ORMBoolInterface) { |
|
816 | 816 | $condition = $condition['bool']; |
817 | 817 | } |
818 | - else{ |
|
818 | + else { |
|
819 | 819 | $condition = $condition['default']; |
820 | 820 | } |
821 | 821 | |
@@ -827,9 +827,9 @@ discard block |
||
827 | 827 | } |
828 | 828 | |
829 | 829 | $oneRelations = $objectRecordSet->getHasOneRelations(); |
830 | - foreach ($oneRelations as $oneRelation){ |
|
830 | + foreach ($oneRelations as $oneRelation) { |
|
831 | 831 | /* @var $oneRelation ORMOneRelation*/ |
832 | - if($selectedRelation != $oneRelation->getOwnerSetFieldName()){ |
|
832 | + if ($selectedRelation != $oneRelation->getOwnerSetFieldName()) { |
|
833 | 833 | continue; |
834 | 834 | } |
835 | 835 | $foreignSetClassName = $oneRelation->getForeignSetClassName(); |
@@ -838,13 +838,13 @@ discard block |
||
838 | 838 | |
839 | 839 | $visibilityCriteria = ''; |
840 | 840 | |
841 | - if($foreignSet){ |
|
841 | + if ($foreignSet) { |
|
842 | 842 | $selectedOneField = $foreignSet->$selectedField; |
843 | 843 | |
844 | - if($selectedOneField instanceof ORMBoolInterface){ |
|
844 | + if ($selectedOneField instanceof ORMBoolInterface) { |
|
845 | 845 | $condition = $condition['bool']; |
846 | 846 | } |
847 | - else{ |
|
847 | + else { |
|
848 | 848 | $condition = $condition['default']; |
849 | 849 | } |
850 | 850 | |
@@ -854,20 +854,20 @@ discard block |
||
854 | 854 | break; |
855 | 855 | } |
856 | 856 | } |
857 | - else{ |
|
857 | + else { |
|
858 | 858 | |
859 | 859 | $field = $objectRecordSet->$field; |
860 | 860 | |
861 | - if($field instanceof ORMBoolInterface){ |
|
861 | + if ($field instanceof ORMBoolInterface) { |
|
862 | 862 | $condition = $condition['bool']; |
863 | 863 | } |
864 | - else{ |
|
864 | + else { |
|
865 | 865 | $condition = $condition['default']; |
866 | 866 | } |
867 | 867 | |
868 | 868 | $visibilityCriteria = ''; |
869 | 869 | |
870 | - if(! empty($condition)){ |
|
870 | + if (!empty($condition)) { |
|
871 | 871 | $criteria = $field->{$condition}($data['value']); |
872 | 872 | $visibilityCriteria = $criteria->toJson(); |
873 | 873 | } |
@@ -896,7 +896,7 @@ discard block |
||
896 | 896 | $customContainer = $customContainerSet->request($container); |
897 | 897 | |
898 | 898 | $object = $customContainer->object; |
899 | - if(strpos($object, $App->classPrefix) !== false){ |
|
899 | + if (strpos($object, $App->classPrefix) !== false) { |
|
900 | 900 | list (, $object) = explode($App->classPrefix, $object); |
901 | 901 | } |
902 | 902 | |
@@ -923,17 +923,17 @@ discard block |
||
923 | 923 | |
924 | 924 | $nbCol = 0; |
925 | 925 | |
926 | - foreach ($customSections as $customSection){ |
|
926 | + foreach ($customSections as $customSection) { |
|
927 | 927 | |
928 | - list (, , $nbCol) = explode('-', $customSection->sizePolicy); |
|
928 | + list (,, $nbCol) = explode('-', $customSection->sizePolicy); |
|
929 | 929 | |
930 | 930 | $currentColumn += $nbCol; |
931 | 931 | |
932 | - $sectionSection = $W->Section($customSection->name . ' (' . $customSection->rank . ')', $sectionBox = $W->VBoxItems($W->Hidden() |
|
933 | - ->setName('#' . $customSection->id))); |
|
932 | + $sectionSection = $W->Section($customSection->name.' ('.$customSection->rank.')', $sectionBox = $W->VBoxItems($W->Hidden() |
|
933 | + ->setName('#'.$customSection->id))); |
|
934 | 934 | $sectionSection->addClass('app-custom-section'); |
935 | 935 | $sectionSection->addClass($customSection->classname); |
936 | - $sectionSection->setSizePolicy($customSection->sizePolicy . ' widget-sameheight'); |
|
936 | + $sectionSection->setSizePolicy($customSection->sizePolicy.' widget-sameheight'); |
|
937 | 937 | |
938 | 938 | $row->addItem($sectionSection); |
939 | 939 | |
@@ -951,40 +951,40 @@ discard block |
||
951 | 951 | ->addClass('icon', \Func_Icons::ACTIONS_EDIT_DELETE) |
952 | 952 | ->setOpenMode(WidgetLink::OPEN_DIALOG) |
953 | 953 | ->setDialogClass('box red'))); |
954 | - if(! empty($customSection->visibilityCriteria)){ |
|
954 | + if (!empty($customSection->visibilityCriteria)) { |
|
955 | 955 | $sectionBox->addItem($W->HBoxItems($W->Label($App->translate('This section has a visibility condition'))) |
956 | 956 | ->setSizePolicy('alert alert-warning widget-100pc')); |
957 | 957 | } |
958 | 958 | $fields = $customSection->getFields(); |
959 | - if(count($fields) == 0){ |
|
959 | + if (count($fields) == 0) { |
|
960 | 960 | $sectionBox->addItem($W->HBoxItems($W->Label($App->translate('This section does not contain any field'))) |
961 | 961 | ->setSizePolicy('alert alert-warning')); |
962 | 962 | } |
963 | - foreach ($fields as $fieldId => $field){ |
|
964 | - if(empty($field)){ |
|
963 | + foreach ($fields as $fieldId => $field) { |
|
964 | + if (empty($field)) { |
|
965 | 965 | continue; |
966 | 966 | } |
967 | 967 | |
968 | 968 | $fieldName = $field['fieldname']; |
969 | 969 | |
970 | 970 | $isFieldsGroup = false; |
971 | - if(strpos($fieldName, '_fieldsGroup') !== false){ |
|
971 | + if (strpos($fieldName, '_fieldsGroup') !== false) { |
|
972 | 972 | $fieldName = '_fieldsGroup'; |
973 | 973 | $isFieldsGroup = true; |
974 | 974 | } |
975 | 975 | |
976 | 976 | $field = $availableFields[$fieldName]; |
977 | 977 | $fieldDescription = $field['description']; |
978 | - if(substr($fieldName, 0, 1) !== '_'){ |
|
978 | + if (substr($fieldName, 0, 1) !== '_') { |
|
979 | 979 | $fieldDescription = $App->translate($fieldDescription); |
980 | 980 | } |
981 | 981 | |
982 | - if(empty($field)){ |
|
982 | + if (empty($field)) { |
|
983 | 983 | continue; |
984 | 984 | } |
985 | 985 | |
986 | 986 | $fieldName = $field['name']; |
987 | - if($isFieldsGroup){ |
|
987 | + if ($isFieldsGroup) { |
|
988 | 988 | $fieldName = $fieldId; |
989 | 989 | } |
990 | 990 | |
@@ -995,20 +995,20 @@ discard block |
||
995 | 995 | ->setGrowable(true) |
996 | 996 | ->setWrap(WidgetFlexLayout::FLEX_WRAP_WRAP)) |
997 | 997 | ->setSizePolicy('maximum'), $btnBox = $W->HBoxItems($W->Hidden() |
998 | - ->setName($customSection->id . '.' . $fieldId) |
|
998 | + ->setName($customSection->id.'.'.$fieldId) |
|
999 | 999 | ->setValue($fieldName)) |
1000 | 1000 | ->addClass('widget-actions')) |
1001 | 1001 | ->setSizePolicy('widget-list-element widget-actions-target') |
1002 | 1002 | ->addClass(\Func_Icons::ICON_LEFT_16); |
1003 | - if(strpos($field['name'], '_fieldsGroup') !== false){ |
|
1003 | + if (strpos($field['name'], '_fieldsGroup') !== false) { |
|
1004 | 1004 | $btnBox->addItem($W->Link('', $customSectionCtrl->addDisplayFieldToGroup($customSection->id, $fieldName)) |
1005 | 1005 | ->addClass('icon', \Func_Icons::ACTIONS_LIST_ADD) |
1006 | 1006 | ->setOpenMode(WidgetLink::OPEN_DIALOG)); |
1007 | 1007 | $groupedFields = $fields[$fieldName]['fields']; |
1008 | - foreach ($groupedFields as $groupedField){ |
|
1008 | + foreach ($groupedFields as $groupedField) { |
|
1009 | 1009 | $groupedFieldDetails = $availableFields[$groupedField['fieldname']]; |
1010 | 1010 | $fieldGroupBox->addItem($flexField = $W->FlowItems($W->Hidden(null, array( |
1011 | - $customSection->id . '.fieldsGroups', |
|
1011 | + $customSection->id.'.fieldsGroups', |
|
1012 | 1012 | $fieldName, |
1013 | 1013 | $groupedField['fieldname'] |
1014 | 1014 | ), $groupedField['fieldname']), $W->Label($groupedFieldDetails['description']), $W->FlowItems($W->Link('', $customSectionCtrl->editGroupFieldDisplayField($customSection->id, $fieldName, $groupedField['fieldname'])) |
@@ -1036,23 +1036,23 @@ discard block |
||
1036 | 1036 | $sectionsBoxes[] = $sectionBox; |
1037 | 1037 | } |
1038 | 1038 | |
1039 | - if($currentColumn + $nbCol > 0){ |
|
1039 | + if ($currentColumn + $nbCol > 0) { |
|
1040 | 1040 | $sectionsSection->addItem($row); |
1041 | 1041 | } |
1042 | 1042 | |
1043 | - foreach ($sectionsBoxes as $sectionsBox){ |
|
1043 | + foreach ($sectionsBoxes as $sectionsBox) { |
|
1044 | 1044 | $sectionsBox->sortable(true, $sectionsBoxes); |
1045 | 1045 | $sectionsBox->setMetadata('samePlaceholderSize', true); |
1046 | 1046 | } |
1047 | 1047 | |
1048 | - foreach ($rows as $row){ |
|
1048 | + foreach ($rows as $row) { |
|
1049 | 1049 | $row->sortable(true, $rows); |
1050 | 1050 | $row->setMetadata('samePlaceholderSize', true); |
1051 | 1051 | } |
1052 | 1052 | |
1053 | 1053 | $form = $W->Form(); |
1054 | 1054 | |
1055 | - if(isset($itemId)){ |
|
1055 | + if (isset($itemId)) { |
|
1056 | 1056 | $form->setId($itemId); |
1057 | 1057 | } |
1058 | 1058 | $form->setHiddenValue('tg', $App->controllerTg); |
@@ -1079,7 +1079,7 @@ discard block |
||
1079 | 1079 | $customSections = $customSectionSet->select($customSectionSet->container->is($container)); |
1080 | 1080 | |
1081 | 1081 | $sectionsValues = array(); |
1082 | - foreach ($customSections as $customSection){ |
|
1082 | + foreach ($customSections as $customSection) { |
|
1083 | 1083 | $values = $customSection->getValues(); |
1084 | 1084 | unset($values['id']); |
1085 | 1085 | unset($values['createdBy']); |
@@ -1093,7 +1093,7 @@ discard block |
||
1093 | 1093 | } |
1094 | 1094 | |
1095 | 1095 | header('Content-type: application/json'); |
1096 | - header('Content-Disposition: attachment; filename="' . $container->object . '.' . ($container->view === '' ? 'default' : $container->view) . '.' . $container->name . '.json"' . "\n"); |
|
1096 | + header('Content-Disposition: attachment; filename="'.$container->object.'.'.($container->view === '' ? 'default' : $container->view).'.'.$container->name.'.json"'."\n"); |
|
1097 | 1097 | |
1098 | 1098 | $json = bab_json_encode($sectionsValues); |
1099 | 1099 | $json = bab_convertStringFromDatabase($json, \bab_charset::UTF_8); |
@@ -1145,12 +1145,12 @@ discard block |
||
1145 | 1145 | $files->push($sectionsfile['uid']); |
1146 | 1146 | |
1147 | 1147 | $data = null; |
1148 | - foreach ($files as $f){ |
|
1148 | + foreach ($files as $f) { |
|
1149 | 1149 | $data = file_get_contents($f->toString()); |
1150 | 1150 | break; |
1151 | 1151 | } |
1152 | 1152 | |
1153 | - if(! isset($data)){ |
|
1153 | + if (!isset($data)) { |
|
1154 | 1154 | $this->addError($App->translate('Unable to get file content')); |
1155 | 1155 | return true; |
1156 | 1156 | } |
@@ -1162,7 +1162,7 @@ discard block |
||
1162 | 1162 | |
1163 | 1163 | $customSectionSet->delete($customSectionSet->container->is($container)); |
1164 | 1164 | |
1165 | - foreach ($sectionsValues as $sectionValues){ |
|
1165 | + foreach ($sectionsValues as $sectionValues) { |
|
1166 | 1166 | $customSection = $customSectionSet->newRecord(); |
1167 | 1167 | $customSection->setValues($sectionValues); |
1168 | 1168 | $customSection->container = $container; |
@@ -1240,62 +1240,62 @@ discard block |
||
1240 | 1240 | $ranks = array(); |
1241 | 1241 | $rank = 0; |
1242 | 1242 | |
1243 | - foreach ($sections as $key => $value){ |
|
1243 | + foreach ($sections as $key => $value) { |
|
1244 | 1244 | // Sections ids start with #, while section fields start with their original section id |
1245 | - if(substr($key, 0, 1) === '#'){ |
|
1245 | + if (substr($key, 0, 1) === '#') { |
|
1246 | 1246 | $currentSectionId = substr($key, 1); |
1247 | 1247 | $rawSectionData[$currentSectionId] = array(); |
1248 | - if(! isset($oldSectionId)){ |
|
1248 | + if (!isset($oldSectionId)) { |
|
1249 | 1249 | $oldSectionId = $currentSectionId; |
1250 | 1250 | } |
1251 | - if(isset($currentSection) && $oldSectionId != $currentSectionId){ |
|
1251 | + if (isset($currentSection) && $oldSectionId != $currentSectionId) { |
|
1252 | 1252 | $oldSectionId = $currentSectionId; |
1253 | 1253 | } |
1254 | 1254 | $ranks[$currentSectionId] = $rank; |
1255 | - $rank ++; |
|
1255 | + $rank++; |
|
1256 | 1256 | $currentSection = $customSectionSet->get($customSectionSet->id->is($currentSectionId)); |
1257 | 1257 | continue; |
1258 | 1258 | } |
1259 | - if(! isset($currentSection)){ |
|
1259 | + if (!isset($currentSection)) { |
|
1260 | 1260 | continue; |
1261 | 1261 | } |
1262 | 1262 | list ($fieldSectionId, $fieldName) = explode('.', $key); |
1263 | - if($fieldSectionId == $currentSectionId){ |
|
1263 | + if ($fieldSectionId == $currentSectionId) { |
|
1264 | 1264 | $field = $currentSection->getField($fieldName); |
1265 | - if(strpos($fieldName, '_fieldsGroup') !== false){ |
|
1265 | + if (strpos($fieldName, '_fieldsGroup') !== false) { |
|
1266 | 1266 | $rawSectionData[$currentSectionId][$fieldName]['block'] = $field['block']; |
1267 | 1267 | $rawSectionData[$currentSectionId][$fieldName]['fieldname'] = '_fieldsGroup'; |
1268 | 1268 | $rawSectionData[$currentSectionId][$fieldName]['parameters'] = $field['parameters']; |
1269 | - foreach ($sections[$currentSection->id . '.fieldsGroups'][$fieldName] as $subKey => $subValue){ |
|
1269 | + foreach ($sections[$currentSection->id.'.fieldsGroups'][$fieldName] as $subKey => $subValue) { |
|
1270 | 1270 | $rawSectionData[$currentSectionId][$fieldName]['fields'][$subKey] = $field['fields'][$subKey]; |
1271 | 1271 | } |
1272 | 1272 | } |
1273 | - elseif($fieldName != 'fieldsGroups'){ |
|
1273 | + elseif ($fieldName != 'fieldsGroups') { |
|
1274 | 1274 | $rawSectionData[$currentSectionId][$fieldName] = $field; |
1275 | 1275 | } |
1276 | 1276 | } |
1277 | - else{ |
|
1277 | + else { |
|
1278 | 1278 | $field = null; |
1279 | 1279 | $tmpSection = $customSectionSet->get($customSectionSet->id->is($fieldSectionId)); |
1280 | - if($tmpSection){ |
|
1280 | + if ($tmpSection) { |
|
1281 | 1281 | $field = $tmpSection->getField($fieldName); |
1282 | 1282 | } |
1283 | - if(isset($field)){ |
|
1283 | + if (isset($field)) { |
|
1284 | 1284 | $rawSectionData[$currentSectionId][$fieldName] = $field; |
1285 | 1285 | } |
1286 | 1286 | } |
1287 | 1287 | } |
1288 | 1288 | |
1289 | - foreach ($rawSectionData as $sectionId => $fields){ |
|
1289 | + foreach ($rawSectionData as $sectionId => $fields) { |
|
1290 | 1290 | $section = $customSectionSet->get($customSectionSet->id->is($sectionId)); |
1291 | - if($section){ |
|
1292 | - if(bab_charset::getIso() != bab_charset::UTF_8){ |
|
1291 | + if ($section) { |
|
1292 | + if (bab_charset::getIso() != bab_charset::UTF_8) { |
|
1293 | 1293 | $fields = app_utf8Encode($fields); |
1294 | 1294 | } |
1295 | 1295 | $section->fields = json_encode($fields); |
1296 | 1296 | $section->rank = isset($ranks[$sectionId]) ? $ranks[$sectionId] : 0; |
1297 | 1297 | $section->save(); |
1298 | - $rank ++; |
|
1298 | + $rank++; |
|
1299 | 1299 | } |
1300 | 1300 | } |
1301 | 1301 |
@@ -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 |
@@ -39,10 +39,10 @@ discard block |
||
39 | 39 | use Capwelton\LibApp\Func_App; |
40 | 40 | use Capwelton\LibApp\AppComponent; |
41 | 41 | use Capwelton\LibOrm\Exceptions\ORMException; |
42 | -require_once $GLOBALS['babInstallPath'] . 'utilit/controller.class.php'; |
|
43 | -require_once $GLOBALS['babInstallPath'] . 'utilit/json.php'; |
|
42 | +require_once $GLOBALS['babInstallPath'].'utilit/controller.class.php'; |
|
43 | +require_once $GLOBALS['babInstallPath'].'utilit/json.php'; |
|
44 | 44 | |
45 | -require_once dirname(__FILE__) . '/../functions.php'; |
|
45 | +require_once dirname(__FILE__).'/../functions.php'; |
|
46 | 46 | |
47 | 47 | /** |
48 | 48 | * @method self proxy() |
@@ -76,7 +76,7 @@ discard block |
||
76 | 76 | public function addReloadSelector($reloadSelector, $withSSE = false, $for = null) |
77 | 77 | { |
78 | 78 | $this->reloadSelectors[$reloadSelector] = $reloadSelector; |
79 | - if($withSSE){ |
|
79 | + if ($withSSE) { |
|
80 | 80 | $sseRecordSet = $this->getSSERecordSet(); |
81 | 81 | $sseRecordSet->newReloadSelector($reloadSelector, $for); |
82 | 82 | } |
@@ -93,7 +93,7 @@ discard block |
||
93 | 93 | |
94 | 94 | public function getSSERecordSet() |
95 | 95 | { |
96 | - if(isset($this->SSERecordSet)){ |
|
96 | + if (isset($this->SSERecordSet)) { |
|
97 | 97 | return $this->SSERecordSet; |
98 | 98 | } |
99 | 99 | |
@@ -138,7 +138,7 @@ discard block |
||
138 | 138 | public function __call($name, $arguments = array()) |
139 | 139 | { |
140 | 140 | $component = $this->App()->getComponentByName($name); |
141 | - if($component){ |
|
141 | + if ($component) { |
|
142 | 142 | return call_user_func_array(array( |
143 | 143 | $component, |
144 | 144 | 'controller' |
@@ -181,7 +181,7 @@ discard block |
||
181 | 181 | */ |
182 | 182 | public function isAjaxRequest() |
183 | 183 | { |
184 | - if(! isset($this->isAjaxRequest)){ |
|
184 | + if (!isset($this->isAjaxRequest)) { |
|
185 | 185 | $this->isAjaxRequest = (isset($_SERVER['HTTP_X_REQUESTED_WITH']) && strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) == 'xmlhttprequest'); |
186 | 186 | } |
187 | 187 | return $this->isAjaxRequest; |
@@ -193,14 +193,14 @@ discard block |
||
193 | 193 | */ |
194 | 194 | public function requireCredential($message = null) |
195 | 195 | { |
196 | - if($this->isAjaxRequest()){ |
|
196 | + if ($this->isAjaxRequest()) { |
|
197 | 197 | $authType = 'Basic'; |
198 | 198 | } |
199 | - else{ |
|
199 | + else { |
|
200 | 200 | $authType = ''; |
201 | 201 | } |
202 | 202 | |
203 | - if(! isset($message)){ |
|
203 | + if (!isset($message)) { |
|
204 | 204 | $message = $this->App()->translate('You must be logged in to access this page.'); |
205 | 205 | } |
206 | 206 | |
@@ -224,10 +224,10 @@ discard block |
||
224 | 224 | list ($prefix) = explode('_', __CLASS__); |
225 | 225 | $functionalityName = ucwords($prefix); |
226 | 226 | /** @var Func_App */ |
227 | - $App = @\bab_functionality::get('App/' . $functionalityName); |
|
227 | + $App = @\bab_functionality::get('App/'.$functionalityName); |
|
228 | 228 | |
229 | - if(!$App){ |
|
230 | - throw new AppException('Faild to autodetect functionality App/' . $functionalityName . ', the getInstance method is deprecated, use $App->ControllerProxy() instead'); |
|
229 | + if (!$App) { |
|
230 | + throw new AppException('Faild to autodetect functionality App/'.$functionalityName.', the getInstance method is deprecated, use $App->ControllerProxy() instead'); |
|
231 | 231 | } |
232 | 232 | |
233 | 233 | $controller = $App->ControllerProxy($classname, $proxy); |
@@ -245,44 +245,44 @@ discard block |
||
245 | 245 | static function getProxyInstance(Func_App $App, $classname) |
246 | 246 | { |
247 | 247 | $class = new \ReflectionClass($classname); |
248 | - $proxyClassname = $class->getShortName() . self::PROXY_CLASS_SUFFIX; |
|
248 | + $proxyClassname = $class->getShortName().self::PROXY_CLASS_SUFFIX; |
|
249 | 249 | $finalProxyClassname = $class->getNamespaceName()."\\".$proxyClassname; |
250 | - if(! class_exists($finalProxyClassname)){ |
|
250 | + if (!class_exists($finalProxyClassname)) { |
|
251 | 251 | $classStr = ""; |
252 | - if($class->getNamespaceName() != ""){ |
|
252 | + if ($class->getNamespaceName() != "") { |
|
253 | 253 | $classStr .= " namespace ".$class->getNamespaceName()."; "; |
254 | 254 | } |
255 | - $classStr .= 'class ' . $proxyClassname . ' extends ' . $class->getShortName() . ' {' . "\n"; |
|
255 | + $classStr .= 'class '.$proxyClassname.' extends '.$class->getShortName().' {'."\n"; |
|
256 | 256 | $methods = $class->getMethods(); |
257 | 257 | |
258 | 258 | $classStr .= ' public function __construct($App) { |
259 | 259 | $this->setApp($App); |
260 | 260 | }' . "\n"; |
261 | 261 | |
262 | - foreach ($methods as $method){ |
|
263 | - if($method->name === '__construct' || ! $method->isPublic() || $method->isStatic() || $method->isFinal() || $method->name === 'setApp' || $method->name === 'App' || $method->name === 'setCrm' || $method->name === 'Crm'){ |
|
262 | + foreach ($methods as $method) { |
|
263 | + if ($method->name === '__construct' || !$method->isPublic() || $method->isStatic() || $method->isFinal() || $method->name === 'setApp' || $method->name === 'App' || $method->name === 'setCrm' || $method->name === 'Crm') { |
|
264 | 264 | continue; |
265 | 265 | } |
266 | 266 | |
267 | - $classStr .= ' public function ' . $method->name . '('; |
|
267 | + $classStr .= ' public function '.$method->name.'('; |
|
268 | 268 | $parameters = $method->getParameters(); |
269 | 269 | $parametersStr = array(); |
270 | - foreach ($parameters as $parameter){ |
|
270 | + foreach ($parameters as $parameter) { |
|
271 | 271 | |
272 | - if($parameter->isDefaultValueAvailable()){ |
|
273 | - $parametersStr[] = '$' . $parameter->name . ' = ' . var_export($parameter->getDefaultValue(), true); |
|
272 | + if ($parameter->isDefaultValueAvailable()) { |
|
273 | + $parametersStr[] = '$'.$parameter->name.' = '.var_export($parameter->getDefaultValue(), true); |
|
274 | 274 | } |
275 | - else{ |
|
276 | - $parametersStr[] = '$' . $parameter->name; |
|
275 | + else { |
|
276 | + $parametersStr[] = '$'.$parameter->name; |
|
277 | 277 | } |
278 | 278 | } |
279 | 279 | $classStr .= implode(', ', $parametersStr); |
280 | - $classStr .= ') {' . "\n"; |
|
281 | - $classStr .= ' $args = func_get_args();' . "\n"; |
|
282 | - $classStr .= ' return $this->getMethodAction(__FUNCTION__, $args);' . "\n"; |
|
283 | - $classStr .= ' }' . "\n"; |
|
280 | + $classStr .= ') {'."\n"; |
|
281 | + $classStr .= ' $args = func_get_args();'."\n"; |
|
282 | + $classStr .= ' return $this->getMethodAction(__FUNCTION__, $args);'."\n"; |
|
283 | + $classStr .= ' }'."\n"; |
|
284 | 284 | } |
285 | - $classStr .= '}' . "\n"; |
|
285 | + $classStr .= '}'."\n"; |
|
286 | 286 | // We define the proxy class |
287 | 287 | eval($classStr); |
288 | 288 | } |
@@ -320,7 +320,7 @@ discard block |
||
320 | 320 | protected function getObjectName($classname) |
321 | 321 | { |
322 | 322 | list ($objectname) = explode('Controller', $classname); |
323 | - if($this->App()->getComponentByName($objectname)){ |
|
323 | + if ($this->App()->getComponentByName($objectname)) { |
|
324 | 324 | return strtolower($objectname); |
325 | 325 | } |
326 | 326 | list (, $objectname) = explode('Ctrl', $classname); |
@@ -342,18 +342,18 @@ discard block |
||
342 | 342 | |
343 | 343 | $reflector = new \ReflectionClass(get_class($this)); |
344 | 344 | $parent = $reflector->getParentClass(); |
345 | - if($parent){ |
|
345 | + if ($parent) { |
|
346 | 346 | $parentMethod = $parent->getMethod('__construct'); |
347 | 347 | $docComment = $parentMethod->getDocComment(); |
348 | - if(strpos($docComment, '@isComponentController') !== false){ |
|
348 | + if (strpos($docComment, '@isComponentController') !== false) { |
|
349 | 349 | $fullClassName = $parent->getName(); |
350 | 350 | } |
351 | 351 | } |
352 | 352 | |
353 | 353 | $rc = new \ReflectionClass($fullClassName); |
354 | 354 | |
355 | - if(! $rc->hasMethod($methodName)){ |
|
356 | - throw new \bab_InvalidActionException($fullClassName . '::' . $methodName); |
|
355 | + if (!$rc->hasMethod($methodName)) { |
|
356 | + throw new \bab_InvalidActionException($fullClassName.'::'.$methodName); |
|
357 | 357 | } |
358 | 358 | $method = new \ReflectionMethod($fullClassName, $methodName); |
359 | 359 | |
@@ -362,32 +362,32 @@ discard block |
||
362 | 362 | $parameters = $method->getParameters(); |
363 | 363 | $actionParams = array(); |
364 | 364 | $argNumber = 0; |
365 | - foreach ($parameters as $parameter){ |
|
365 | + foreach ($parameters as $parameter) { |
|
366 | 366 | $parameterName = $parameter->getName(); |
367 | - if(isset($args[$argNumber])){ |
|
367 | + if (isset($args[$argNumber])) { |
|
368 | 368 | $actionParams[$parameterName] = $args[$argNumber]; |
369 | 369 | } |
370 | - elseif($parameter->isDefaultValueAvailable()){ |
|
370 | + elseif ($parameter->isDefaultValueAvailable()) { |
|
371 | 371 | $actionParams[$parameterName] = $parameter->getDefaultValue(); |
372 | 372 | } |
373 | - else{ |
|
373 | + else { |
|
374 | 374 | $actionParams[$parameterName] = null; |
375 | 375 | } |
376 | - $argNumber ++; |
|
376 | + $argNumber++; |
|
377 | 377 | } |
378 | 378 | |
379 | 379 | $action = new WidgetAction(); |
380 | 380 | |
381 | - $action->setMethod($this->getControllerTg(), $objectName . '.' . $methodName, $actionParams); |
|
381 | + $action->setMethod($this->getControllerTg(), $objectName.'.'.$methodName, $actionParams); |
|
382 | 382 | |
383 | 383 | $docComment = $method->getDocComment(); |
384 | - if(strpos($docComment, '@ajax') !== false){ |
|
384 | + if (strpos($docComment, '@ajax') !== false) { |
|
385 | 385 | $action->setAjax(true); |
386 | 386 | } |
387 | - if(strpos($docComment, '@requireSaveMethod') !== false && method_exists($action, 'setRequireSaveMethod')){ |
|
387 | + if (strpos($docComment, '@requireSaveMethod') !== false && method_exists($action, 'setRequireSaveMethod')) { |
|
388 | 388 | $action->setRequireSaveMethod(true); |
389 | 389 | } |
390 | - if(strpos($docComment, '@requireDeleteMethod') !== false && method_exists($action, 'setRequireDeleteMethod')){ |
|
390 | + if (strpos($docComment, '@requireDeleteMethod') !== false && method_exists($action, 'setRequireDeleteMethod')) { |
|
391 | 391 | $action->setRequireDeleteMethod(true); |
392 | 392 | } |
393 | 393 | |
@@ -416,9 +416,9 @@ discard block |
||
416 | 416 | |
417 | 417 | $action->setParameters($actionParams); |
418 | 418 | |
419 | - list (, , $file) = explode('/', $App->controllerTg); |
|
419 | + list (,, $file) = explode('/', $App->controllerTg); |
|
420 | 420 | |
421 | - $action->setParameter('addon', $App->getAddonName() . '.' . $file); |
|
421 | + $action->setParameter('addon', $App->getAddonName().'.'.$file); |
|
422 | 422 | $action->setParameter('idx', $idx); |
423 | 423 | |
424 | 424 | return $action; |
@@ -436,44 +436,44 @@ discard block |
||
436 | 436 | |
437 | 437 | $method = $action->getMethod(); |
438 | 438 | |
439 | - if(! isset($method) || '' === $method){ |
|
439 | + if (!isset($method) || '' === $method) { |
|
440 | 440 | return false; |
441 | 441 | } |
442 | 442 | |
443 | 443 | list ($objectName,) = explode('.', $method); |
444 | 444 | |
445 | - if(! method_exists($this, $objectName)){ |
|
445 | + if (!method_exists($this, $objectName)) { |
|
446 | 446 | /* @var $component AppComponent */ |
447 | 447 | $component = $this->app->getComponentByName($objectName); |
448 | - if($component){ |
|
448 | + if ($component) { |
|
449 | 449 | $this->app->setCurrentComponent($component); |
450 | 450 | $objectController = $component->controller(false); |
451 | 451 | } |
452 | - else{ |
|
452 | + else { |
|
453 | 453 | header('HTTP/1.0 400 Bad Request'); |
454 | 454 | throw new AppUnknownActionException($action); |
455 | 455 | } |
456 | 456 | } |
457 | 457 | |
458 | - if(! isset($component)){ |
|
458 | + if (!isset($component)) { |
|
459 | 459 | $objectController = $this->{$objectName}(false); |
460 | - if(! ($objectController instanceof AppController)){ |
|
460 | + if (!($objectController instanceof AppController)) { |
|
461 | 461 | return false; |
462 | 462 | } |
463 | 463 | } |
464 | 464 | |
465 | - try{ |
|
465 | + try { |
|
466 | 466 | $returnedValue = $objectController->execAction($action); |
467 | 467 | } |
468 | - catch (AppAccessException $e){ |
|
468 | + catch (AppAccessException $e) { |
|
469 | 469 | |
470 | - if(! bab_isUserLogged() && $e->requireCredential){ |
|
470 | + if (!bab_isUserLogged() && $e->requireCredential) { |
|
471 | 471 | bab_requireCredential($e->getMessage()); |
472 | 472 | } |
473 | - else{ |
|
474 | - if($this->isAjaxRequest()){ |
|
473 | + else { |
|
474 | + if ($this->isAjaxRequest()) { |
|
475 | 475 | |
476 | - header($_SERVER['SERVER_PROTOCOL'] . ' 403 Forbidden', true, 403); |
|
476 | + header($_SERVER['SERVER_PROTOCOL'].' 403 Forbidden', true, 403); |
|
477 | 477 | |
478 | 478 | die(bab_json_encode(array( |
479 | 479 | 'exception' => 'app_AccessException', |
@@ -484,10 +484,10 @@ discard block |
||
484 | 484 | $this->accessPage($e); |
485 | 485 | } |
486 | 486 | } |
487 | - catch (AppSaveException $e){ |
|
487 | + catch (AppSaveException $e) { |
|
488 | 488 | |
489 | - if($this->isAjaxRequest()){ |
|
490 | - header($_SERVER['SERVER_PROTOCOL'] . ' 403 Forbidden', true, 403); |
|
489 | + if ($this->isAjaxRequest()) { |
|
490 | + header($_SERVER['SERVER_PROTOCOL'].' 403 Forbidden', true, 403); |
|
491 | 491 | header('Cache-Control: no-cache, must-revalidate'); |
492 | 492 | header('Expires: Mon, 26 Jul 1997 05:00:00 GMT'); |
493 | 493 | header('Content-type: application/json'); |
@@ -499,32 +499,32 @@ discard block |
||
499 | 499 | ))); |
500 | 500 | } |
501 | 501 | } |
502 | - catch (AppDeletedRecordException $e){ |
|
502 | + catch (AppDeletedRecordException $e) { |
|
503 | 503 | $this->deletedItemPage($action, $e); |
504 | 504 | } |
505 | - catch (AppNotFoundException $e){ |
|
505 | + catch (AppNotFoundException $e) { |
|
506 | 506 | $this->notFoundPage($action, $e); |
507 | 507 | } |
508 | - catch (ORMException $e){ |
|
508 | + catch (ORMException $e) { |
|
509 | 509 | $this->errorPage($e); |
510 | 510 | } |
511 | - catch (\Exception $e){ |
|
511 | + catch (\Exception $e) { |
|
512 | 512 | $this->unexpectedErrorPage($e); |
513 | 513 | } |
514 | 514 | |
515 | 515 | $W = bab_Widgets(); |
516 | 516 | |
517 | - if($returnedValue instanceof WidgetDisplayableInterface){ |
|
517 | + if ($returnedValue instanceof WidgetDisplayableInterface) { |
|
518 | 518 | |
519 | - if($returnedValue instanceof WidgetBabPage && ! $this->isAjaxRequest()){ |
|
519 | + if ($returnedValue instanceof WidgetBabPage && !$this->isAjaxRequest()) { |
|
520 | 520 | |
521 | 521 | // If the action returned a page, we display it. |
522 | 522 | $returnedValue->displayHtml(); |
523 | 523 | } |
524 | - else{ |
|
524 | + else { |
|
525 | 525 | |
526 | 526 | $htmlCanvas = $W->HtmlCanvas(); |
527 | - if(self::$acceptJson){ |
|
527 | + if (self::$acceptJson) { |
|
528 | 528 | $itemId = $returnedValue->getId(); |
529 | 529 | $returnArray = array( |
530 | 530 | $itemId => $returnedValue->display($htmlCanvas) |
@@ -534,18 +534,18 @@ discard block |
||
534 | 534 | header('Content-type: application/json'); |
535 | 535 | die(bab_json_encode($returnArray)); |
536 | 536 | } |
537 | - else{ |
|
537 | + else { |
|
538 | 538 | header('Cache-Control: no-cache, must-revalidate'); |
539 | 539 | header('Expires: Mon, 26 Jul 1997 05:00:00 GMT'); |
540 | 540 | header('Content-type: text/html'); |
541 | - if($returnedValue instanceof WidgetPage && method_exists($returnedValue, 'getPageTitle')){ |
|
541 | + if ($returnedValue instanceof WidgetPage && method_exists($returnedValue, 'getPageTitle')) { |
|
542 | 542 | $pageTitle = $returnedValue->getPageTitle(); |
543 | 543 | |
544 | - if(method_exists($htmlCanvas, 'sendPageTitle')){ |
|
544 | + if (method_exists($htmlCanvas, 'sendPageTitle')) { |
|
545 | 545 | $htmlCanvas->sendPageTitle($pageTitle); |
546 | 546 | } |
547 | - else{ |
|
548 | - header('X-Cto-PageTitle: ' . $pageTitle); |
|
547 | + else { |
|
548 | + header('X-Cto-PageTitle: '.$pageTitle); |
|
549 | 549 | } |
550 | 550 | } |
551 | 551 | $html = $returnedValue->display($htmlCanvas); |
@@ -553,15 +553,15 @@ discard block |
||
553 | 553 | } |
554 | 554 | } |
555 | 555 | } |
556 | - elseif(is_array($returnedValue)){ |
|
556 | + elseif (is_array($returnedValue)) { |
|
557 | 557 | |
558 | 558 | $htmlCanvas = $W->HtmlCanvas(); |
559 | 559 | $returnedArray = array(); |
560 | - foreach ($returnedValue as $key => &$item){ |
|
561 | - if($item instanceof WidgetDisplayableInterface){ |
|
560 | + foreach ($returnedValue as $key => &$item) { |
|
561 | + if ($item instanceof WidgetDisplayableInterface) { |
|
562 | 562 | $returnedArray[$item->getId()] = $item->display($htmlCanvas); |
563 | 563 | } |
564 | - else{ |
|
564 | + else { |
|
565 | 565 | $returnedArray[$key] = $item; |
566 | 566 | } |
567 | 567 | } |
@@ -570,9 +570,9 @@ discard block |
||
570 | 570 | header('Content-type: application/json'); |
571 | 571 | die(bab_convertStringFromDatabase(bab_json_encode($returnedArray), \bab_charset::UTF_8)); |
572 | 572 | } |
573 | - elseif(true === $returnedValue || is_string($returnedValue)){ |
|
573 | + elseif (true === $returnedValue || is_string($returnedValue)) { |
|
574 | 574 | |
575 | - if($this->isAjaxRequest()){ |
|
575 | + if ($this->isAjaxRequest()) { |
|
576 | 576 | $body = bab_getBody(); |
577 | 577 | $json = array(); |
578 | 578 | $json['messages'] = array(); |
@@ -580,24 +580,24 @@ discard block |
||
580 | 580 | unset($body->messages['toasts']); |
581 | 581 | $messages = $body->messages; |
582 | 582 | $errors = $body->errors; |
583 | - foreach ($messages as $message){ |
|
583 | + foreach ($messages as $message) { |
|
584 | 584 | $json['messages'][] = array( |
585 | 585 | 'level' => 'info', |
586 | 586 | 'content' => $message, |
587 | 587 | 'time' => 4000 |
588 | 588 | ); |
589 | 589 | } |
590 | - foreach ($errors as $message){ |
|
590 | + foreach ($errors as $message) { |
|
591 | 591 | $json['messages'][] = array( |
592 | 592 | 'level' => 'danger', |
593 | 593 | 'content' => $message |
594 | 594 | ); |
595 | 595 | } |
596 | 596 | $json['toasts'] = $toasts; |
597 | - if($objectController->getReloadSelectors()){ |
|
597 | + if ($objectController->getReloadSelectors()) { |
|
598 | 598 | $json['reloadSelector'] = implode(',', $objectController->getReloadSelectors()); |
599 | 599 | } |
600 | - if($objectController->keepDialogOpened){ |
|
600 | + if ($objectController->keepDialogOpened) { |
|
601 | 601 | $json['keepDialogOpened'] = true; |
602 | 602 | } |
603 | 603 | echo bab_json_encode($json); |
@@ -610,8 +610,8 @@ discard block |
||
610 | 610 | |
611 | 611 | protected function deletedItemPage(WidgetAction $action, AppDeletedRecordException $e) |
612 | 612 | { |
613 | - if($this->isAjaxRequest()){ |
|
614 | - header($_SERVER['SERVER_PROTOCOL'] . ' 403 Forbidden', true, 403); |
|
613 | + if ($this->isAjaxRequest()) { |
|
614 | + header($_SERVER['SERVER_PROTOCOL'].' 403 Forbidden', true, 403); |
|
615 | 615 | header('Cache-Control: no-cache, must-revalidate'); |
616 | 616 | header('Expires: Mon, 26 Jul 1997 05:00:00 GMT'); |
617 | 617 | header('Content-type: application/json'); |
@@ -623,7 +623,7 @@ discard block |
||
623 | 623 | 'errorMessage' => bab_convertStringFromDatabase($e->getMessage(), 'UTF-8') |
624 | 624 | ))); |
625 | 625 | } |
626 | - header($_SERVER['SERVER_PROTOCOL'] . ' 404 Not Found', true, 404); |
|
626 | + header($_SERVER['SERVER_PROTOCOL'].' 404 Not Found', true, 404); |
|
627 | 627 | |
628 | 628 | $App = app_App(); |
629 | 629 | $W = bab_Widgets(); |
@@ -645,7 +645,7 @@ discard block |
||
645 | 645 | ->setAlignItems(WidgetFlexLayout::FLEX_ALIGN_ITEMS_CENTER)); |
646 | 646 | $section->addItems($W->Title($App->translate('Error'), 1), $W->Title(sprintf($App->translate('This %s has been deleted'), $e->getObjectTitle()))); |
647 | 647 | |
648 | - if($e instanceof AppDeletedRecordException){ |
|
648 | + if ($e instanceof AppDeletedRecordException) { |
|
649 | 649 | $section->addItems($e->getDeletedBy(), $e->getDeletedOn()); |
650 | 650 | } |
651 | 651 | |
@@ -654,8 +654,8 @@ discard block |
||
654 | 654 | |
655 | 655 | protected function notFoundPage(WidgetAction $action, AppNotFoundException $e) |
656 | 656 | { |
657 | - if($this->isAjaxRequest()){ |
|
658 | - $message = sprintf(app_translate('This %s does not exists'), $e->getObjectTitle() . ' (' . $e->getId() . ')'); |
|
657 | + if ($this->isAjaxRequest()) { |
|
658 | + $message = sprintf(app_translate('This %s does not exists'), $e->getObjectTitle().' ('.$e->getId().')'); |
|
659 | 659 | $json = array( |
660 | 660 | 'messages' => array( |
661 | 661 | array( |
@@ -667,7 +667,7 @@ discard block |
||
667 | 667 | echo bab_json_encode($json); |
668 | 668 | die(); |
669 | 669 | } |
670 | - header($_SERVER['SERVER_PROTOCOL'] . ' 404 Not Found', true, 404); |
|
670 | + header($_SERVER['SERVER_PROTOCOL'].' 404 Not Found', true, 404); |
|
671 | 671 | header('Cache-Control: no-cache, must-revalidate'); |
672 | 672 | header('Expires: Mon, 26 Jul 1997 05:00:00 GMT'); |
673 | 673 | |
@@ -696,8 +696,8 @@ discard block |
||
696 | 696 | |
697 | 697 | protected function unexpectedErrorPage(\Exception $e) |
698 | 698 | { |
699 | - if($this->isAjaxRequest()){ |
|
700 | - $message = sprintf(app_translate('An unexpected error occured') . ':' . '%s', $e->getMessage()); |
|
699 | + if ($this->isAjaxRequest()) { |
|
700 | + $message = sprintf(app_translate('An unexpected error occured').':'.'%s', $e->getMessage()); |
|
701 | 701 | $json = array( |
702 | 702 | 'messages' => array( |
703 | 703 | array( |
@@ -709,7 +709,7 @@ discard block |
||
709 | 709 | echo bab_json_encode($json); |
710 | 710 | die(); |
711 | 711 | } |
712 | - header($_SERVER['SERVER_PROTOCOL'] . ' 500 Internal server error', true, 500); |
|
712 | + header($_SERVER['SERVER_PROTOCOL'].' 500 Internal server error', true, 500); |
|
713 | 713 | header('Cache-Control: no-cache, must-revalidate'); |
714 | 714 | header('Expires: Mon, 26 Jul 1997 05:00:00 GMT'); |
715 | 715 | |
@@ -733,25 +733,25 @@ discard block |
||
733 | 733 | ->addClass('widget-50pc alert alert-danger') |
734 | 734 | ->setDirection(WidgetFlexLayout::FLEX_DIRECTION_COL)); |
735 | 735 | |
736 | - $logCode = '#' . hrtime(true); |
|
736 | + $logCode = '#'.hrtime(true); |
|
737 | 737 | $message = addcslashes($e->getMessage(), "\000..\037\177..\377\\"); |
738 | 738 | $trace = addcslashes($e->getTraceAsString(), "\000..\037\177..\377\\"); |
739 | 739 | |
740 | - error_log(sprintf('Error %s : %s', $logCode, $message) . PHP_EOL . $trace); |
|
740 | + error_log(sprintf('Error %s : %s', $logCode, $message).PHP_EOL.$trace); |
|
741 | 741 | |
742 | 742 | $section->addItems($W->Title($App->translate('Error'), 1), $W->Title($App->translate('An unexpected error occured')), $W->Label(sprintf($App->translate('It has been logged with the following error code : %s'), $logCode))); |
743 | 743 | |
744 | - if(bab_isUserAdministrator()){ |
|
744 | + if (bab_isUserAdministrator()) { |
|
745 | 745 | $contentBox->addItem($W->Section('Stack trace', $stackTraceBox = $W->FlexItems($W->Label($message) |
746 | 746 | ->addClass('widget-description')) |
747 | 747 | ->setDirection(WidgetFlexLayout::FLEX_DIRECTION_COL)) |
748 | 748 | ->setFoldable(true, true)); |
749 | 749 | $traces = explode("\n", $e->getTraceAsString()); |
750 | - foreach ($traces as $trace){ |
|
750 | + foreach ($traces as $trace) { |
|
751 | 751 | $stackTraceBox->addItem($W->Label($trace)); |
752 | 752 | } |
753 | 753 | } |
754 | - else{ |
|
754 | + else { |
|
755 | 755 | $section->addItem($W->Label($App->translate('Please contact the administrator'))); |
756 | 756 | } |
757 | 757 | |
@@ -760,8 +760,8 @@ discard block |
||
760 | 760 | |
761 | 761 | protected function errorPage(\Exception $e) |
762 | 762 | { |
763 | - if($this->isAjaxRequest()){ |
|
764 | - $message = sprintf(app_translate('An unexpected error occured') . ':' . '%s', $e->getMessage()); |
|
763 | + if ($this->isAjaxRequest()) { |
|
764 | + $message = sprintf(app_translate('An unexpected error occured').':'.'%s', $e->getMessage()); |
|
765 | 765 | $json = array( |
766 | 766 | 'messages' => array( |
767 | 767 | array( |
@@ -773,7 +773,7 @@ discard block |
||
773 | 773 | echo bab_json_encode($json); |
774 | 774 | die(); |
775 | 775 | } |
776 | - header($_SERVER['SERVER_PROTOCOL'] . ' 500 Internal server error', true, 500); |
|
776 | + header($_SERVER['SERVER_PROTOCOL'].' 500 Internal server error', true, 500); |
|
777 | 777 | header('Cache-Control: no-cache, must-revalidate'); |
778 | 778 | header('Expires: Mon, 26 Jul 1997 05:00:00 GMT'); |
779 | 779 | |
@@ -797,25 +797,25 @@ discard block |
||
797 | 797 | ->addClass('widget-50pc alert alert-danger') |
798 | 798 | ->setDirection(WidgetFlexLayout::FLEX_DIRECTION_COL)); |
799 | 799 | |
800 | - $logCode = '#' . hrtime(true); |
|
800 | + $logCode = '#'.hrtime(true); |
|
801 | 801 | $message = addcslashes($e->getMessage(), "\000..\037\177..\377\\"); |
802 | 802 | $trace = addcslashes($e->getTraceAsString(), "\000..\037\177..\377\\"); |
803 | 803 | |
804 | - error_log(sprintf('Error %s : %s', $logCode, $message) . PHP_EOL . $trace); |
|
804 | + error_log(sprintf('Error %s : %s', $logCode, $message).PHP_EOL.$trace); |
|
805 | 805 | |
806 | 806 | $section->addItems($W->Title($App->translate('Error'), 1), $W->Title($App->translate('An unexpected error occured')), $W->Label(sprintf($App->translate('It has been logged with the following error code : %s'), $logCode))); |
807 | 807 | |
808 | - if(bab_isUserAdministrator()){ |
|
808 | + if (bab_isUserAdministrator()) { |
|
809 | 809 | $contentBox->addItem($W->Section('Stack trace', $stackTraceBox = $W->FlexItems($W->Label($message) |
810 | 810 | ->addClass('widget-description')) |
811 | 811 | ->setDirection(WidgetFlexLayout::FLEX_DIRECTION_COL)) |
812 | 812 | ->setFoldable(true, true)); |
813 | 813 | $traces = explode("\n", $e->getTraceAsString()); |
814 | - foreach ($traces as $trace){ |
|
814 | + foreach ($traces as $trace) { |
|
815 | 815 | $stackTraceBox->addItem($W->Label($trace)); |
816 | 816 | } |
817 | 817 | } |
818 | - else{ |
|
818 | + else { |
|
819 | 819 | $section->addItem($W->Label($App->translate('Please contact the administrator'))); |
820 | 820 | } |
821 | 821 | |
@@ -824,7 +824,7 @@ discard block |
||
824 | 824 | |
825 | 825 | protected function accessPage(\Exception $e) |
826 | 826 | { |
827 | - if($this->isAjaxRequest()){ |
|
827 | + if ($this->isAjaxRequest()) { |
|
828 | 828 | $message = $e->getMessage(); |
829 | 829 | $json = array( |
830 | 830 | 'messages' => array( |
@@ -837,7 +837,7 @@ discard block |
||
837 | 837 | echo bab_json_encode($json); |
838 | 838 | die(); |
839 | 839 | } |
840 | - header($_SERVER['SERVER_PROTOCOL'] . ' 403 Forbidden', true, 403); |
|
840 | + header($_SERVER['SERVER_PROTOCOL'].' 403 Forbidden', true, 403); |
|
841 | 841 | header('Cache-Control: no-cache, must-revalidate'); |
842 | 842 | header('Expires: Mon, 26 Jul 1997 05:00:00 GMT'); |
843 | 843 | |
@@ -874,7 +874,7 @@ discard block |
||
874 | 874 | */ |
875 | 875 | public function requireSaveMethod() |
876 | 876 | { |
877 | - if('GET' === $_SERVER['REQUEST_METHOD']){ |
|
877 | + if ('GET' === $_SERVER['REQUEST_METHOD']) { |
|
878 | 878 | throw new AppException('Method not allowed'); |
879 | 879 | } |
880 | 880 | |
@@ -889,7 +889,7 @@ discard block |
||
889 | 889 | */ |
890 | 890 | public function requireDeleteMethod() |
891 | 891 | { |
892 | - if('GET' === $_SERVER['REQUEST_METHOD']){ |
|
892 | + if ('GET' === $_SERVER['REQUEST_METHOD']) { |
|
893 | 893 | throw new AppException('Method not allowed'); |
894 | 894 | } |
895 | 895 | |
@@ -921,7 +921,7 @@ discard block |
||
921 | 921 | 'position' => $position |
922 | 922 | ); |
923 | 923 | $babBody = bab_getBody(); |
924 | - if(! isset($babBody->messages['toasts'])){ |
|
924 | + if (!isset($babBody->messages['toasts'])) { |
|
925 | 925 | $babBody->messages['toasts'] = array(); |
926 | 926 | } |
927 | 927 | $babBody->messages['toasts'][] = $toast; |
@@ -93,7 +93,7 @@ |
||
93 | 93 | public function hasNoAccess(AppRecordSet $recordSet, $accessType, $user = null) |
94 | 94 | { |
95 | 95 | $criterion = $this->getAccessCriterion($recordSet, $accessType, $user); |
96 | - if(! $criterion instanceof ORMFalseCriterion){ |
|
96 | + if (!$criterion instanceof ORMFalseCriterion) { |
|
97 | 97 | return false; |
98 | 98 | } |
99 | 99 | return true; |
@@ -6,108 +6,108 @@ |
||
6 | 6 | |
7 | 7 | class ComposerStaticInit0aaa67be5f7bedbc88eff25aa142ea59 |
8 | 8 | { |
9 | - public static $files = array ( |
|
10 | - '0a77660cba4285786b5e8fa0300a9ed0' => __DIR__ . '/../..' . '/programs/Ui/AppHelpers.php', |
|
11 | - '5932da661cc3b0ee915d192fd39ce96c' => __DIR__ . '/../..' . '/programs/Ui/AppTableModelView.php', |
|
9 | + public static $files = array( |
|
10 | + '0a77660cba4285786b5e8fa0300a9ed0' => __DIR__.'/../..'.'/programs/Ui/AppHelpers.php', |
|
11 | + '5932da661cc3b0ee915d192fd39ce96c' => __DIR__.'/../..'.'/programs/Ui/AppTableModelView.php', |
|
12 | 12 | ); |
13 | 13 | |
14 | - public static $prefixLengthsPsr4 = array ( |
|
14 | + public static $prefixLengthsPsr4 = array( |
|
15 | 15 | 'C' => |
16 | - array ( |
|
16 | + array( |
|
17 | 17 | 'Capwelton\\LibApp\\' => 17, |
18 | 18 | ), |
19 | 19 | ); |
20 | 20 | |
21 | - public static $prefixDirsPsr4 = array ( |
|
21 | + public static $prefixDirsPsr4 = array( |
|
22 | 22 | 'Capwelton\\LibApp\\' => |
23 | - array ( |
|
24 | - 0 => __DIR__ . '/../..' . '/programs', |
|
23 | + array( |
|
24 | + 0 => __DIR__.'/../..'.'/programs', |
|
25 | 25 | ), |
26 | 26 | ); |
27 | 27 | |
28 | - public static $classMap = array ( |
|
29 | - 'Capwelton\\LibApp\\AppAccessManager' => __DIR__ . '/../..' . '/programs/AppAccessManager.php', |
|
30 | - 'Capwelton\\LibApp\\AppComponent' => __DIR__ . '/../..' . '/programs/AppComponent.php', |
|
31 | - 'Capwelton\\LibApp\\AppObject' => __DIR__ . '/../..' . '/programs/AppObject.php', |
|
32 | - 'Capwelton\\LibApp\\AppObjectInterface' => __DIR__ . '/../..' . '/programs/AppObjectInterface.php', |
|
33 | - 'Capwelton\\LibApp\\AppUiObject' => __DIR__ . '/../..' . '/programs/AppUiObject.php', |
|
34 | - 'Capwelton\\LibApp\\Ctrl\\AppComponentCtrlRecord' => __DIR__ . '/../..' . '/programs/Ctrl/AppComponentCtrlRecord.php', |
|
35 | - 'Capwelton\\LibApp\\Ctrl\\AppController' => __DIR__ . '/../..' . '/programs/Ctrl/AppController.php', |
|
36 | - 'Capwelton\\LibApp\\Ctrl\\AppCtrlAddonConfiguration' => __DIR__ . '/../..' . '/programs/Ctrl/AppCtrlAddonConfiguration.php', |
|
37 | - 'Capwelton\\LibApp\\Ctrl\\AppCtrlConfiguration' => __DIR__ . '/../..' . '/programs/Ctrl/AppCtrlConfiguration.php', |
|
38 | - 'Capwelton\\LibApp\\Ctrl\\AppCtrlCustomContainer' => __DIR__ . '/../..' . '/programs/Ctrl/AppCtrlCustomContainer.php', |
|
39 | - 'Capwelton\\LibApp\\Ctrl\\AppCtrlCustomField' => __DIR__ . '/../..' . '/programs/Ctrl/AppCtrlCustomField.php', |
|
40 | - 'Capwelton\\LibApp\\Ctrl\\AppCtrlCustomSection' => __DIR__ . '/../..' . '/programs/Ctrl/AppCtrlCustomSection.php', |
|
41 | - 'Capwelton\\LibApp\\Ctrl\\AppCtrlNotification' => __DIR__ . '/../..' . '/programs/Ctrl/AppCtrlNotification.php', |
|
42 | - 'Capwelton\\LibApp\\Ctrl\\AppCtrlRecord' => __DIR__ . '/../..' . '/programs/Ctrl/AppCtrlRecord.php', |
|
43 | - 'Capwelton\\LibApp\\Ctrl\\AppCtrlSSE' => __DIR__ . '/../..' . '/programs/Ctrl/AppCtrlSSE.php', |
|
44 | - 'Capwelton\\LibApp\\Exceptions\\AppAccessException' => __DIR__ . '/../..' . '/programs/Exceptions/AppAccessException.php', |
|
45 | - 'Capwelton\\LibApp\\Exceptions\\AppDeletedRecordException' => __DIR__ . '/../..' . '/programs/Exceptions/AppDeletedRecordException.php', |
|
46 | - 'Capwelton\\LibApp\\Exceptions\\AppEmptyResultException' => __DIR__ . '/../..' . '/programs/Exceptions/AppEmptyResultException.php', |
|
47 | - 'Capwelton\\LibApp\\Exceptions\\AppException' => __DIR__ . '/../..' . '/programs/Exceptions/AppException.php', |
|
48 | - 'Capwelton\\LibApp\\Exceptions\\AppNotFoundException' => __DIR__ . '/../..' . '/programs/Exceptions/AppNotFoundException.php', |
|
49 | - 'Capwelton\\LibApp\\Exceptions\\AppSaveException' => __DIR__ . '/../..' . '/programs/Exceptions/AppSaveException.php', |
|
50 | - 'Capwelton\\LibApp\\Exceptions\\AppUnknownActionException' => __DIR__ . '/../..' . '/programs/Exceptions/AppUnknownActionException.php', |
|
51 | - 'Capwelton\\LibApp\\Func_App' => __DIR__ . '/../..' . '/programs/Func_App.php', |
|
52 | - 'Capwelton\\LibApp\\Interfaces\\AppComponentDefinition' => __DIR__ . '/../..' . '/programs/Interfaces/AppComponentDefinition.php', |
|
53 | - 'Capwelton\\LibApp\\Interfaces\\AppComponentUi' => __DIR__ . '/../..' . '/programs/Interfaces/AppComponentUi.php', |
|
54 | - 'Capwelton\\LibApp\\Interfaces\\AppCtrlRecordInterface' => __DIR__ . '/../..' . '/programs/Interfaces/AppCtrlRecordInterface.php', |
|
55 | - 'Capwelton\\LibApp\\Portlet\\AppPortlet' => __DIR__ . '/../..' . '/programs/Portlet/AppPortlet.php', |
|
56 | - 'Capwelton\\LibApp\\Portlet\\AppPortletDefinition' => __DIR__ . '/../..' . '/programs/Portlet/AppPortletDefinition.php', |
|
57 | - 'Capwelton\\LibApp\\Portlet\\AppPortletUi' => __DIR__ . '/../..' . '/programs/Portlet/AppPortletUi.php', |
|
58 | - 'Capwelton\\LibApp\\Portlet\\Func_PortletBackend_App' => __DIR__ . '/../..' . '/programs/Portlet/Func_PortletBackend_App.php', |
|
59 | - 'Capwelton\\LibApp\\Portlet\\Notifications\\AppPortletDefinitionNotifications' => __DIR__ . '/../..' . '/programs/Portlet/Notifications/AppPortletDefinitionNotifications.php', |
|
60 | - 'Capwelton\\LibApp\\Portlet\\Notifications\\AppPortletUiNotifications' => __DIR__ . '/../..' . '/programs/Portlet/Notifications/AppPortletUiNotifications.php', |
|
61 | - 'Capwelton\\LibApp\\Set\\AppCustomContainer' => __DIR__ . '/../..' . '/programs/Set/AppCustomContainer.php', |
|
62 | - 'Capwelton\\LibApp\\Set\\AppCustomContainerSet' => __DIR__ . '/../..' . '/programs/Set/AppCustomContainerSet.php', |
|
63 | - 'Capwelton\\LibApp\\Set\\AppCustomField' => __DIR__ . '/../..' . '/programs/Set/AppCustomField.php', |
|
64 | - 'Capwelton\\LibApp\\Set\\AppCustomFieldSet' => __DIR__ . '/../..' . '/programs/Set/AppCustomFieldSet.php', |
|
65 | - 'Capwelton\\LibApp\\Set\\AppCustomSection' => __DIR__ . '/../..' . '/programs/Set/AppCustomSection.php', |
|
66 | - 'Capwelton\\LibApp\\Set\\AppCustomSectionSet' => __DIR__ . '/../..' . '/programs/Set/AppCustomSectionSet.php', |
|
67 | - 'Capwelton\\LibApp\\Set\\AppLink' => __DIR__ . '/../..' . '/programs/Set/AppLink.php', |
|
68 | - 'Capwelton\\LibApp\\Set\\AppLinkSet' => __DIR__ . '/../..' . '/programs/Set/AppLinkSet.php', |
|
69 | - 'Capwelton\\LibApp\\Set\\AppLog' => __DIR__ . '/../..' . '/programs/Set/AppLog.php', |
|
70 | - 'Capwelton\\LibApp\\Set\\AppLogSet' => __DIR__ . '/../..' . '/programs/Set/AppLogSet.php', |
|
71 | - 'Capwelton\\LibApp\\Set\\AppNotification' => __DIR__ . '/../..' . '/programs/Set/AppNotification.php', |
|
72 | - 'Capwelton\\LibApp\\Set\\AppNotificationSet' => __DIR__ . '/../..' . '/programs/Set/AppNotificationSet.php', |
|
73 | - 'Capwelton\\LibApp\\Set\\AppRecord' => __DIR__ . '/../..' . '/programs/Set/AppRecord.php', |
|
74 | - 'Capwelton\\LibApp\\Set\\AppRecordSet' => __DIR__ . '/../..' . '/programs/Set/AppRecordSet.php', |
|
75 | - 'Capwelton\\LibApp\\Set\\AppRole' => __DIR__ . '/../..' . '/programs/Set/AppRole.php', |
|
76 | - 'Capwelton\\LibApp\\Set\\AppRoleAccess' => __DIR__ . '/../..' . '/programs/Set/AppRoleAccess.php', |
|
77 | - 'Capwelton\\LibApp\\Set\\AppRoleAccessSet' => __DIR__ . '/../..' . '/programs/Set/AppRoleAccessSet.php', |
|
78 | - 'Capwelton\\LibApp\\Set\\AppRoleSet' => __DIR__ . '/../..' . '/programs/Set/AppRoleSet.php', |
|
79 | - 'Capwelton\\LibApp\\Set\\AppSSE' => __DIR__ . '/../..' . '/programs/Set/AppSSE.php', |
|
80 | - 'Capwelton\\LibApp\\Set\\AppSSESet' => __DIR__ . '/../..' . '/programs/Set/AppSSESet.php', |
|
81 | - 'Capwelton\\LibApp\\Set\\AppTraceableRecord' => __DIR__ . '/../..' . '/programs/Set/AppTraceableRecord.php', |
|
82 | - 'Capwelton\\LibApp\\Set\\AppTraceableRecordSet' => __DIR__ . '/../..' . '/programs/Set/AppTraceableRecordSet.php', |
|
83 | - 'Capwelton\\LibApp\\Set\\RecordAfterSaveEvent' => __DIR__ . '/../..' . '/programs/Set/RecordAfterSaveEvent.php', |
|
84 | - 'Capwelton\\LibApp\\Set\\RecordBeforeSaveEvent' => __DIR__ . '/../..' . '/programs/Set/RecordBeforeSaveEvent.php', |
|
85 | - 'Capwelton\\LibApp\\Ui\\AppCardFrame' => __DIR__ . '/../..' . '/programs/Ui/AppCardFrame.php', |
|
86 | - 'Capwelton\\LibApp\\Ui\\AppCriteriaEditor' => __DIR__ . '/../..' . '/programs/Ui/AppCriteriaEditor.php', |
|
87 | - 'Capwelton\\LibApp\\Ui\\AppCustomFieldEditor' => __DIR__ . '/../..' . '/programs/Ui/AppCustomFieldEditor.php', |
|
88 | - 'Capwelton\\LibApp\\Ui\\AppCustomFieldTableView' => __DIR__ . '/../..' . '/programs/Ui/AppCustomFieldTableView.php', |
|
89 | - 'Capwelton\\LibApp\\Ui\\AppEditor' => __DIR__ . '/../..' . '/programs/Ui/AppEditor.php', |
|
90 | - 'Capwelton\\LibApp\\Ui\\AppExportSelectEditor' => __DIR__ . '/../..' . '/programs/Ui/AppExportSelectEditor.php', |
|
91 | - 'Capwelton\\LibApp\\Ui\\AppRecordEditor' => __DIR__ . '/../..' . '/programs/Ui/AppRecordEditor.php', |
|
92 | - 'Capwelton\\LibApp\\Ui\\AppRecordFrame' => __DIR__ . '/../..' . '/programs/Ui/AppRecordFrame.php', |
|
93 | - 'Capwelton\\LibApp\\Ui\\AppRecordView' => __DIR__ . '/../..' . '/programs/Ui/AppRecordView.php', |
|
94 | - 'Capwelton\\LibApp\\Ui\\AppTableModelView' => __DIR__ . '/../..' . '/programs/Ui/AppTableModelView.php', |
|
95 | - 'Capwelton\\LibApp\\Ui\\AppTableModelViewColumnSettingsEditor' => __DIR__ . '/../..' . '/programs/Ui/AppTableModelViewColumnSettingsEditor.php', |
|
96 | - 'Capwelton\\LibApp\\Ui\\AppToolbar' => __DIR__ . '/../..' . '/programs/Ui/AppToolbar.php', |
|
97 | - 'Capwelton\\LibApp\\Ui\\AppUi' => __DIR__ . '/../..' . '/programs/Ui/AppUi.php', |
|
98 | - 'Capwelton\\LibApp\\Ui\\Items\\AppChip' => __DIR__ . '/../..' . '/programs/Ui/Items/AppChip.php', |
|
99 | - 'Capwelton\\LibApp\\Ui\\Items\\AppShape' => __DIR__ . '/../..' . '/programs/Ui/Items/AppShape.php', |
|
100 | - 'Capwelton\\LibApp\\Ui\\Items\\AppShapeCircle' => __DIR__ . '/../..' . '/programs/Ui/Items/AppShapeCircle.php', |
|
101 | - 'Capwelton\\LibApp\\Ui\\Items\\AppShapeSquare' => __DIR__ . '/../..' . '/programs/Ui/Items/AppShapeSquare.php', |
|
102 | - 'Capwelton\\LibApp\\Ui\\Items\\AppShapeTriangle' => __DIR__ . '/../..' . '/programs/Ui/Items/AppShapeTriangle.php', |
|
103 | - 'Capwelton\\LibApp\\Ui\\Page\\AppErrorPage' => __DIR__ . '/../..' . '/programs/Ui/Page/AppErrorPage.php', |
|
104 | - 'Capwelton\\LibApp\\Ui\\Page\\AppPage' => __DIR__ . '/../..' . '/programs/Ui/Page/AppPage.php', |
|
105 | - 'Composer\\InstalledVersions' => __DIR__ . '/..' . '/composer/InstalledVersions.php', |
|
28 | + public static $classMap = array( |
|
29 | + 'Capwelton\\LibApp\\AppAccessManager' => __DIR__.'/../..'.'/programs/AppAccessManager.php', |
|
30 | + 'Capwelton\\LibApp\\AppComponent' => __DIR__.'/../..'.'/programs/AppComponent.php', |
|
31 | + 'Capwelton\\LibApp\\AppObject' => __DIR__.'/../..'.'/programs/AppObject.php', |
|
32 | + 'Capwelton\\LibApp\\AppObjectInterface' => __DIR__.'/../..'.'/programs/AppObjectInterface.php', |
|
33 | + 'Capwelton\\LibApp\\AppUiObject' => __DIR__.'/../..'.'/programs/AppUiObject.php', |
|
34 | + 'Capwelton\\LibApp\\Ctrl\\AppComponentCtrlRecord' => __DIR__.'/../..'.'/programs/Ctrl/AppComponentCtrlRecord.php', |
|
35 | + 'Capwelton\\LibApp\\Ctrl\\AppController' => __DIR__.'/../..'.'/programs/Ctrl/AppController.php', |
|
36 | + 'Capwelton\\LibApp\\Ctrl\\AppCtrlAddonConfiguration' => __DIR__.'/../..'.'/programs/Ctrl/AppCtrlAddonConfiguration.php', |
|
37 | + 'Capwelton\\LibApp\\Ctrl\\AppCtrlConfiguration' => __DIR__.'/../..'.'/programs/Ctrl/AppCtrlConfiguration.php', |
|
38 | + 'Capwelton\\LibApp\\Ctrl\\AppCtrlCustomContainer' => __DIR__.'/../..'.'/programs/Ctrl/AppCtrlCustomContainer.php', |
|
39 | + 'Capwelton\\LibApp\\Ctrl\\AppCtrlCustomField' => __DIR__.'/../..'.'/programs/Ctrl/AppCtrlCustomField.php', |
|
40 | + 'Capwelton\\LibApp\\Ctrl\\AppCtrlCustomSection' => __DIR__.'/../..'.'/programs/Ctrl/AppCtrlCustomSection.php', |
|
41 | + 'Capwelton\\LibApp\\Ctrl\\AppCtrlNotification' => __DIR__.'/../..'.'/programs/Ctrl/AppCtrlNotification.php', |
|
42 | + 'Capwelton\\LibApp\\Ctrl\\AppCtrlRecord' => __DIR__.'/../..'.'/programs/Ctrl/AppCtrlRecord.php', |
|
43 | + 'Capwelton\\LibApp\\Ctrl\\AppCtrlSSE' => __DIR__.'/../..'.'/programs/Ctrl/AppCtrlSSE.php', |
|
44 | + 'Capwelton\\LibApp\\Exceptions\\AppAccessException' => __DIR__.'/../..'.'/programs/Exceptions/AppAccessException.php', |
|
45 | + 'Capwelton\\LibApp\\Exceptions\\AppDeletedRecordException' => __DIR__.'/../..'.'/programs/Exceptions/AppDeletedRecordException.php', |
|
46 | + 'Capwelton\\LibApp\\Exceptions\\AppEmptyResultException' => __DIR__.'/../..'.'/programs/Exceptions/AppEmptyResultException.php', |
|
47 | + 'Capwelton\\LibApp\\Exceptions\\AppException' => __DIR__.'/../..'.'/programs/Exceptions/AppException.php', |
|
48 | + 'Capwelton\\LibApp\\Exceptions\\AppNotFoundException' => __DIR__.'/../..'.'/programs/Exceptions/AppNotFoundException.php', |
|
49 | + 'Capwelton\\LibApp\\Exceptions\\AppSaveException' => __DIR__.'/../..'.'/programs/Exceptions/AppSaveException.php', |
|
50 | + 'Capwelton\\LibApp\\Exceptions\\AppUnknownActionException' => __DIR__.'/../..'.'/programs/Exceptions/AppUnknownActionException.php', |
|
51 | + 'Capwelton\\LibApp\\Func_App' => __DIR__.'/../..'.'/programs/Func_App.php', |
|
52 | + 'Capwelton\\LibApp\\Interfaces\\AppComponentDefinition' => __DIR__.'/../..'.'/programs/Interfaces/AppComponentDefinition.php', |
|
53 | + 'Capwelton\\LibApp\\Interfaces\\AppComponentUi' => __DIR__.'/../..'.'/programs/Interfaces/AppComponentUi.php', |
|
54 | + 'Capwelton\\LibApp\\Interfaces\\AppCtrlRecordInterface' => __DIR__.'/../..'.'/programs/Interfaces/AppCtrlRecordInterface.php', |
|
55 | + 'Capwelton\\LibApp\\Portlet\\AppPortlet' => __DIR__.'/../..'.'/programs/Portlet/AppPortlet.php', |
|
56 | + 'Capwelton\\LibApp\\Portlet\\AppPortletDefinition' => __DIR__.'/../..'.'/programs/Portlet/AppPortletDefinition.php', |
|
57 | + 'Capwelton\\LibApp\\Portlet\\AppPortletUi' => __DIR__.'/../..'.'/programs/Portlet/AppPortletUi.php', |
|
58 | + 'Capwelton\\LibApp\\Portlet\\Func_PortletBackend_App' => __DIR__.'/../..'.'/programs/Portlet/Func_PortletBackend_App.php', |
|
59 | + 'Capwelton\\LibApp\\Portlet\\Notifications\\AppPortletDefinitionNotifications' => __DIR__.'/../..'.'/programs/Portlet/Notifications/AppPortletDefinitionNotifications.php', |
|
60 | + 'Capwelton\\LibApp\\Portlet\\Notifications\\AppPortletUiNotifications' => __DIR__.'/../..'.'/programs/Portlet/Notifications/AppPortletUiNotifications.php', |
|
61 | + 'Capwelton\\LibApp\\Set\\AppCustomContainer' => __DIR__.'/../..'.'/programs/Set/AppCustomContainer.php', |
|
62 | + 'Capwelton\\LibApp\\Set\\AppCustomContainerSet' => __DIR__.'/../..'.'/programs/Set/AppCustomContainerSet.php', |
|
63 | + 'Capwelton\\LibApp\\Set\\AppCustomField' => __DIR__.'/../..'.'/programs/Set/AppCustomField.php', |
|
64 | + 'Capwelton\\LibApp\\Set\\AppCustomFieldSet' => __DIR__.'/../..'.'/programs/Set/AppCustomFieldSet.php', |
|
65 | + 'Capwelton\\LibApp\\Set\\AppCustomSection' => __DIR__.'/../..'.'/programs/Set/AppCustomSection.php', |
|
66 | + 'Capwelton\\LibApp\\Set\\AppCustomSectionSet' => __DIR__.'/../..'.'/programs/Set/AppCustomSectionSet.php', |
|
67 | + 'Capwelton\\LibApp\\Set\\AppLink' => __DIR__.'/../..'.'/programs/Set/AppLink.php', |
|
68 | + 'Capwelton\\LibApp\\Set\\AppLinkSet' => __DIR__.'/../..'.'/programs/Set/AppLinkSet.php', |
|
69 | + 'Capwelton\\LibApp\\Set\\AppLog' => __DIR__.'/../..'.'/programs/Set/AppLog.php', |
|
70 | + 'Capwelton\\LibApp\\Set\\AppLogSet' => __DIR__.'/../..'.'/programs/Set/AppLogSet.php', |
|
71 | + 'Capwelton\\LibApp\\Set\\AppNotification' => __DIR__.'/../..'.'/programs/Set/AppNotification.php', |
|
72 | + 'Capwelton\\LibApp\\Set\\AppNotificationSet' => __DIR__.'/../..'.'/programs/Set/AppNotificationSet.php', |
|
73 | + 'Capwelton\\LibApp\\Set\\AppRecord' => __DIR__.'/../..'.'/programs/Set/AppRecord.php', |
|
74 | + 'Capwelton\\LibApp\\Set\\AppRecordSet' => __DIR__.'/../..'.'/programs/Set/AppRecordSet.php', |
|
75 | + 'Capwelton\\LibApp\\Set\\AppRole' => __DIR__.'/../..'.'/programs/Set/AppRole.php', |
|
76 | + 'Capwelton\\LibApp\\Set\\AppRoleAccess' => __DIR__.'/../..'.'/programs/Set/AppRoleAccess.php', |
|
77 | + 'Capwelton\\LibApp\\Set\\AppRoleAccessSet' => __DIR__.'/../..'.'/programs/Set/AppRoleAccessSet.php', |
|
78 | + 'Capwelton\\LibApp\\Set\\AppRoleSet' => __DIR__.'/../..'.'/programs/Set/AppRoleSet.php', |
|
79 | + 'Capwelton\\LibApp\\Set\\AppSSE' => __DIR__.'/../..'.'/programs/Set/AppSSE.php', |
|
80 | + 'Capwelton\\LibApp\\Set\\AppSSESet' => __DIR__.'/../..'.'/programs/Set/AppSSESet.php', |
|
81 | + 'Capwelton\\LibApp\\Set\\AppTraceableRecord' => __DIR__.'/../..'.'/programs/Set/AppTraceableRecord.php', |
|
82 | + 'Capwelton\\LibApp\\Set\\AppTraceableRecordSet' => __DIR__.'/../..'.'/programs/Set/AppTraceableRecordSet.php', |
|
83 | + 'Capwelton\\LibApp\\Set\\RecordAfterSaveEvent' => __DIR__.'/../..'.'/programs/Set/RecordAfterSaveEvent.php', |
|
84 | + 'Capwelton\\LibApp\\Set\\RecordBeforeSaveEvent' => __DIR__.'/../..'.'/programs/Set/RecordBeforeSaveEvent.php', |
|
85 | + 'Capwelton\\LibApp\\Ui\\AppCardFrame' => __DIR__.'/../..'.'/programs/Ui/AppCardFrame.php', |
|
86 | + 'Capwelton\\LibApp\\Ui\\AppCriteriaEditor' => __DIR__.'/../..'.'/programs/Ui/AppCriteriaEditor.php', |
|
87 | + 'Capwelton\\LibApp\\Ui\\AppCustomFieldEditor' => __DIR__.'/../..'.'/programs/Ui/AppCustomFieldEditor.php', |
|
88 | + 'Capwelton\\LibApp\\Ui\\AppCustomFieldTableView' => __DIR__.'/../..'.'/programs/Ui/AppCustomFieldTableView.php', |
|
89 | + 'Capwelton\\LibApp\\Ui\\AppEditor' => __DIR__.'/../..'.'/programs/Ui/AppEditor.php', |
|
90 | + 'Capwelton\\LibApp\\Ui\\AppExportSelectEditor' => __DIR__.'/../..'.'/programs/Ui/AppExportSelectEditor.php', |
|
91 | + 'Capwelton\\LibApp\\Ui\\AppRecordEditor' => __DIR__.'/../..'.'/programs/Ui/AppRecordEditor.php', |
|
92 | + 'Capwelton\\LibApp\\Ui\\AppRecordFrame' => __DIR__.'/../..'.'/programs/Ui/AppRecordFrame.php', |
|
93 | + 'Capwelton\\LibApp\\Ui\\AppRecordView' => __DIR__.'/../..'.'/programs/Ui/AppRecordView.php', |
|
94 | + 'Capwelton\\LibApp\\Ui\\AppTableModelView' => __DIR__.'/../..'.'/programs/Ui/AppTableModelView.php', |
|
95 | + 'Capwelton\\LibApp\\Ui\\AppTableModelViewColumnSettingsEditor' => __DIR__.'/../..'.'/programs/Ui/AppTableModelViewColumnSettingsEditor.php', |
|
96 | + 'Capwelton\\LibApp\\Ui\\AppToolbar' => __DIR__.'/../..'.'/programs/Ui/AppToolbar.php', |
|
97 | + 'Capwelton\\LibApp\\Ui\\AppUi' => __DIR__.'/../..'.'/programs/Ui/AppUi.php', |
|
98 | + 'Capwelton\\LibApp\\Ui\\Items\\AppChip' => __DIR__.'/../..'.'/programs/Ui/Items/AppChip.php', |
|
99 | + 'Capwelton\\LibApp\\Ui\\Items\\AppShape' => __DIR__.'/../..'.'/programs/Ui/Items/AppShape.php', |
|
100 | + 'Capwelton\\LibApp\\Ui\\Items\\AppShapeCircle' => __DIR__.'/../..'.'/programs/Ui/Items/AppShapeCircle.php', |
|
101 | + 'Capwelton\\LibApp\\Ui\\Items\\AppShapeSquare' => __DIR__.'/../..'.'/programs/Ui/Items/AppShapeSquare.php', |
|
102 | + 'Capwelton\\LibApp\\Ui\\Items\\AppShapeTriangle' => __DIR__.'/../..'.'/programs/Ui/Items/AppShapeTriangle.php', |
|
103 | + 'Capwelton\\LibApp\\Ui\\Page\\AppErrorPage' => __DIR__.'/../..'.'/programs/Ui/Page/AppErrorPage.php', |
|
104 | + 'Capwelton\\LibApp\\Ui\\Page\\AppPage' => __DIR__.'/../..'.'/programs/Ui/Page/AppPage.php', |
|
105 | + 'Composer\\InstalledVersions' => __DIR__.'/..'.'/composer/InstalledVersions.php', |
|
106 | 106 | ); |
107 | 107 | |
108 | 108 | public static function getInitializer(ClassLoader $loader) |
109 | 109 | { |
110 | - return \Closure::bind(function () use ($loader) { |
|
110 | + return \Closure::bind(function() use ($loader) { |
|
111 | 111 | $loader->prefixLengthsPsr4 = ComposerStaticInit0aaa67be5f7bedbc88eff25aa142ea59::$prefixLengthsPsr4; |
112 | 112 | $loader->prefixDirsPsr4 = ComposerStaticInit0aaa67be5f7bedbc88eff25aa142ea59::$prefixDirsPsr4; |
113 | 113 | $loader->classMap = ComposerStaticInit0aaa67be5f7bedbc88eff25aa142ea59::$classMap; |
@@ -9,7 +9,7 @@ discard block |
||
9 | 9 | public static function loadClassLoader($class) |
10 | 10 | { |
11 | 11 | if ('Composer\Autoload\ClassLoader' === $class) { |
12 | - require __DIR__ . '/ClassLoader.php'; |
|
12 | + require __DIR__.'/ClassLoader.php'; |
|
13 | 13 | } |
14 | 14 | } |
15 | 15 | |
@@ -22,7 +22,7 @@ discard block |
||
22 | 22 | return self::$loader; |
23 | 23 | } |
24 | 24 | |
25 | - require __DIR__ . '/platform_check.php'; |
|
25 | + require __DIR__.'/platform_check.php'; |
|
26 | 26 | |
27 | 27 | spl_autoload_register(array('ComposerAutoloaderInit0aaa67be5f7bedbc88eff25aa142ea59', 'loadClassLoader'), true, true); |
28 | 28 | self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(\dirname(__FILE__))); |
@@ -30,21 +30,21 @@ discard block |
||
30 | 30 | |
31 | 31 | $useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded()); |
32 | 32 | if ($useStaticLoader) { |
33 | - require __DIR__ . '/autoload_static.php'; |
|
33 | + require __DIR__.'/autoload_static.php'; |
|
34 | 34 | |
35 | 35 | call_user_func(\Composer\Autoload\ComposerStaticInit0aaa67be5f7bedbc88eff25aa142ea59::getInitializer($loader)); |
36 | 36 | } else { |
37 | - $map = require __DIR__ . '/autoload_namespaces.php'; |
|
37 | + $map = require __DIR__.'/autoload_namespaces.php'; |
|
38 | 38 | foreach ($map as $namespace => $path) { |
39 | 39 | $loader->set($namespace, $path); |
40 | 40 | } |
41 | 41 | |
42 | - $map = require __DIR__ . '/autoload_psr4.php'; |
|
42 | + $map = require __DIR__.'/autoload_psr4.php'; |
|
43 | 43 | foreach ($map as $namespace => $path) { |
44 | 44 | $loader->setPsr4($namespace, $path); |
45 | 45 | } |
46 | 46 | |
47 | - $classMap = require __DIR__ . '/autoload_classmap.php'; |
|
47 | + $classMap = require __DIR__.'/autoload_classmap.php'; |
|
48 | 48 | if ($classMap) { |
49 | 49 | $loader->addClassMap($classMap); |
50 | 50 | } |
@@ -55,7 +55,7 @@ discard block |
||
55 | 55 | if ($useStaticLoader) { |
56 | 56 | $includeFiles = Composer\Autoload\ComposerStaticInit0aaa67be5f7bedbc88eff25aa142ea59::$files; |
57 | 57 | } else { |
58 | - $includeFiles = require __DIR__ . '/autoload_files.php'; |
|
58 | + $includeFiles = require __DIR__.'/autoload_files.php'; |
|
59 | 59 | } |
60 | 60 | foreach ($includeFiles as $fileIdentifier => $file) { |
61 | 61 | composerRequire0aaa67be5f7bedbc88eff25aa142ea59($fileIdentifier, $file); |