@@ -842,7 +842,7 @@ |
||
842 | 842 | /** |
843 | 843 | * Which months follows this one? Calendars with leap-months should provide their own implementation. |
844 | 844 | * |
845 | - * @return int[] |
|
845 | + * @return integer[] |
|
846 | 846 | */ |
847 | 847 | protected function nextMonth() { |
848 | 848 | return array($this->m === $this->calendar->monthsInYear() ? $this->nextYear($this->y) : $this->y, ($this->m % $this->calendar->monthsInYear()) + 1); |
@@ -491,20 +491,20 @@ discard block |
||
491 | 491 | */ |
492 | 492 | public function convertToCalendar($calendar) { |
493 | 493 | switch ($calendar) { |
494 | - case 'gregorian': |
|
495 | - return new GregorianDate($this); |
|
496 | - case 'julian': |
|
497 | - return new JulianDate($this); |
|
498 | - case 'jewish': |
|
499 | - return new JewishDate($this); |
|
500 | - case 'french': |
|
501 | - return new FrenchDate($this); |
|
502 | - case 'hijri': |
|
503 | - return new HijriDate($this); |
|
504 | - case 'jalali': |
|
505 | - return new JalaliDate($this); |
|
506 | - default: |
|
507 | - return $this; |
|
494 | + case 'gregorian': |
|
495 | + return new GregorianDate($this); |
|
496 | + case 'julian': |
|
497 | + return new JulianDate($this); |
|
498 | + case 'jewish': |
|
499 | + return new JewishDate($this); |
|
500 | + case 'french': |
|
501 | + return new FrenchDate($this); |
|
502 | + case 'hijri': |
|
503 | + return new HijriDate($this); |
|
504 | + case 'jalali': |
|
505 | + return new JalaliDate($this); |
|
506 | + default: |
|
507 | + return $this; |
|
508 | 508 | } |
509 | 509 | } |
510 | 510 | |
@@ -581,90 +581,90 @@ discard block |
||
581 | 581 | $case = 'GENITIVE'; |
582 | 582 | } else { |
583 | 583 | switch ($qualifier) { |
584 | - case 'TO': |
|
585 | - case 'ABT': |
|
586 | - case 'FROM': |
|
587 | - $case = 'GENITIVE'; |
|
588 | - break; |
|
589 | - case 'AFT': |
|
590 | - $case = 'LOCATIVE'; |
|
591 | - break; |
|
592 | - case 'BEF': |
|
593 | - case 'BET': |
|
594 | - case 'AND': |
|
595 | - $case = 'INSTRUMENTAL'; |
|
596 | - break; |
|
597 | - case '': |
|
598 | - case 'INT': |
|
599 | - case 'EST': |
|
600 | - case 'CAL': |
|
601 | - default: // There shouldn't be any other options... |
|
602 | - $case = 'NOMINATIVE'; |
|
603 | - break; |
|
584 | + case 'TO': |
|
585 | + case 'ABT': |
|
586 | + case 'FROM': |
|
587 | + $case = 'GENITIVE'; |
|
588 | + break; |
|
589 | + case 'AFT': |
|
590 | + $case = 'LOCATIVE'; |
|
591 | + break; |
|
592 | + case 'BEF': |
|
593 | + case 'BET': |
|
594 | + case 'AND': |
|
595 | + $case = 'INSTRUMENTAL'; |
|
596 | + break; |
|
597 | + case '': |
|
598 | + case 'INT': |
|
599 | + case 'EST': |
|
600 | + case 'CAL': |
|
601 | + default: // There shouldn't be any other options... |
|
602 | + $case = 'NOMINATIVE'; |
|
603 | + break; |
|
604 | 604 | } |
605 | 605 | } |
606 | 606 | // Build up the formatted date, character at a time |
607 | 607 | preg_match_all('/%[^%]/', $format, $matches); |
608 | 608 | foreach ($matches[0] as $match) { |
609 | 609 | switch ($match) { |
610 | - case '%d': |
|
611 | - $format = str_replace($match, $this->formatDayZeros(), $format); |
|
612 | - break; |
|
613 | - case '%j': |
|
614 | - $format = str_replace($match, $this->formatDay(), $format); |
|
615 | - break; |
|
616 | - case '%l': |
|
617 | - $format = str_replace($match, $this->formatLongWeekday(), $format); |
|
618 | - break; |
|
619 | - case '%D': |
|
620 | - $format = str_replace($match, $this->formatShortWeekday(), $format); |
|
621 | - break; |
|
622 | - case '%N': |
|
623 | - $format = str_replace($match, $this->formatIsoWeekday(), $format); |
|
624 | - break; |
|
625 | - case '%w': |
|
626 | - $format = str_replace($match, $this->formatNumericWeekday(), $format); |
|
627 | - break; |
|
628 | - case '%z': |
|
629 | - $format = str_replace($match, $this->formatDayOfYear(), $format); |
|
630 | - break; |
|
631 | - case '%F': |
|
632 | - $format = str_replace($match, $this->formatLongMonth($case), $format); |
|
633 | - break; |
|
634 | - case '%m': |
|
635 | - $format = str_replace($match, $this->formatMonthZeros(), $format); |
|
636 | - break; |
|
637 | - case '%M': |
|
638 | - $format = str_replace($match, $this->formatShortMonth(), $format); |
|
639 | - break; |
|
640 | - case '%n': |
|
641 | - $format = str_replace($match, $this->formatMonth(), $format); |
|
642 | - break; |
|
643 | - case '%t': |
|
644 | - $format = str_replace($match, $this->daysInMonth(), $format); |
|
645 | - break; |
|
646 | - case '%L': |
|
647 | - $format = str_replace($match, (int) $this->isLeapYear(), $format); |
|
648 | - break; |
|
649 | - case '%Y': |
|
650 | - $format = str_replace($match, $this->formatLongYear(), $format); |
|
651 | - break; |
|
652 | - case '%y': |
|
653 | - $format = str_replace($match, $this->formatShortYear(), $format); |
|
654 | - break; |
|
655 | - // These 4 extensions are useful for re-formatting gedcom dates. |
|
656 | - case '%@': |
|
657 | - $format = str_replace($match, $this->calendar->gedcomCalendarEscape(), $format); |
|
658 | - break; |
|
659 | - case '%A': |
|
660 | - $format = str_replace($match, $this->formatGedcomDay(), $format); |
|
661 | - break; |
|
662 | - case '%O': |
|
663 | - $format = str_replace($match, $this->formatGedcomMonth(), $format); |
|
664 | - break; |
|
665 | - case '%E': |
|
666 | - $format = str_replace($match, $this->formatGedcomYear(), $format); |
|
667 | - break; |
|
610 | + case '%d': |
|
611 | + $format = str_replace($match, $this->formatDayZeros(), $format); |
|
612 | + break; |
|
613 | + case '%j': |
|
614 | + $format = str_replace($match, $this->formatDay(), $format); |
|
615 | + break; |
|
616 | + case '%l': |
|
617 | + $format = str_replace($match, $this->formatLongWeekday(), $format); |
|
618 | + break; |
|
619 | + case '%D': |
|
620 | + $format = str_replace($match, $this->formatShortWeekday(), $format); |
|
621 | + break; |
|
622 | + case '%N': |
|
623 | + $format = str_replace($match, $this->formatIsoWeekday(), $format); |
|
624 | + break; |
|
625 | + case '%w': |
|
626 | + $format = str_replace($match, $this->formatNumericWeekday(), $format); |
|
627 | + break; |
|
628 | + case '%z': |
|
629 | + $format = str_replace($match, $this->formatDayOfYear(), $format); |
|
630 | + break; |
|
631 | + case '%F': |
|
632 | + $format = str_replace($match, $this->formatLongMonth($case), $format); |
|
633 | + break; |
|
634 | + case '%m': |
|
635 | + $format = str_replace($match, $this->formatMonthZeros(), $format); |
|
636 | + break; |
|
637 | + case '%M': |
|
638 | + $format = str_replace($match, $this->formatShortMonth(), $format); |
|
639 | + break; |
|
640 | + case '%n': |
|
641 | + $format = str_replace($match, $this->formatMonth(), $format); |
|
642 | + break; |
|
643 | + case '%t': |
|
644 | + $format = str_replace($match, $this->daysInMonth(), $format); |
|
645 | + break; |
|
646 | + case '%L': |
|
647 | + $format = str_replace($match, (int) $this->isLeapYear(), $format); |
|
648 | + break; |
|
649 | + case '%Y': |
|
650 | + $format = str_replace($match, $this->formatLongYear(), $format); |
|
651 | + break; |
|
652 | + case '%y': |
|
653 | + $format = str_replace($match, $this->formatShortYear(), $format); |
|
654 | + break; |
|
655 | + // These 4 extensions are useful for re-formatting gedcom dates. |
|
656 | + case '%@': |
|
657 | + $format = str_replace($match, $this->calendar->gedcomCalendarEscape(), $format); |
|
658 | + break; |
|
659 | + case '%A': |
|
660 | + $format = str_replace($match, $this->formatGedcomDay(), $format); |
|
661 | + break; |
|
662 | + case '%O': |
|
663 | + $format = str_replace($match, $this->formatGedcomMonth(), $format); |
|
664 | + break; |
|
665 | + case '%E': |
|
666 | + $format = str_replace($match, $this->formatGedcomYear(), $format); |
|
667 | + break; |
|
668 | 668 | } |
669 | 669 | } |
670 | 670 | |
@@ -769,16 +769,16 @@ discard block |
||
769 | 769 | */ |
770 | 770 | protected function formatLongMonth($case = 'NOMINATIVE') { |
771 | 771 | switch ($case) { |
772 | - case 'GENITIVE': |
|
773 | - return $this->monthNameGenitiveCase($this->m, $this->isLeapYear()); |
|
774 | - case 'NOMINATIVE': |
|
775 | - return $this->monthNameNominativeCase($this->m, $this->isLeapYear()); |
|
776 | - case 'LOCATIVE': |
|
777 | - return $this->monthNameLocativeCase($this->m, $this->isLeapYear()); |
|
778 | - case 'INSTRUMENTAL': |
|
779 | - return $this->monthNameInstrumentalCase($this->m, $this->isLeapYear()); |
|
780 | - default: |
|
781 | - throw new \InvalidArgumentException($case); |
|
772 | + case 'GENITIVE': |
|
773 | + return $this->monthNameGenitiveCase($this->m, $this->isLeapYear()); |
|
774 | + case 'NOMINATIVE': |
|
775 | + return $this->monthNameNominativeCase($this->m, $this->isLeapYear()); |
|
776 | + case 'LOCATIVE': |
|
777 | + return $this->monthNameLocativeCase($this->m, $this->isLeapYear()); |
|
778 | + case 'INSTRUMENTAL': |
|
779 | + return $this->monthNameInstrumentalCase($this->m, $this->isLeapYear()); |
|
780 | + default: |
|
781 | + throw new \InvalidArgumentException($case); |
|
782 | 782 | } |
783 | 783 | } |
784 | 784 |
@@ -247,7 +247,7 @@ |
||
247 | 247 | /** |
248 | 248 | * Which months follows this one? Calendars with leap-months should provide their own implementation. |
249 | 249 | * |
250 | - * @return int[] |
|
250 | + * @return integer[] |
|
251 | 251 | */ |
252 | 252 | protected function nextMonth() { |
253 | 253 | if ($this->m == 6 && !$this->isLeapYear()) { |
@@ -103,7 +103,8 @@ discard block |
||
103 | 103 | <?php if ($ancestors_only === '1'): ?> |
104 | 104 | <input type="hidden" name="ancestors" value="1"> |
105 | 105 | <?php echo I18N::translate('Find relationships via ancestors') ?> |
106 | - <?php else: ?> |
|
106 | + <?php else { |
|
107 | + : ?> |
|
107 | 108 | <label> |
108 | 109 | <input type="radio" name="ancestors" value="0" <?php echo $ancestors == 0 ? 'checked' : '' ?>> |
109 | 110 | <?php echo I18N::translate('Find any relationship') ?> |
@@ -113,14 +114,17 @@ discard block |
||
113 | 114 | <input type="radio" name="ancestors" value="1" <?php echo $ancestors == 1 ? 'checked' : '' ?>> |
114 | 115 | <?php echo I18N::translate('Find relationships via ancestors') ?> |
115 | 116 | </label> |
116 | - <?php endif; ?> |
|
117 | + <?php endif; |
|
118 | +} |
|
119 | +?> |
|
117 | 120 | |
118 | 121 | <hr> |
119 | 122 | |
120 | 123 | <?php if ($max_recursion == 0): ?> |
121 | 124 | <?php echo I18N::translate('Find the closest relationships') ?> |
122 | 125 | <input type="hidden" name="recursion" value="0"> |
123 | - <?php else: ?> |
|
126 | + <?php else { |
|
127 | + : ?> |
|
124 | 128 | <label> |
125 | 129 | <input type="radio" name="recursion" value="0" <?php echo $recursion == 0 ? 'checked' : '' ?>> |
126 | 130 | <?php echo I18N::translate('Find the closest relationships') ?> |
@@ -132,7 +136,9 @@ discard block |
||
132 | 136 | <?php echo I18N::translate('Find all possible relationships') ?> |
133 | 137 | <?php else: ?> |
134 | 138 | <?php echo I18N::translate('Find other relationships') ?> |
135 | - <?php endif; ?> |
|
139 | + <?php endif; |
|
140 | +} |
|
141 | +?> |
|
136 | 142 | </label> |
137 | 143 | <?php endif; ?> |
138 | 144 | </td> |
@@ -179,39 +179,39 @@ |
||
179 | 179 | foreach ($path as $n => $xref) { |
180 | 180 | if ($n % 2 === 1) { |
181 | 181 | switch ($relationships[$n]) { |
182 | - case 'hus': |
|
183 | - case 'wif': |
|
184 | - case 'spo': |
|
185 | - case 'bro': |
|
186 | - case 'sis': |
|
187 | - case 'sib': |
|
188 | - $table[$x + 1][$y] = '<div style="background:url(' . Theme::theme()->parameter('image-hline') . ') repeat-x center; width: 94px; text-align: center"><div class="hline-text" style="height: 32px;">' . Functions::getRelationshipNameFromPath($relationships[$n], Individual::getInstance($path[$n - 1], $WT_TREE), Individual::getInstance($path[$n + 1], $WT_TREE)) . '</div><div style="height: 32px;">' . $horizontal_arrow . '</div></div>'; |
|
189 | - $x += 2; |
|
190 | - break; |
|
191 | - case 'son': |
|
192 | - case 'dau': |
|
193 | - case 'chi': |
|
194 | - if ($n > 2 && preg_match('/fat|mot|par/', $relationships[$n - 2])) { |
|
195 | - $table[$x + 1][$y - 1] = '<div style="background:url(' . $diagonal2 . '); width: 64px; height: 64px; text-align: center;"><div style="height: 32px; text-align: end;">' . Functions::getRelationshipNameFromPath($relationships[$n], Individual::getInstance($path[$n - 1], $WT_TREE), Individual::getInstance($path[$n + 1], $WT_TREE)) . '</div><div style="height: 32px; text-align: start;">' . $down_arrow . '</div></div>'; |
|
182 | + case 'hus': |
|
183 | + case 'wif': |
|
184 | + case 'spo': |
|
185 | + case 'bro': |
|
186 | + case 'sis': |
|
187 | + case 'sib': |
|
188 | + $table[$x + 1][$y] = '<div style="background:url(' . Theme::theme()->parameter('image-hline') . ') repeat-x center; width: 94px; text-align: center"><div class="hline-text" style="height: 32px;">' . Functions::getRelationshipNameFromPath($relationships[$n], Individual::getInstance($path[$n - 1], $WT_TREE), Individual::getInstance($path[$n + 1], $WT_TREE)) . '</div><div style="height: 32px;">' . $horizontal_arrow . '</div></div>'; |
|
196 | 189 | $x += 2; |
197 | - } else { |
|
198 | - $table[$x][$y - 1] = '<div style="background:url(' . Theme::theme() |
|
199 | - ->parameter('image-vline') . ') repeat-y center; height: 64px; text-align: center;"><div class="vline-text" style="display: inline-block; width:50%; line-height: 64px;">' . Functions::getRelationshipNameFromPath($relationships[$n], Individual::getInstance($path[$n - 1], $WT_TREE), Individual::getInstance($path[$n + 1], $WT_TREE)) . '</div><div style="display: inline-block; width:50%; line-height: 64px;">' . $down_arrow . '</div></div>'; |
|
200 | - } |
|
201 | - $y -= 2; |
|
202 | - break; |
|
203 | - case 'fat': |
|
204 | - case 'mot': |
|
205 | - case 'par': |
|
206 | - if ($n > 2 && preg_match('/son|dau|chi/', $relationships[$n - 2])) { |
|
207 | - $table[$x + 1][$y + 1] = '<div style="background:url(' . $diagonal1 . '); background-position: top right; width: 64px; height: 64px; text-align: center;"><div style="height: 32px; text-align: start;">' . Functions::getRelationshipNameFromPath($relationships[$n], Individual::getInstance($path[$n - 1], $WT_TREE), Individual::getInstance($path[$n + 1], $WT_TREE)) . '</div><div style="height: 32px; text-align: end;">' . $up_arrow . '</div></div>'; |
|
208 | - $x += 2; |
|
209 | - } else { |
|
210 | - $table[$x][$y + 1] = '<div style="background:url(' . Theme::theme() |
|
211 | - ->parameter('image-vline') . ') repeat-y center; height: 64px; text-align:center; "><div class="vline-text" style="display: inline-block; width: 50%; line-height: 32px;">' . Functions::getRelationshipNameFromPath($relationships[$n], Individual::getInstance($path[$n - 1], $WT_TREE), Individual::getInstance($path[$n + 1], $WT_TREE)) . '</div><div style="display: inline-block; width: 50%; line-height: 32px">' . $up_arrow . '</div></div>'; |
|
212 | - } |
|
213 | - $y += 2; |
|
214 | - break; |
|
190 | + break; |
|
191 | + case 'son': |
|
192 | + case 'dau': |
|
193 | + case 'chi': |
|
194 | + if ($n > 2 && preg_match('/fat|mot|par/', $relationships[$n - 2])) { |
|
195 | + $table[$x + 1][$y - 1] = '<div style="background:url(' . $diagonal2 . '); width: 64px; height: 64px; text-align: center;"><div style="height: 32px; text-align: end;">' . Functions::getRelationshipNameFromPath($relationships[$n], Individual::getInstance($path[$n - 1], $WT_TREE), Individual::getInstance($path[$n + 1], $WT_TREE)) . '</div><div style="height: 32px; text-align: start;">' . $down_arrow . '</div></div>'; |
|
196 | + $x += 2; |
|
197 | + } else { |
|
198 | + $table[$x][$y - 1] = '<div style="background:url(' . Theme::theme() |
|
199 | + ->parameter('image-vline') . ') repeat-y center; height: 64px; text-align: center;"><div class="vline-text" style="display: inline-block; width:50%; line-height: 64px;">' . Functions::getRelationshipNameFromPath($relationships[$n], Individual::getInstance($path[$n - 1], $WT_TREE), Individual::getInstance($path[$n + 1], $WT_TREE)) . '</div><div style="display: inline-block; width:50%; line-height: 64px;">' . $down_arrow . '</div></div>'; |
|
200 | + } |
|
201 | + $y -= 2; |
|
202 | + break; |
|
203 | + case 'fat': |
|
204 | + case 'mot': |
|
205 | + case 'par': |
|
206 | + if ($n > 2 && preg_match('/son|dau|chi/', $relationships[$n - 2])) { |
|
207 | + $table[$x + 1][$y + 1] = '<div style="background:url(' . $diagonal1 . '); background-position: top right; width: 64px; height: 64px; text-align: center;"><div style="height: 32px; text-align: start;">' . Functions::getRelationshipNameFromPath($relationships[$n], Individual::getInstance($path[$n - 1], $WT_TREE), Individual::getInstance($path[$n + 1], $WT_TREE)) . '</div><div style="height: 32px; text-align: end;">' . $up_arrow . '</div></div>'; |
|
208 | + $x += 2; |
|
209 | + } else { |
|
210 | + $table[$x][$y + 1] = '<div style="background:url(' . Theme::theme() |
|
211 | + ->parameter('image-vline') . ') repeat-y center; height: 64px; text-align:center; "><div class="vline-text" style="display: inline-block; width: 50%; line-height: 32px;">' . Functions::getRelationshipNameFromPath($relationships[$n], Individual::getInstance($path[$n - 1], $WT_TREE), Individual::getInstance($path[$n + 1], $WT_TREE)) . '</div><div style="display: inline-block; width: 50%; line-height: 32px">' . $up_arrow . '</div></div>'; |
|
212 | + } |
|
213 | + $y += 2; |
|
214 | + break; |
|
215 | 215 | } |
216 | 216 | $max_x = max($max_x, $x); |
217 | 217 | $min_y = min($min_y, $y); |
@@ -81,8 +81,11 @@ |
||
81 | 81 | <td class="col-xs-2"> |
82 | 82 | <?php if ($module instanceof ModuleConfigInterface): ?> |
83 | 83 | <a href="<?php echo $module->getConfigLink(); ?>"><?php echo $module->getTitle(); ?> <i class="fa fa-cogs"></i></a> |
84 | - <?php else: ?> |
|
85 | - <?php echo $module->getTitle(); ?> |
|
84 | + <?php else { |
|
85 | + : ?> |
|
86 | + <?php echo $module->getTitle(); |
|
87 | +} |
|
88 | +?> |
|
86 | 89 | <?php endif; ?> |
87 | 90 | </td> |
88 | 91 | <td class="col-xs-5"><?php echo $module->getDescription(); ?></td> |
@@ -98,8 +98,11 @@ |
||
98 | 98 | <td class="col-xs-1"> |
99 | 99 | <?php if ($module instanceof ModuleConfigInterface): ?> |
100 | 100 | <a href="<?php echo $module->getConfigLink(); ?>"><?php echo $module->getTitle(); ?> <i class="fa fa-cogs"></i></a> |
101 | - <?php else: ?> |
|
102 | - <?php echo $module->getTitle(); ?> |
|
101 | + <?php else { |
|
102 | + : ?> |
|
103 | + <?php echo $module->getTitle(); |
|
104 | +} |
|
105 | +?> |
|
103 | 106 | <?php endif; ?> |
104 | 107 | </td> |
105 | 108 | <td class="col-xs-5"><?php echo $module->getDescription(); ?></td> |
@@ -81,8 +81,11 @@ |
||
81 | 81 | <td class="col-xs-2"> |
82 | 82 | <?php if ($module instanceof ModuleConfigInterface): ?> |
83 | 83 | <a href="<?php echo $module->getConfigLink(); ?>"><?php echo $module->getTitle(); ?> <i class="fa fa-cogs"></i></a> |
84 | - <?php else: ?> |
|
85 | - <?php echo $module->getTitle(); ?> |
|
84 | + <?php else { |
|
85 | + : ?> |
|
86 | + <?php echo $module->getTitle(); |
|
87 | +} |
|
88 | +?> |
|
86 | 89 | <?php endif; ?> |
87 | 90 | </td> |
88 | 91 | <td class="col-xs-5"><?php echo $module->getDescription(); ?></td> |
@@ -98,8 +98,11 @@ |
||
98 | 98 | <td class="col-xs-1"> |
99 | 99 | <?php if ($module instanceof ModuleConfigInterface): ?> |
100 | 100 | <a href="<?php echo $module->getConfigLink(); ?>"><?php echo $module->getTitle(); ?> <i class="fa fa-cogs"></i></a> |
101 | - <?php else: ?> |
|
102 | - <?php echo $module->getTitle(); ?> |
|
101 | + <?php else { |
|
102 | + : ?> |
|
103 | + <?php echo $module->getTitle(); |
|
104 | +} |
|
105 | +?> |
|
103 | 106 | <?php endif; ?> |
104 | 107 | </td> |
105 | 108 | <td class="col-xs-5"><?php echo $module->getDescription(); ?></td> |
@@ -16,8 +16,8 @@ |
||
16 | 16 | namespace Fisharebest\Webtrees; |
17 | 17 | |
18 | 18 | use Exception; |
19 | -use Swift_Mailer; |
|
20 | 19 | use Swift_MailTransport; |
20 | +use Swift_Mailer; |
|
21 | 21 | use Swift_Message; |
22 | 22 | use Swift_NullTransport; |
23 | 23 | use Swift_Preferences; |
@@ -103,20 +103,20 @@ |
||
103 | 103 | case 'sendmail': |
104 | 104 | return Swift_SendmailTransport::newInstance(); |
105 | 105 | case 'external': |
106 | - $transport = Swift_SmtpTransport::newInstance() |
|
107 | - ->setHost(Site::getPreference('SMTP_HOST')) |
|
108 | - ->setPort(Site::getPreference('SMTP_PORT')) |
|
109 | - ->setLocalDomain(Site::getPreference('SMTP_HELO')); |
|
106 | + $transport = Swift_SmtpTransport::newInstance() |
|
107 | + ->setHost(Site::getPreference('SMTP_HOST')) |
|
108 | + ->setPort(Site::getPreference('SMTP_PORT')) |
|
109 | + ->setLocalDomain(Site::getPreference('SMTP_HELO')); |
|
110 | 110 | |
111 | - if (Site::getPreference('SMTP_AUTH')) { |
|
112 | - $transport |
|
113 | - ->setUsername(Site::getPreference('SMTP_AUTH_USER')) |
|
114 | - ->setPassword(Site::getPreference('SMTP_AUTH_PASS')); |
|
115 | - } |
|
111 | + if (Site::getPreference('SMTP_AUTH')) { |
|
112 | + $transport |
|
113 | + ->setUsername(Site::getPreference('SMTP_AUTH_USER')) |
|
114 | + ->setPassword(Site::getPreference('SMTP_AUTH_PASS')); |
|
115 | + } |
|
116 | 116 | |
117 | - if (Site::getPreference('SMTP_SSL') !== 'none') { |
|
118 | - $transport->setEncryption(Site::getPreference('SMTP_SSL')); |
|
119 | - } |
|
117 | + if (Site::getPreference('SMTP_SSL') !== 'none') { |
|
118 | + $transport->setEncryption(Site::getPreference('SMTP_SSL')); |
|
119 | + } |
|
120 | 120 | |
121 | 121 | return $transport; |
122 | 122 | default: |
@@ -98,30 +98,30 @@ |
||
98 | 98 | */ |
99 | 99 | public static function transport() { |
100 | 100 | switch (Site::getPreference('SMTP_ACTIVE')) { |
101 | - case 'internal': |
|
102 | - return Swift_MailTransport::newInstance(); |
|
103 | - case 'sendmail': |
|
104 | - return Swift_SendmailTransport::newInstance(); |
|
105 | - case 'external': |
|
106 | - $transport = Swift_SmtpTransport::newInstance() |
|
107 | - ->setHost(Site::getPreference('SMTP_HOST')) |
|
108 | - ->setPort(Site::getPreference('SMTP_PORT')) |
|
109 | - ->setLocalDomain(Site::getPreference('SMTP_HELO')); |
|
101 | + case 'internal': |
|
102 | + return Swift_MailTransport::newInstance(); |
|
103 | + case 'sendmail': |
|
104 | + return Swift_SendmailTransport::newInstance(); |
|
105 | + case 'external': |
|
106 | + $transport = Swift_SmtpTransport::newInstance() |
|
107 | + ->setHost(Site::getPreference('SMTP_HOST')) |
|
108 | + ->setPort(Site::getPreference('SMTP_PORT')) |
|
109 | + ->setLocalDomain(Site::getPreference('SMTP_HELO')); |
|
110 | 110 | |
111 | - if (Site::getPreference('SMTP_AUTH')) { |
|
112 | - $transport |
|
113 | - ->setUsername(Site::getPreference('SMTP_AUTH_USER')) |
|
114 | - ->setPassword(Site::getPreference('SMTP_AUTH_PASS')); |
|
115 | - } |
|
111 | + if (Site::getPreference('SMTP_AUTH')) { |
|
112 | + $transport |
|
113 | + ->setUsername(Site::getPreference('SMTP_AUTH_USER')) |
|
114 | + ->setPassword(Site::getPreference('SMTP_AUTH_PASS')); |
|
115 | + } |
|
116 | 116 | |
117 | - if (Site::getPreference('SMTP_SSL') !== 'none') { |
|
118 | - $transport->setEncryption(Site::getPreference('SMTP_SSL')); |
|
119 | - } |
|
117 | + if (Site::getPreference('SMTP_SSL') !== 'none') { |
|
118 | + $transport->setEncryption(Site::getPreference('SMTP_SSL')); |
|
119 | + } |
|
120 | 120 | |
121 | - return $transport; |
|
122 | - default: |
|
123 | - // For testing |
|
124 | - return Swift_NullTransport::newInstance(); |
|
121 | + return $transport; |
|
122 | + default: |
|
123 | + // For testing |
|
124 | + return Swift_NullTransport::newInstance(); |
|
125 | 125 | } |
126 | 126 | } |
127 | 127 | } |
@@ -38,38 +38,38 @@ |
||
38 | 38 | |
39 | 39 | foreach ($facts as $fact) { |
40 | 40 | switch ($fact->getTag()) { |
41 | - case 'ADDR': |
|
42 | - case 'ALIA': |
|
43 | - case 'ASSO': |
|
44 | - case 'CHAN': |
|
45 | - case 'CHIL': |
|
46 | - case 'EMAIL': |
|
47 | - case 'FAMC': |
|
48 | - case 'FAMS': |
|
49 | - case 'HUSB': |
|
50 | - case 'NAME': |
|
51 | - case 'NOTE': |
|
52 | - case 'OBJE': |
|
53 | - case 'PHON': |
|
54 | - case 'RESI': |
|
55 | - case 'RESN': |
|
56 | - case 'SEX': |
|
57 | - case 'SOUR': |
|
58 | - case 'SSN': |
|
59 | - case 'SUBM': |
|
60 | - case 'TITL': |
|
61 | - case 'URL': |
|
62 | - case 'WIFE': |
|
63 | - case 'WWW': |
|
64 | - case '_EMAIL': |
|
65 | - case '_TODO': |
|
66 | - case '_UID': |
|
67 | - case '_WT_OBJE_SORT': |
|
68 | - // Do not show these |
|
69 | - break; |
|
70 | - default: |
|
71 | - // Simple version of FunctionsPrintFacts::print_fact() |
|
72 | - echo $fact->summary(); |
|
73 | - break; |
|
41 | + case 'ADDR': |
|
42 | + case 'ALIA': |
|
43 | + case 'ASSO': |
|
44 | + case 'CHAN': |
|
45 | + case 'CHIL': |
|
46 | + case 'EMAIL': |
|
47 | + case 'FAMC': |
|
48 | + case 'FAMS': |
|
49 | + case 'HUSB': |
|
50 | + case 'NAME': |
|
51 | + case 'NOTE': |
|
52 | + case 'OBJE': |
|
53 | + case 'PHON': |
|
54 | + case 'RESI': |
|
55 | + case 'RESN': |
|
56 | + case 'SEX': |
|
57 | + case 'SOUR': |
|
58 | + case 'SSN': |
|
59 | + case 'SUBM': |
|
60 | + case 'TITL': |
|
61 | + case 'URL': |
|
62 | + case 'WIFE': |
|
63 | + case 'WWW': |
|
64 | + case '_EMAIL': |
|
65 | + case '_TODO': |
|
66 | + case '_UID': |
|
67 | + case '_WT_OBJE_SORT': |
|
68 | + // Do not show these |
|
69 | + break; |
|
70 | + default: |
|
71 | + // Simple version of FunctionsPrintFacts::print_fact() |
|
72 | + echo $fact->summary(); |
|
73 | + break; |
|
74 | 74 | } |
75 | 75 | } |