@@ -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 | /** |
@@ -224,7 +224,7 @@ discard block |
||
224 | 224 | |
225 | 225 | if (substr($method, 0, 7) === 'include' && substr($method, -3) === 'Set') { |
226 | 226 | $incl = $method; |
227 | - $classNameMethod = substr($method, strlen('include')) . 'ClassName'; |
|
227 | + $classNameMethod = substr($method, strlen('include')).'ClassName'; |
|
228 | 228 | |
229 | 229 | |
230 | 230 | $classname = $this->$classNameMethod(); |
@@ -246,7 +246,7 @@ discard block |
||
246 | 246 | // We need to revert to multilang fields before synchronizing. |
247 | 247 | $set->useLang(false); |
248 | 248 | } |
249 | - $sql .= $mysqlbackend->setToSql($set) . "\n"; |
|
249 | + $sql .= $mysqlbackend->setToSql($set)."\n"; |
|
250 | 250 | } |
251 | 251 | } |
252 | 252 | } |
@@ -277,7 +277,7 @@ discard block |
||
277 | 277 | |
278 | 278 | if (substr($method, 0, strlen('include')) === 'include' && substr($method, -strlen('Set')) === 'Set') { |
279 | 279 | $incl = $method; |
280 | - $classNameMethod = substr($method, strlen('include')) . 'ClassName'; |
|
280 | + $classNameMethod = substr($method, strlen('include')).'ClassName'; |
|
281 | 281 | |
282 | 282 | $classname = $this->$classNameMethod(); |
283 | 283 | |
@@ -291,7 +291,7 @@ discard block |
||
291 | 291 | |
292 | 292 | if (class_exists($classname) && method_exists($this, $call)) { |
293 | 293 | $set = $this->$call(); |
294 | - $sql .= $mysqlbackend->setToSql($set) . "\n"; |
|
294 | + $sql .= $mysqlbackend->setToSql($set)."\n"; |
|
295 | 295 | } |
296 | 296 | } |
297 | 297 | } |
@@ -305,7 +305,7 @@ discard block |
||
305 | 305 | |
306 | 306 | public function includeBase() |
307 | 307 | { |
308 | - require_once APP_PHP_PATH . 'base.class.php'; |
|
308 | + require_once APP_PHP_PATH.'base.class.php'; |
|
309 | 309 | } |
310 | 310 | |
311 | 311 | /** |
@@ -313,7 +313,7 @@ discard block |
||
313 | 313 | */ |
314 | 314 | public function includeRecordSet() |
315 | 315 | { |
316 | - require_once APP_SET_PATH . 'record.class.php'; |
|
316 | + require_once APP_SET_PATH.'record.class.php'; |
|
317 | 317 | } |
318 | 318 | |
319 | 319 | |
@@ -322,7 +322,7 @@ discard block |
||
322 | 322 | */ |
323 | 323 | public function includeTraceableRecordSet() |
324 | 324 | { |
325 | - require_once APP_SET_PATH . 'traceablerecord.class.php'; |
|
325 | + require_once APP_SET_PATH.'traceablerecord.class.php'; |
|
326 | 326 | } |
327 | 327 | |
328 | 328 | |
@@ -334,7 +334,7 @@ discard block |
||
334 | 334 | { |
335 | 335 | static $accessManager = null; |
336 | 336 | if (!isset($accessManager)) { |
337 | - require_once APP_SET_PATH . 'accessmanager.class.php'; |
|
337 | + require_once APP_SET_PATH.'accessmanager.class.php'; |
|
338 | 338 | $accessManager = new app_AccessManager($this); |
339 | 339 | } |
340 | 340 | |
@@ -352,7 +352,7 @@ discard block |
||
352 | 352 | */ |
353 | 353 | public function includeLogSet() |
354 | 354 | { |
355 | - require_once APP_SET_PATH . 'log.class.php'; |
|
355 | + require_once APP_SET_PATH.'log.class.php'; |
|
356 | 356 | } |
357 | 357 | |
358 | 358 | /** |
@@ -368,7 +368,7 @@ discard block |
||
368 | 368 | */ |
369 | 369 | public function LogSetClassName() |
370 | 370 | { |
371 | - return $this->LogClassName() . 'Set'; |
|
371 | + return $this->LogClassName().'Set'; |
|
372 | 372 | } |
373 | 373 | |
374 | 374 | /** |
@@ -390,7 +390,7 @@ discard block |
||
390 | 390 | */ |
391 | 391 | public function includeLinkSet() |
392 | 392 | { |
393 | - require_once APP_SET_PATH . 'link.class.php'; |
|
393 | + require_once APP_SET_PATH.'link.class.php'; |
|
394 | 394 | } |
395 | 395 | |
396 | 396 | /** |
@@ -406,7 +406,7 @@ discard block |
||
406 | 406 | */ |
407 | 407 | public function LinkSetClassName() |
408 | 408 | { |
409 | - return $this->LinkClassName() . 'Set'; |
|
409 | + return $this->LinkClassName().'Set'; |
|
410 | 410 | } |
411 | 411 | |
412 | 412 | /** |
@@ -429,7 +429,7 @@ discard block |
||
429 | 429 | */ |
430 | 430 | public function getRecordSetByRef($recordClassname) |
431 | 431 | { |
432 | - $classSet = $recordClassname . 'Set'; |
|
432 | + $classSet = $recordClassname.'Set'; |
|
433 | 433 | $set = $this->$classSet(); |
434 | 434 | return $set; |
435 | 435 | } |
@@ -466,7 +466,7 @@ discard block |
||
466 | 466 | { |
467 | 467 | $fullClassName = get_class($record); |
468 | 468 | list(, $className) = explode('_', $fullClassName); |
469 | - return $className . ':' . $record->id; |
|
469 | + return $className.':'.$record->id; |
|
470 | 470 | } |
471 | 471 | |
472 | 472 | |
@@ -557,16 +557,16 @@ discard block |
||
557 | 557 | */ |
558 | 558 | public function mailTo($addr, $subject = null, $body = null) |
559 | 559 | { |
560 | - $mailTo = 'mailto:' . $addr; |
|
560 | + $mailTo = 'mailto:'.$addr; |
|
561 | 561 | $parameters = array(); |
562 | 562 | if (isset($subject)) { |
563 | - $parameters[] = 'subject=' . $subject; |
|
563 | + $parameters[] = 'subject='.$subject; |
|
564 | 564 | } |
565 | 565 | if (isset($body)) { |
566 | - $parameters[] = 'body=' . $body; |
|
566 | + $parameters[] = 'body='.$body; |
|
567 | 567 | } |
568 | 568 | if (!empty($parameters)) { |
569 | - $mailTo .= '?' . implode('&', $parameters); |
|
569 | + $mailTo .= '?'.implode('&', $parameters); |
|
570 | 570 | } |
571 | 571 | |
572 | 572 | return $mailTo; |
@@ -617,7 +617,7 @@ discard block |
||
617 | 617 | } |
618 | 618 | |
619 | 619 | $number = number_format($number, $decimals, ',', ' '); |
620 | - return str_replace(' ', bab_nbsp(), $number . ' ' . $prefix . $unitSymbol); |
|
620 | + return str_replace(' ', bab_nbsp(), $number.' '.$prefix.$unitSymbol); |
|
621 | 621 | } |
622 | 622 | |
623 | 623 | |
@@ -637,7 +637,7 @@ discard block |
||
637 | 637 | } |
638 | 638 | |
639 | 639 | if (!isset($format)) { |
640 | - $format = bab_registry::get('/' . $this->addonName . '/numberFormat', $PhoneNumber->getDefaultFormat()); |
|
640 | + $format = bab_registry::get('/'.$this->addonName.'/numberFormat', $PhoneNumber->getDefaultFormat()); |
|
641 | 641 | } |
642 | 642 | $phoneNumberUtil = $PhoneNumber->PhoneNumberUtil(); |
643 | 643 | |
@@ -658,7 +658,7 @@ discard block |
||
658 | 658 | */ |
659 | 659 | public function includeController() |
660 | 660 | { |
661 | - require_once APP_PHP_PATH . '/controller.class.php'; |
|
661 | + require_once APP_PHP_PATH.'/controller.class.php'; |
|
662 | 662 | } |
663 | 663 | |
664 | 664 | |
@@ -667,7 +667,7 @@ discard block |
||
667 | 667 | */ |
668 | 668 | public function includeRecordController() |
669 | 669 | { |
670 | - require_once APP_CTRL_PATH . '/record.ctrl.php'; |
|
670 | + require_once APP_CTRL_PATH.'/record.ctrl.php'; |
|
671 | 671 | } |
672 | 672 | |
673 | 673 | |
@@ -707,7 +707,7 @@ discard block |
||
707 | 707 | */ |
708 | 708 | public function includeUi() |
709 | 709 | { |
710 | - require_once APP_UI_PATH . 'ui.class.php'; |
|
710 | + require_once APP_UI_PATH.'ui.class.php'; |
|
711 | 711 | } |
712 | 712 | |
713 | 713 | |
@@ -719,7 +719,7 @@ discard block |
||
719 | 719 | public function Ui() |
720 | 720 | { |
721 | 721 | $this->includeUi(); |
722 | - return bab_getInstance($this->classPrefix . 'Ui');//->setApp($this); |
|
722 | + return bab_getInstance($this->classPrefix.'Ui'); //->setApp($this); |
|
723 | 723 | } |
724 | 724 | |
725 | 725 | /** |
@@ -747,29 +747,29 @@ discard block |
||
747 | 747 | |
748 | 748 | case substr($name, -strlen('SetClassName')) === 'SetClassName': |
749 | 749 | $setName = substr($name, 0, strlen($name) - strlen('ClassName')); |
750 | - return $this->classPrefix . $setName; |
|
750 | + return $this->classPrefix.$setName; |
|
751 | 751 | |
752 | 752 | case substr($name, -strlen('ClassName')) === 'ClassName': |
753 | 753 | $recordName = substr($name, 0, strlen($name) - strlen('ClassName')); |
754 | - return $this->classPrefix . $recordName; |
|
754 | + return $this->classPrefix.$recordName; |
|
755 | 755 | |
756 | 756 | case substr($name, 0, strlen('include')) === 'include' && substr($name, -strlen('Set')) === 'Set': |
757 | 757 | $fileNameBase = strtolower(substr(substr($name, 0, strlen($name) - strlen('Set')), strlen('include'))); |
758 | - require_once APP_SET_PATH . $fileNameBase . '.class.php'; |
|
758 | + require_once APP_SET_PATH.$fileNameBase.'.class.php'; |
|
759 | 759 | return; |
760 | 760 | |
761 | 761 | case substr($name, -strlen('Set')) === 'Set': |
762 | - $includeMethod = 'include' . $name; |
|
762 | + $includeMethod = 'include'.$name; |
|
763 | 763 | $this->$includeMethod(); |
764 | - $setClassNameMethod = $name . 'ClassName'; |
|
764 | + $setClassNameMethod = $name.'ClassName'; |
|
765 | 765 | $className = $this->$setClassNameMethod(); |
766 | 766 | $set = new $className($this); |
767 | 767 | return $set; |
768 | 768 | |
769 | 769 | //case method_exists($this, $name . 'Set'): |
770 | 770 | default: |
771 | - $setName = $name . 'Set'; |
|
772 | - $recordClassNameMethod = $name . 'ClassName'; |
|
771 | + $setName = $name.'Set'; |
|
772 | + $recordClassNameMethod = $name.'ClassName'; |
|
773 | 773 | $recordClassName = $this->$recordClassNameMethod(); |
774 | 774 | if (isset($arguments[0])) { |
775 | 775 | if ($arguments[0] instanceof $recordClassName) { |