@@ -44,7 +44,7 @@ |
||
44 | 44 | $form_pass2 = Filter::post('form_pass2', WT_REGEX_PASSWORD); |
45 | 45 | $form_email = Filter::postEmail('form_email'); |
46 | 46 | $form_rootid = Filter::post('form_rootid', WT_REGEX_XREF); |
47 | -$form_theme = Filter::post('form_theme', implode('|', array_keys(Theme::themeNames())), '');; |
|
47 | +$form_theme = Filter::post('form_theme', implode('|', array_keys(Theme::themeNames())), ''); ; |
|
48 | 48 | $form_language = Filter::post('form_language'); |
49 | 49 | $form_timezone = Filter::post('form_timezone'); |
50 | 50 | $form_contact_method = Filter::post('form_contact_method'); |
@@ -183,8 +183,11 @@ |
||
183 | 183 | <div class="value"> |
184 | 184 | <?php if ($my_individual_record): ?> |
185 | 185 | <?php echo $my_individual_record->formatList('span'); ?> |
186 | - <?php else: ?> |
|
187 | - <?php echo I18N::translateContext('unknown people', 'Unknown'); ?> |
|
186 | + <?php else { |
|
187 | + : ?> |
|
188 | + <?php echo I18N::translateContext('unknown people', 'Unknown'); |
|
189 | +} |
|
190 | +?> |
|
188 | 191 | <?php endif; ?> |
189 | 192 | <p class="small text-muted"> |
190 | 193 | <?php echo I18N::translate('This is a link to your own record in the family tree. If this is the wrong individual, contact an administrator.'); ?> |
@@ -53,52 +53,52 @@ |
||
53 | 53 | // Respond to form action |
54 | 54 | if ($form_action && Filter::checkCsrf()) { |
55 | 55 | switch ($form_action) { |
56 | - case 'update': |
|
57 | - if ($form_username !== Auth::user()->getUserName() && User::findByUserName($form_username)) { |
|
58 | - FlashMessages::addMessage(I18N::translate('Duplicate username. A user with that username already exists. Please choose another username.')); |
|
59 | - } elseif ($form_email !== Auth::user()->getEmail() && User::findByEmail($form_email)) { |
|
60 | - FlashMessages::addMessage(I18N::translate('Duplicate email address. A user with that email already exists.')); |
|
61 | - } else { |
|
62 | - // Change username |
|
63 | - if ($form_username !== Auth::user()->getUserName()) { |
|
64 | - Log::addAuthenticationLog('User ' . Auth::user()->getUserName() . ' renamed to ' . $form_username); |
|
65 | - Auth::user()->setUserName($form_username); |
|
66 | - } |
|
67 | - |
|
68 | - // Change password |
|
69 | - if ($form_pass1 && $form_pass1 === $form_pass2) { |
|
70 | - Auth::user()->setPassword($form_pass1); |
|
71 | - } |
|
72 | - |
|
73 | - // Change other settings |
|
74 | - Auth::user() |
|
75 | - ->setRealName($form_realname) |
|
76 | - ->setEmail($form_email) |
|
77 | - ->setPreference('language', $form_language) |
|
78 | - ->setPreference('TIMEZONE', $form_timezone) |
|
79 | - ->setPreference('contactmethod', $form_contact_method) |
|
80 | - ->setPreference('visibleonline', $form_visible_online ? '1' : '0'); |
|
81 | - |
|
82 | - if ($form_theme === null) { |
|
83 | - Auth::user()->deletePreference('theme'); |
|
56 | + case 'update': |
|
57 | + if ($form_username !== Auth::user()->getUserName() && User::findByUserName($form_username)) { |
|
58 | + FlashMessages::addMessage(I18N::translate('Duplicate username. A user with that username already exists. Please choose another username.')); |
|
59 | + } elseif ($form_email !== Auth::user()->getEmail() && User::findByEmail($form_email)) { |
|
60 | + FlashMessages::addMessage(I18N::translate('Duplicate email address. A user with that email already exists.')); |
|
84 | 61 | } else { |
85 | - Auth::user()->setPreference('theme', $form_theme); |
|
62 | + // Change username |
|
63 | + if ($form_username !== Auth::user()->getUserName()) { |
|
64 | + Log::addAuthenticationLog('User ' . Auth::user()->getUserName() . ' renamed to ' . $form_username); |
|
65 | + Auth::user()->setUserName($form_username); |
|
66 | + } |
|
67 | + |
|
68 | + // Change password |
|
69 | + if ($form_pass1 && $form_pass1 === $form_pass2) { |
|
70 | + Auth::user()->setPassword($form_pass1); |
|
71 | + } |
|
72 | + |
|
73 | + // Change other settings |
|
74 | + Auth::user() |
|
75 | + ->setRealName($form_realname) |
|
76 | + ->setEmail($form_email) |
|
77 | + ->setPreference('language', $form_language) |
|
78 | + ->setPreference('TIMEZONE', $form_timezone) |
|
79 | + ->setPreference('contactmethod', $form_contact_method) |
|
80 | + ->setPreference('visibleonline', $form_visible_online ? '1' : '0'); |
|
81 | + |
|
82 | + if ($form_theme === null) { |
|
83 | + Auth::user()->deletePreference('theme'); |
|
84 | + } else { |
|
85 | + Auth::user()->setPreference('theme', $form_theme); |
|
86 | + } |
|
87 | + |
|
88 | + $WT_TREE->setUserPreference(Auth::user(), 'rootid', $form_rootid); |
|
86 | 89 | } |
87 | - |
|
88 | - $WT_TREE->setUserPreference(Auth::user(), 'rootid', $form_rootid); |
|
89 | - } |
|
90 | - break; |
|
91 | - |
|
92 | - case 'delete': |
|
93 | - // An administrator can only be deleted by another administrator |
|
94 | - if (!Auth::user()->getPreference('canadmin')) { |
|
95 | - // Keep a reference to the currently logged in user because after logging out this user, |
|
96 | - // a call to Auth::user() will not return this user anymore |
|
97 | - $currentUser = Auth::user(); |
|
98 | - Auth::logout(); |
|
99 | - $currentUser->delete(); |
|
100 | - } |
|
101 | - break; |
|
90 | + break; |
|
91 | + |
|
92 | + case 'delete': |
|
93 | + // An administrator can only be deleted by another administrator |
|
94 | + if (!Auth::user()->getPreference('canadmin')) { |
|
95 | + // Keep a reference to the currently logged in user because after logging out this user, |
|
96 | + // a call to Auth::user() will not return this user anymore |
|
97 | + $currentUser = Auth::user(); |
|
98 | + Auth::logout(); |
|
99 | + $currentUser->delete(); |
|
100 | + } |
|
101 | + break; |
|
102 | 102 | } |
103 | 103 | |
104 | 104 | header('Location: ' . WT_BASE_URL . WT_SCRIPT_NAME); |
@@ -1820,24 +1820,24 @@ |
||
1820 | 1820 | if ($endjd === WT_CLIENT_JD) { |
1821 | 1821 | // We're dealing with the Today’s Events block |
1822 | 1822 | if ($filter === 0) { |
1823 | - $html .= I18N::translate('No events exist for today.'); |
|
1823 | + $html .= I18N::translate('No events exist for today.'); |
|
1824 | 1824 | } else { |
1825 | - $html .= I18N::translate('No events for living individuals exist for today.'); |
|
1825 | + $html .= I18N::translate('No events for living individuals exist for today.'); |
|
1826 | 1826 | } |
1827 | 1827 | } else { |
1828 | 1828 | // We're dealing with the Upcoming Events block |
1829 | 1829 | if ($filter === 0) { |
1830 | 1830 | if ($endjd === $startjd) { |
1831 | - $html .= I18N::translate('No events exist for tomorrow.'); |
|
1831 | + $html .= I18N::translate('No events exist for tomorrow.'); |
|
1832 | 1832 | } else { |
1833 | - $html .= /* I18N: translation for %s==1 is unused; it is translated separately as “tomorrow” */ I18N::plural('No events exist for the next %s day.', 'No events exist for the next %s days.', $endjd - $startjd + 1, I18N::number($endjd - $startjd + 1)); |
|
1833 | + $html .= /* I18N: translation for %s==1 is unused; it is translated separately as “tomorrow” */ I18N::plural('No events exist for the next %s day.', 'No events exist for the next %s days.', $endjd - $startjd + 1, I18N::number($endjd - $startjd + 1)); |
|
1834 | 1834 | } |
1835 | 1835 | } else { |
1836 | 1836 | if ($endjd === $startjd) { |
1837 | - $html .= I18N::translate('No events for living individuals exist for tomorrow.'); |
|
1837 | + $html .= I18N::translate('No events for living individuals exist for tomorrow.'); |
|
1838 | 1838 | } else { |
1839 | 1839 | // I18N: translation for %s==1 is unused; it is translated separately as “tomorrow” |
1840 | - $html .= I18N::plural('No events for living people exist for the next %s day.', 'No events for living people exist for the next %s days.', $endjd - $startjd + 1, I18N::number($endjd - $startjd + 1)); |
|
1840 | + $html .= I18N::plural('No events for living people exist for the next %s day.', 'No events for living people exist for the next %s days.', $endjd - $startjd + 1, I18N::number($endjd - $startjd + 1)); |
|
1841 | 1841 | } |
1842 | 1842 | } |
1843 | 1843 | } |
@@ -1572,37 +1572,37 @@ discard block |
||
1572 | 1572 | |
1573 | 1573 | } |
1574 | 1574 | switch ($style) { |
1575 | - case 1: |
|
1576 | - return '<ul><li>' . implode('</li><li>', $html) . '</li></ul>'; |
|
1577 | - case 2: |
|
1578 | - return implode(I18N::$list_separator, $html); |
|
1579 | - case 3: |
|
1580 | - $i = 0; |
|
1581 | - $count = count($html); |
|
1582 | - if ($count > 36) { |
|
1583 | - $col = 4; |
|
1584 | - } elseif ($count > 18) { |
|
1585 | - $col = 3; |
|
1586 | - } elseif ($count > 6) { |
|
1587 | - $col = 2; |
|
1588 | - } else { |
|
1589 | - $col = 1; |
|
1590 | - } |
|
1591 | - $newcol = ceil($count / $col); |
|
1592 | - $html2 = '<table class="list_table"><tr>'; |
|
1593 | - $html2 .= '<td class="list_value" style="padding: 14px;">'; |
|
1594 | - |
|
1595 | - foreach ($html as $surns) { |
|
1596 | - $html2 .= $surns . '<br>'; |
|
1597 | - $i++; |
|
1598 | - if ($i == $newcol && $i < $count) { |
|
1599 | - $html2 .= '</td><td class="list_value" style="padding: 14px;">'; |
|
1600 | - $newcol = $i + ceil($count / $col); |
|
1575 | + case 1: |
|
1576 | + return '<ul><li>' . implode('</li><li>', $html) . '</li></ul>'; |
|
1577 | + case 2: |
|
1578 | + return implode(I18N::$list_separator, $html); |
|
1579 | + case 3: |
|
1580 | + $i = 0; |
|
1581 | + $count = count($html); |
|
1582 | + if ($count > 36) { |
|
1583 | + $col = 4; |
|
1584 | + } elseif ($count > 18) { |
|
1585 | + $col = 3; |
|
1586 | + } elseif ($count > 6) { |
|
1587 | + $col = 2; |
|
1588 | + } else { |
|
1589 | + $col = 1; |
|
1601 | 1590 | } |
1602 | - } |
|
1603 | - $html2 .= '</td></tr></table>'; |
|
1591 | + $newcol = ceil($count / $col); |
|
1592 | + $html2 = '<table class="list_table"><tr>'; |
|
1593 | + $html2 .= '<td class="list_value" style="padding: 14px;">'; |
|
1594 | + |
|
1595 | + foreach ($html as $surns) { |
|
1596 | + $html2 .= $surns . '<br>'; |
|
1597 | + $i++; |
|
1598 | + if ($i == $newcol && $i < $count) { |
|
1599 | + $html2 .= '</td><td class="list_value" style="padding: 14px;">'; |
|
1600 | + $newcol = $i + ceil($count / $col); |
|
1601 | + } |
|
1602 | + } |
|
1603 | + $html2 .= '</td></tr></table>'; |
|
1604 | 1604 | |
1605 | - return $html2; |
|
1605 | + return $html2; |
|
1606 | 1606 | } |
1607 | 1607 | } |
1608 | 1608 | /** |
@@ -1783,14 +1783,14 @@ discard block |
||
1783 | 1783 | |
1784 | 1784 | // Now we've filtered the list, we can sort by event, if required |
1785 | 1785 | switch ($sort_by) { |
1786 | - case 'anniv': |
|
1787 | - // Data is already sorted by anniversary date |
|
1788 | - break; |
|
1789 | - case 'alpha': |
|
1790 | - uasort($filtered_events, function (Fact $x, Fact $y) { |
|
1791 | - return GedcomRecord::compare($x->getParent(), $y->getParent()); |
|
1792 | - }); |
|
1793 | - break; |
|
1786 | + case 'anniv': |
|
1787 | + // Data is already sorted by anniversary date |
|
1788 | + break; |
|
1789 | + case 'alpha': |
|
1790 | + uasort($filtered_events, function (Fact $x, Fact $y) { |
|
1791 | + return GedcomRecord::compare($x->getParent(), $y->getParent()); |
|
1792 | + }); |
|
1793 | + break; |
|
1794 | 1794 | } |
1795 | 1795 | |
1796 | 1796 | foreach ($filtered_events as $fact) { |
@@ -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> |
@@ -135,7 +135,7 @@ |
||
135 | 135 | } |
136 | 136 | } catch (\Exception $ex) { |
137 | 137 | // The module has been deleted or is broken? Disable it. |
138 | - Log::addConfigurationLog("Module {$module_name} is missing or broken - disabling it"); |
|
138 | + Log::addConfigurationLog("module {$module_name} is missing or broken - disabling it"); |
|
139 | 139 | Database::prepare( |
140 | 140 | "UPDATE `##module` SET status = 'disabled' WHERE module_name = :module_name" |
141 | 141 | )->execute(array( |
@@ -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> |
@@ -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 | } |