@@ -21,8 +21,8 @@ discard block |
||
21 | 21 | * @copyright Copyright (c) 2018 by CANTICO ({@link http://www.cantico.fr}) |
22 | 22 | */ |
23 | 23 | |
24 | -require_once dirname(__FILE__) . '/define.php'; |
|
25 | -require_once dirname(__FILE__) . '/functions.php'; |
|
24 | +require_once dirname(__FILE__).'/define.php'; |
|
25 | +require_once dirname(__FILE__).'/functions.php'; |
|
26 | 26 | |
27 | 27 | |
28 | 28 | |
@@ -55,14 +55,14 @@ discard block |
||
55 | 55 | $this->addonName = 'libapp'; |
56 | 56 | $this->addonPrefix = 'app'; |
57 | 57 | |
58 | - $this->classPrefix = $this->addonPrefix . '_'; |
|
59 | - $this->controllerTg = 'addon/' . $this->addonName . '/main'; |
|
58 | + $this->classPrefix = $this->addonPrefix.'_'; |
|
59 | + $this->controllerTg = 'addon/'.$this->addonName.'/main'; |
|
60 | 60 | |
61 | 61 | $addon = bab_getAddonInfosInstance($this->addonName); |
62 | 62 | $this->phpPath = $addon->getPhpPath(); |
63 | 63 | $this->recordSetPath = $this->phpPath; |
64 | 64 | $this->ctrlPath = $this->phpPath; |
65 | - $this->uiPath = $this->phpPath . 'ui/'; |
|
65 | + $this->uiPath = $this->phpPath.'ui/'; |
|
66 | 66 | |
67 | 67 | $babDB = bab_getDB(); |
68 | 68 | |
@@ -109,8 +109,8 @@ discard block |
||
109 | 109 | public function getRecordSetPathname($class) |
110 | 110 | { |
111 | 111 | // $App->MyRecordSet() -> myrecord.class.php |
112 | - $file = strtolower(substr($class, strlen($this->classPrefix), -3)) . '.class.php'; |
|
113 | - return $this->recordSetPath . $file; |
|
112 | + $file = strtolower(substr($class, strlen($this->classPrefix), -3)).'.class.php'; |
|
113 | + return $this->recordSetPath.$file; |
|
114 | 114 | } |
115 | 115 | |
116 | 116 | /** |
@@ -122,8 +122,8 @@ discard block |
||
122 | 122 | public function getRecordPathname($class) |
123 | 123 | { |
124 | 124 | // $App->MyRecord() -> myrecord.class.php |
125 | - $file = strtolower(substr($class, strlen($this->classPrefix))) . '.class.php'; |
|
126 | - return $this->recordSetPath . $file; |
|
125 | + $file = strtolower(substr($class, strlen($this->classPrefix))).'.class.php'; |
|
126 | + return $this->recordSetPath.$file; |
|
127 | 127 | } |
128 | 128 | |
129 | 129 | /** |
@@ -227,7 +227,7 @@ discard block |
||
227 | 227 | |
228 | 228 | if (substr($method, 0, 7) === 'include' && substr($method, -3) === 'Set') { |
229 | 229 | $incl = $method; |
230 | - $classNameMethod = substr($method, strlen('include')) . 'ClassName'; |
|
230 | + $classNameMethod = substr($method, strlen('include')).'ClassName'; |
|
231 | 231 | |
232 | 232 | |
233 | 233 | $classname = $this->$classNameMethod(); |
@@ -249,7 +249,7 @@ discard block |
||
249 | 249 | // We need to revert to multilang fields before synchronizing. |
250 | 250 | $set->useLang(false); |
251 | 251 | } |
252 | - $sql .= $mysqlbackend->setToSql($set) . "\n"; |
|
252 | + $sql .= $mysqlbackend->setToSql($set)."\n"; |
|
253 | 253 | } |
254 | 254 | } |
255 | 255 | } |
@@ -280,7 +280,7 @@ discard block |
||
280 | 280 | |
281 | 281 | if (substr($method, 0, strlen('include')) === 'include' && substr($method, -strlen('Set')) === 'Set') { |
282 | 282 | $incl = $method; |
283 | - $classNameMethod = substr($method, strlen('include')) . 'ClassName'; |
|
283 | + $classNameMethod = substr($method, strlen('include')).'ClassName'; |
|
284 | 284 | |
285 | 285 | $classname = $this->$classNameMethod(); |
286 | 286 | |
@@ -294,7 +294,7 @@ discard block |
||
294 | 294 | |
295 | 295 | if (class_exists($classname) && method_exists($this, $call)) { |
296 | 296 | $set = $this->$call(); |
297 | - $sql .= $mysqlbackend->setToSql($set) . "\n"; |
|
297 | + $sql .= $mysqlbackend->setToSql($set)."\n"; |
|
298 | 298 | } |
299 | 299 | } |
300 | 300 | } |
@@ -308,7 +308,7 @@ discard block |
||
308 | 308 | |
309 | 309 | public function includeBase() |
310 | 310 | { |
311 | - require_once APP_PHP_PATH . 'base.class.php'; |
|
311 | + require_once APP_PHP_PATH.'base.class.php'; |
|
312 | 312 | } |
313 | 313 | |
314 | 314 | /** |
@@ -316,7 +316,7 @@ discard block |
||
316 | 316 | */ |
317 | 317 | public function includeRecordSet() |
318 | 318 | { |
319 | - require_once APP_SET_PATH . 'record.class.php'; |
|
319 | + require_once APP_SET_PATH.'record.class.php'; |
|
320 | 320 | } |
321 | 321 | |
322 | 322 | |
@@ -325,7 +325,7 @@ discard block |
||
325 | 325 | */ |
326 | 326 | public function includeTraceableRecordSet() |
327 | 327 | { |
328 | - require_once APP_SET_PATH . 'traceablerecord.class.php'; |
|
328 | + require_once APP_SET_PATH.'traceablerecord.class.php'; |
|
329 | 329 | } |
330 | 330 | |
331 | 331 | |
@@ -341,7 +341,7 @@ discard block |
||
341 | 341 | */ |
342 | 342 | public function includeLogSet() |
343 | 343 | { |
344 | - require_once APP_SET_PATH . 'log.class.php'; |
|
344 | + require_once APP_SET_PATH.'log.class.php'; |
|
345 | 345 | } |
346 | 346 | |
347 | 347 | /** |
@@ -357,7 +357,7 @@ discard block |
||
357 | 357 | */ |
358 | 358 | public function LogSetClassName() |
359 | 359 | { |
360 | - return $this->LogClassName() . 'Set'; |
|
360 | + return $this->LogClassName().'Set'; |
|
361 | 361 | } |
362 | 362 | |
363 | 363 | /** |
@@ -379,7 +379,7 @@ discard block |
||
379 | 379 | */ |
380 | 380 | public function includeLinkSet() |
381 | 381 | { |
382 | - require_once APP_SET_PATH . 'link.class.php'; |
|
382 | + require_once APP_SET_PATH.'link.class.php'; |
|
383 | 383 | } |
384 | 384 | |
385 | 385 | /** |
@@ -395,7 +395,7 @@ discard block |
||
395 | 395 | */ |
396 | 396 | public function LinkSetClassName() |
397 | 397 | { |
398 | - return $this->LinkClassName() . 'Set'; |
|
398 | + return $this->LinkClassName().'Set'; |
|
399 | 399 | } |
400 | 400 | |
401 | 401 | /** |
@@ -429,7 +429,7 @@ discard block |
||
429 | 429 | return null; |
430 | 430 | } |
431 | 431 | list($classname, $id) = $refParts; |
432 | - $classSet = $classname . 'Set'; |
|
432 | + $classSet = $classname.'Set'; |
|
433 | 433 | $set = $this->$classSet(); |
434 | 434 | if (isset($set)) { |
435 | 435 | return $set->get($id); |
@@ -448,7 +448,7 @@ discard block |
||
448 | 448 | { |
449 | 449 | $fullClassName = get_class($record); |
450 | 450 | list(, $className) = explode('_', $fullClassName); |
451 | - return $className . ':' . $record->id; |
|
451 | + return $className.':'.$record->id; |
|
452 | 452 | } |
453 | 453 | |
454 | 454 | |
@@ -539,16 +539,16 @@ discard block |
||
539 | 539 | */ |
540 | 540 | public function mailTo($addr, $subject = null, $body = null) |
541 | 541 | { |
542 | - $mailTo = 'mailto:' . $addr; |
|
542 | + $mailTo = 'mailto:'.$addr; |
|
543 | 543 | $parameters = array(); |
544 | 544 | if (isset($subject)) { |
545 | - $parameters[] = 'subject=' . $subject; |
|
545 | + $parameters[] = 'subject='.$subject; |
|
546 | 546 | } |
547 | 547 | if (isset($body)) { |
548 | - $parameters[] = 'body=' . $body; |
|
548 | + $parameters[] = 'body='.$body; |
|
549 | 549 | } |
550 | 550 | if (!empty($parameters)) { |
551 | - $mailTo .= '?' . implode('&', $parameters); |
|
551 | + $mailTo .= '?'.implode('&', $parameters); |
|
552 | 552 | } |
553 | 553 | |
554 | 554 | return $mailTo; |
@@ -599,7 +599,7 @@ discard block |
||
599 | 599 | } |
600 | 600 | |
601 | 601 | $number = number_format($number, $decimals, ',', ' '); |
602 | - return str_replace(' ', bab_nbsp(), $number . ' ' . $prefix . $unitSymbol); |
|
602 | + return str_replace(' ', bab_nbsp(), $number.' '.$prefix.$unitSymbol); |
|
603 | 603 | } |
604 | 604 | |
605 | 605 | |
@@ -619,7 +619,7 @@ discard block |
||
619 | 619 | } |
620 | 620 | |
621 | 621 | if (!isset($format)) { |
622 | - $format = bab_registry::get('/' . $this->addonName . '/numberFormat', $PhoneNumber->getDefaultFormat()); |
|
622 | + $format = bab_registry::get('/'.$this->addonName.'/numberFormat', $PhoneNumber->getDefaultFormat()); |
|
623 | 623 | } |
624 | 624 | $phoneNumberUtil = $PhoneNumber->PhoneNumberUtil(); |
625 | 625 | |
@@ -640,7 +640,7 @@ discard block |
||
640 | 640 | */ |
641 | 641 | public function includeController() |
642 | 642 | { |
643 | - require_once APP_PHP_PATH . '/controller.class.php'; |
|
643 | + require_once APP_PHP_PATH.'/controller.class.php'; |
|
644 | 644 | } |
645 | 645 | |
646 | 646 | |
@@ -649,7 +649,7 @@ discard block |
||
649 | 649 | */ |
650 | 650 | public function includeRecordController() |
651 | 651 | { |
652 | - require_once APP_CTRL_PATH . '/record.ctrl.php'; |
|
652 | + require_once APP_CTRL_PATH.'/record.ctrl.php'; |
|
653 | 653 | } |
654 | 654 | |
655 | 655 | |
@@ -689,7 +689,7 @@ discard block |
||
689 | 689 | */ |
690 | 690 | public function includeUi() |
691 | 691 | { |
692 | - require_once APP_UI_PATH . 'ui.class.php'; |
|
692 | + require_once APP_UI_PATH.'ui.class.php'; |
|
693 | 693 | } |
694 | 694 | |
695 | 695 | |
@@ -701,7 +701,7 @@ discard block |
||
701 | 701 | public function Ui() |
702 | 702 | { |
703 | 703 | $this->includeUi(); |
704 | - return bab_getInstance($this->classPrefix . 'Ui');//->setApp($this); |
|
704 | + return bab_getInstance($this->classPrefix.'Ui'); //->setApp($this); |
|
705 | 705 | } |
706 | 706 | |
707 | 707 | /** |
@@ -729,29 +729,29 @@ discard block |
||
729 | 729 | |
730 | 730 | case substr($name, -strlen('SetClassName')) === 'SetClassName': |
731 | 731 | $setName = substr($name, 0, strlen($name) - strlen('ClassName')); |
732 | - return $this->classPrefix . $setName; |
|
732 | + return $this->classPrefix.$setName; |
|
733 | 733 | |
734 | 734 | case substr($name, -strlen('ClassName')) === 'ClassName': |
735 | 735 | $recordName = substr($name, 0, strlen($name) - strlen('ClassName')); |
736 | - return $this->classPrefix . $recordName; |
|
736 | + return $this->classPrefix.$recordName; |
|
737 | 737 | |
738 | 738 | case substr($name, 0, strlen('include')) === 'include' && substr($name, -strlen('Set')) === 'Set': |
739 | 739 | $fileNameBase = strtolower(substr(substr($name, 0, strlen($name) - strlen('Set')), strlen('include'))); |
740 | - require_once PHP_SET_PATH . $fileNameBase . '.class.php'; |
|
740 | + require_once PHP_SET_PATH.$fileNameBase.'.class.php'; |
|
741 | 741 | return; |
742 | 742 | |
743 | 743 | case substr($name, -strlen('Set')) === 'Set': |
744 | - $includeMethod = 'include' . $name; |
|
744 | + $includeMethod = 'include'.$name; |
|
745 | 745 | $this->$includeMethod(); |
746 | - $setClassNameMethod = $name . 'ClassName'; |
|
746 | + $setClassNameMethod = $name.'ClassName'; |
|
747 | 747 | $className = $this->$setClassNameMethod(); |
748 | 748 | $set = new $className($this); |
749 | 749 | return $set; |
750 | 750 | |
751 | 751 | //case method_exists($this, $name . 'Set'): |
752 | 752 | default: |
753 | - $setName = $name . 'Set'; |
|
754 | - $recordClassNameMethod = $name . 'ClassName'; |
|
753 | + $setName = $name.'Set'; |
|
754 | + $recordClassNameMethod = $name.'ClassName'; |
|
755 | 755 | $recordClassName = $this->$recordClassNameMethod(); |
756 | 756 | if (isset($arguments[0])) { |
757 | 757 | if ($arguments[0] instanceof $recordClassName) { |