@@ -31,161 +31,161 @@ discard block |
||
31 | 31 | * {@inhericDoc} |
32 | 32 | * @see \MyArtJaub\Webtrees\Mvc\View\AbstractView::renderContent() |
33 | 33 | */ |
34 | - protected function renderContent() { |
|
34 | + protected function renderContent() { |
|
35 | 35 | |
36 | - /** @var \Fisharebest\Webtrees\Tree $tree */ |
|
37 | - $tree = $this->data->get('tree'); |
|
36 | + /** @var \Fisharebest\Webtrees\Tree $tree */ |
|
37 | + $tree = $this->data->get('tree'); |
|
38 | 38 | |
39 | - echo '<h2 class="center">', $this->data->get('title') , '</h2>'; |
|
40 | - echo '<p class="center alpha_index">', implode(' | ', $this->getInitialLettersList()), '</p>'; |
|
39 | + echo '<h2 class="center">', $this->data->get('title') , '</h2>'; |
|
40 | + echo '<p class="center alpha_index">', implode(' | ', $this->getInitialLettersList()), '</p>'; |
|
41 | 41 | |
42 | - if($this->data->get('issurnames', false)) { |
|
43 | - $surns = $this->data->get('surnameslist', array()); |
|
44 | - $extra_params = array ('mod' => Constants::MODULE_MAJ_PATROLIN_NAME, 'mod_action' => 'Lineage'); |
|
45 | - // Show the surname list |
|
46 | - switch ($tree->getPreference('SURNAME_LIST_STYLE')) { |
|
47 | - case 'style1': |
|
42 | + if($this->data->get('issurnames', false)) { |
|
43 | + $surns = $this->data->get('surnameslist', array()); |
|
44 | + $extra_params = array ('mod' => Constants::MODULE_MAJ_PATROLIN_NAME, 'mod_action' => 'Lineage'); |
|
45 | + // Show the surname list |
|
46 | + switch ($tree->getPreference('SURNAME_LIST_STYLE')) { |
|
47 | + case 'style1': |
|
48 | 48 | echo FunctionsPrintLists::surnameList($surns, 3, true, WT_SCRIPT_NAME, $tree, $extra_params); |
49 | 49 | break; |
50 | - case 'style3': |
|
51 | - echo FunctionsPrintLists::surnameTagCloud($surns, WT_SCRIPT_NAME, true, $tree, $extra_params); |
|
52 | - break; |
|
53 | - case 'style2': |
|
54 | - default: |
|
55 | - echo FunctionsPrintLists::surnameTable($surns, WT_SCRIPT_NAME, $tree, $extra_params); |
|
56 | - break; |
|
57 | - } |
|
58 | - } |
|
59 | - else if ($this->data->get('islineages', false)) { |
|
60 | - //Link to indilist |
|
61 | - echo '<p class="center"><strong>'. |
|
62 | - '<a href="indilist.php?ged=' . $tree->getNameUrl() . '&surname=' . rawurlencode($this->data->get('surname')) .'">'. |
|
63 | - I18N::translate('Go to the list of individuals with surname %s', $this->data->get('legend')). |
|
64 | - '</a></strong></p>'; |
|
50 | + case 'style3': |
|
51 | + echo FunctionsPrintLists::surnameTagCloud($surns, WT_SCRIPT_NAME, true, $tree, $extra_params); |
|
52 | + break; |
|
53 | + case 'style2': |
|
54 | + default: |
|
55 | + echo FunctionsPrintLists::surnameTable($surns, WT_SCRIPT_NAME, $tree, $extra_params); |
|
56 | + break; |
|
57 | + } |
|
58 | + } |
|
59 | + else if ($this->data->get('islineages', false)) { |
|
60 | + //Link to indilist |
|
61 | + echo '<p class="center"><strong>'. |
|
62 | + '<a href="indilist.php?ged=' . $tree->getNameUrl() . '&surname=' . rawurlencode($this->data->get('surname')) .'">'. |
|
63 | + I18N::translate('Go to the list of individuals with surname %s', $this->data->get('legend')). |
|
64 | + '</a></strong></p>'; |
|
65 | 65 | |
66 | - $lineages = $this->data->get('lineages', null); |
|
67 | - $nb_lineages = count($lineages); |
|
68 | - if(is_null($lineages) || $nb_lineages == 0) { |
|
69 | - echo '<p class="center"><span class="warning">', |
|
70 | - I18N::translate('No individuals with surname %s has been found. Please try another name.', |
|
71 | - '<span dir="auto">' . $this->data->get('legend') . '</span>'), |
|
72 | - '</span></p>'; |
|
73 | - } else { |
|
66 | + $lineages = $this->data->get('lineages', null); |
|
67 | + $nb_lineages = count($lineages); |
|
68 | + if(is_null($lineages) || $nb_lineages == 0) { |
|
69 | + echo '<p class="center"><span class="warning">', |
|
70 | + I18N::translate('No individuals with surname %s has been found. Please try another name.', |
|
71 | + '<span dir="auto">' . $this->data->get('legend') . '</span>'), |
|
72 | + '</span></p>'; |
|
73 | + } else { |
|
74 | 74 | |
75 | - echo '<div id="patronymiclineages">'. |
|
76 | - '<div class="list_label">', |
|
77 | - $this->data->get('table_title'), |
|
78 | - '</div>'; |
|
75 | + echo '<div id="patronymiclineages">'. |
|
76 | + '<div class="list_label">', |
|
77 | + $this->data->get('table_title'), |
|
78 | + '</div>'; |
|
79 | 79 | |
80 | - echo '<div class="list_value_wrap">'; |
|
80 | + echo '<div class="list_value_wrap">'; |
|
81 | 81 | |
82 | - foreach($lineages as $i => $lineage) { |
|
83 | - $this->printRootLineage($lineage); |
|
84 | - if($i < $nb_lineages - 1) echo '<hr />'; |
|
85 | - } |
|
82 | + foreach($lineages as $i => $lineage) { |
|
83 | + $this->printRootLineage($lineage); |
|
84 | + if($i < $nb_lineages - 1) echo '<hr />'; |
|
85 | + } |
|
86 | 86 | |
87 | - echo '</div>'; |
|
87 | + echo '</div>'; |
|
88 | 88 | |
89 | - echo '<div class="list_label">', |
|
90 | - I18N::translate('%s lineages found', $nb_lineages), |
|
91 | - '</div>'. |
|
92 | - '</div>'; |
|
89 | + echo '<div class="list_label">', |
|
90 | + I18N::translate('%s lineages found', $nb_lineages), |
|
91 | + '</div>'. |
|
92 | + '</div>'; |
|
93 | 93 | |
94 | - } |
|
95 | - } |
|
96 | - } |
|
94 | + } |
|
95 | + } |
|
96 | + } |
|
97 | 97 | |
98 | - /** |
|
99 | - * Get the list of initial letters |
|
100 | - * |
|
101 | - * @return string[] |
|
102 | - */ |
|
103 | - private function getInitialLettersList() { |
|
104 | - $list = array(); |
|
105 | - /** @var \Fisharebest\Webtrees\Tree $tree */ |
|
106 | - $tree = $this->data->get('tree'); |
|
98 | + /** |
|
99 | + * Get the list of initial letters |
|
100 | + * |
|
101 | + * @return string[] |
|
102 | + */ |
|
103 | + private function getInitialLettersList() { |
|
104 | + $list = array(); |
|
105 | + /** @var \Fisharebest\Webtrees\Tree $tree */ |
|
106 | + $tree = $this->data->get('tree'); |
|
107 | 107 | $script_base_url = WT_SCRIPT_NAME . '?mod=' . \MyArtJaub\Webtrees\Constants::MODULE_MAJ_PATROLIN_NAME . '&mod_action=Lineage'; |
108 | 108 | |
109 | - foreach (QueryName::surnameAlpha($tree, false, false) as $letter => $count) { |
|
110 | - switch ($letter) { |
|
111 | - case '@': |
|
112 | - $html = I18N::translateContext('Unknown surname', '…'); |
|
113 | - break; |
|
114 | - case ',': |
|
115 | - $html = I18N::translate('None'); |
|
116 | - break; |
|
117 | - default: |
|
118 | - $html = Filter::escapeHtml($letter); |
|
119 | - break; |
|
120 | - } |
|
121 | - if ($count) { |
|
122 | - if ($letter == $this->data->get('alpha')) { |
|
123 | - $list[] = '<a href="' . $script_base_url . '&alpha=' . rawurlencode($letter) . '&ged=' . $tree->getNameUrl() . '" class="warning" title="' . I18N::number($count) . '">' . $html . '</a>'; |
|
124 | - } else { |
|
125 | - $list[] = '<a href="' . $script_base_url . '&alpha=' . rawurlencode($letter) . '&ged=' . $tree->getNameUrl() . '" title="' . I18N::number($count) . '">' . $html . '</a>'; |
|
126 | - } |
|
127 | - } else { |
|
128 | - $list[] = $html; |
|
129 | - } |
|
130 | - } |
|
109 | + foreach (QueryName::surnameAlpha($tree, false, false) as $letter => $count) { |
|
110 | + switch ($letter) { |
|
111 | + case '@': |
|
112 | + $html = I18N::translateContext('Unknown surname', '…'); |
|
113 | + break; |
|
114 | + case ',': |
|
115 | + $html = I18N::translate('None'); |
|
116 | + break; |
|
117 | + default: |
|
118 | + $html = Filter::escapeHtml($letter); |
|
119 | + break; |
|
120 | + } |
|
121 | + if ($count) { |
|
122 | + if ($letter == $this->data->get('alpha')) { |
|
123 | + $list[] = '<a href="' . $script_base_url . '&alpha=' . rawurlencode($letter) . '&ged=' . $tree->getNameUrl() . '" class="warning" title="' . I18N::number($count) . '">' . $html . '</a>'; |
|
124 | + } else { |
|
125 | + $list[] = '<a href="' . $script_base_url . '&alpha=' . rawurlencode($letter) . '&ged=' . $tree->getNameUrl() . '" title="' . I18N::number($count) . '">' . $html . '</a>'; |
|
126 | + } |
|
127 | + } else { |
|
128 | + $list[] = $html; |
|
129 | + } |
|
130 | + } |
|
131 | 131 | |
132 | - // Search spiders don't get the "show all" option as the other links give them everything. |
|
133 | - if (!Auth::isSearchEngine()) { |
|
134 | - if ($this->data->get('show_all') === 'yes') { |
|
135 | - $list[] = '<span class="warning">' . I18N::translate('All') . '</span>'; |
|
136 | - } else { |
|
137 | - $list[] = '<a href="' . $script_base_url . '&show_all=yes' . '&ged=' . $tree->getNameUrl() . '">' . I18N::translate('All') . '</a>'; |
|
138 | - } |
|
139 | - } |
|
132 | + // Search spiders don't get the "show all" option as the other links give them everything. |
|
133 | + if (!Auth::isSearchEngine()) { |
|
134 | + if ($this->data->get('show_all') === 'yes') { |
|
135 | + $list[] = '<span class="warning">' . I18N::translate('All') . '</span>'; |
|
136 | + } else { |
|
137 | + $list[] = '<a href="' . $script_base_url . '&show_all=yes' . '&ged=' . $tree->getNameUrl() . '">' . I18N::translate('All') . '</a>'; |
|
138 | + } |
|
139 | + } |
|
140 | 140 | |
141 | - return $list; |
|
142 | - } |
|
141 | + return $list; |
|
142 | + } |
|
143 | 143 | |
144 | - /** |
|
145 | - * Print a root lineage node |
|
146 | - * @param LineageRootNode $node |
|
147 | - */ |
|
148 | - private function printRootLineage(LineageRootNode $node) { |
|
149 | - print '<div class="patrolin_tree">'; |
|
150 | - if($node->getIndividual() === null) { |
|
151 | - $fam_nodes = $node->getFamiliesNodes(); |
|
152 | - foreach($fam_nodes as $fam){ |
|
153 | - foreach($fam_nodes[$fam] as $child_node) { |
|
154 | - if($child_node) { |
|
155 | - $this->printLineage($child_node); |
|
156 | - } |
|
157 | - } |
|
158 | - } |
|
159 | - } |
|
160 | - else { |
|
161 | - $this->printLineage($node); |
|
162 | - } |
|
163 | - echo '</div>'; |
|
144 | + /** |
|
145 | + * Print a root lineage node |
|
146 | + * @param LineageRootNode $node |
|
147 | + */ |
|
148 | + private function printRootLineage(LineageRootNode $node) { |
|
149 | + print '<div class="patrolin_tree">'; |
|
150 | + if($node->getIndividual() === null) { |
|
151 | + $fam_nodes = $node->getFamiliesNodes(); |
|
152 | + foreach($fam_nodes as $fam){ |
|
153 | + foreach($fam_nodes[$fam] as $child_node) { |
|
154 | + if($child_node) { |
|
155 | + $this->printLineage($child_node); |
|
156 | + } |
|
157 | + } |
|
158 | + } |
|
159 | + } |
|
160 | + else { |
|
161 | + $this->printLineage($node); |
|
162 | + } |
|
163 | + echo '</div>'; |
|
164 | 164 | |
165 | - $places = $node->getPlaces(); |
|
166 | - if($places && count($places)>0){ |
|
167 | - echo '<div class="patrolin_places">'; |
|
168 | - echo \MyArtJaub\Webtrees\Functions\FunctionsPrint::htmlPlacesCloud($places, false, $this->data->get('tree')); |
|
169 | - echo '</div>'; |
|
170 | - } |
|
171 | - } |
|
165 | + $places = $node->getPlaces(); |
|
166 | + if($places && count($places)>0){ |
|
167 | + echo '<div class="patrolin_places">'; |
|
168 | + echo \MyArtJaub\Webtrees\Functions\FunctionsPrint::htmlPlacesCloud($places, false, $this->data->get('tree')); |
|
169 | + echo '</div>'; |
|
170 | + } |
|
171 | + } |
|
172 | 172 | |
173 | - /** |
|
174 | - * Print a lineage node, recursively. |
|
175 | - * @param LineageNode $node |
|
176 | - */ |
|
177 | - private function printLineage(LineageNode $node) { |
|
173 | + /** |
|
174 | + * Print a lineage node, recursively. |
|
175 | + * @param LineageNode $node |
|
176 | + */ |
|
177 | + private function printLineage(LineageNode $node) { |
|
178 | 178 | |
179 | - echo '<ul>'; |
|
180 | - $fam_nodes = $node->getFamiliesNodes(); |
|
181 | - if(count($fam_nodes) > 0) { |
|
182 | - $is_first_family = true; |
|
183 | - foreach($fam_nodes as $fam) { |
|
184 | - $node_indi = $node->getIndividual(); |
|
185 | - echo '<li>'; |
|
186 | - if($is_first_family){ |
|
187 | - echo FunctionsPrint::htmlIndividualForList($node_indi); |
|
188 | - } |
|
179 | + echo '<ul>'; |
|
180 | + $fam_nodes = $node->getFamiliesNodes(); |
|
181 | + if(count($fam_nodes) > 0) { |
|
182 | + $is_first_family = true; |
|
183 | + foreach($fam_nodes as $fam) { |
|
184 | + $node_indi = $node->getIndividual(); |
|
185 | + echo '<li>'; |
|
186 | + if($is_first_family){ |
|
187 | + echo FunctionsPrint::htmlIndividualForList($node_indi); |
|
188 | + } |
|
189 | 189 | else{ |
190 | 190 | echo FunctionsPrint::htmlIndividualForList($node_indi, false); |
191 | 191 | } |
@@ -204,32 +204,32 @@ discard block |
||
204 | 204 | echo '<span class="details1" title="'.$marrdate.'"><i class="icon-rings"></i>'.$marryear.'</span></a> '; |
205 | 205 | echo FunctionsPrint::htmlIndividualForList($spouse); |
206 | 206 | } |
207 | - foreach($fam_nodes[$fam] as $child_node) { |
|
208 | - if($child_node) { |
|
209 | - $this->printLineage($child_node); |
|
210 | - } |
|
211 | - else { |
|
212 | - echo '<ul><li><strong>…</strong></li></ul>'; |
|
213 | - } |
|
214 | - } |
|
215 | - $is_first_family = false; |
|
216 | - } |
|
217 | - } |
|
218 | - else { |
|
219 | - echo '<li>'; |
|
220 | - echo \MyArtJaub\Webtrees\Functions\FunctionsPrint::htmlIndividualForList($node->getIndividual()); |
|
221 | - if($node->hasFollowUpSurname()) { |
|
222 | - $url_base = WT_SCRIPT_NAME . '?mod=' . \MyArtJaub\Webtrees\Constants::MODULE_MAJ_PATROLIN_NAME . '&mod_action=Lineage'; |
|
223 | - echo ' '. |
|
224 | - '<a href="' . $url_base . '&surname=' . rawurlencode($node->getFollowUpSurname()) . '&ged=' . $this->data->get('tree')->getNameUrl() . '">'. |
|
225 | - '('.I18N::translate('Go to %s lineages', $node->getFollowUpSurname()).')'. |
|
226 | - '</a>'; |
|
227 | - } |
|
228 | - echo '</li>'; |
|
229 | - } |
|
230 | - echo '</ul>'; |
|
207 | + foreach($fam_nodes[$fam] as $child_node) { |
|
208 | + if($child_node) { |
|
209 | + $this->printLineage($child_node); |
|
210 | + } |
|
211 | + else { |
|
212 | + echo '<ul><li><strong>…</strong></li></ul>'; |
|
213 | + } |
|
214 | + } |
|
215 | + $is_first_family = false; |
|
216 | + } |
|
217 | + } |
|
218 | + else { |
|
219 | + echo '<li>'; |
|
220 | + echo \MyArtJaub\Webtrees\Functions\FunctionsPrint::htmlIndividualForList($node->getIndividual()); |
|
221 | + if($node->hasFollowUpSurname()) { |
|
222 | + $url_base = WT_SCRIPT_NAME . '?mod=' . \MyArtJaub\Webtrees\Constants::MODULE_MAJ_PATROLIN_NAME . '&mod_action=Lineage'; |
|
223 | + echo ' '. |
|
224 | + '<a href="' . $url_base . '&surname=' . rawurlencode($node->getFollowUpSurname()) . '&ged=' . $this->data->get('tree')->getNameUrl() . '">'. |
|
225 | + '('.I18N::translate('Go to %s lineages', $node->getFollowUpSurname()).')'. |
|
226 | + '</a>'; |
|
227 | + } |
|
228 | + echo '</li>'; |
|
229 | + } |
|
230 | + echo '</ul>'; |
|
231 | 231 | |
232 | - } |
|
232 | + } |
|
233 | 233 | |
234 | 234 | } |
235 | 235 | |
236 | 236 | \ No newline at end of file |
@@ -36,12 +36,12 @@ discard block |
||
36 | 36 | /** @var \Fisharebest\Webtrees\Tree $tree */ |
37 | 37 | $tree = $this->data->get('tree'); |
38 | 38 | |
39 | - echo '<h2 class="center">', $this->data->get('title') , '</h2>'; |
|
39 | + echo '<h2 class="center">', $this->data->get('title'), '</h2>'; |
|
40 | 40 | echo '<p class="center alpha_index">', implode(' | ', $this->getInitialLettersList()), '</p>'; |
41 | 41 | |
42 | - if($this->data->get('issurnames', false)) { |
|
42 | + if ($this->data->get('issurnames', false)) { |
|
43 | 43 | $surns = $this->data->get('surnameslist', array()); |
44 | - $extra_params = array ('mod' => Constants::MODULE_MAJ_PATROLIN_NAME, 'mod_action' => 'Lineage'); |
|
44 | + $extra_params = array('mod' => Constants::MODULE_MAJ_PATROLIN_NAME, 'mod_action' => 'Lineage'); |
|
45 | 45 | // Show the surname list |
46 | 46 | switch ($tree->getPreference('SURNAME_LIST_STYLE')) { |
47 | 47 | case 'style1': |
@@ -59,16 +59,16 @@ discard block |
||
59 | 59 | else if ($this->data->get('islineages', false)) { |
60 | 60 | //Link to indilist |
61 | 61 | echo '<p class="center"><strong>'. |
62 | - '<a href="indilist.php?ged=' . $tree->getNameUrl() . '&surname=' . rawurlencode($this->data->get('surname')) .'">'. |
|
62 | + '<a href="indilist.php?ged='.$tree->getNameUrl().'&surname='.rawurlencode($this->data->get('surname')).'">'. |
|
63 | 63 | I18N::translate('Go to the list of individuals with surname %s', $this->data->get('legend')). |
64 | 64 | '</a></strong></p>'; |
65 | 65 | |
66 | 66 | $lineages = $this->data->get('lineages', null); |
67 | 67 | $nb_lineages = count($lineages); |
68 | - if(is_null($lineages) || $nb_lineages == 0) { |
|
68 | + if (is_null($lineages) || $nb_lineages == 0) { |
|
69 | 69 | echo '<p class="center"><span class="warning">', |
70 | 70 | I18N::translate('No individuals with surname %s has been found. Please try another name.', |
71 | - '<span dir="auto">' . $this->data->get('legend') . '</span>'), |
|
71 | + '<span dir="auto">'.$this->data->get('legend').'</span>'), |
|
72 | 72 | '</span></p>'; |
73 | 73 | } else { |
74 | 74 | |
@@ -79,9 +79,9 @@ discard block |
||
79 | 79 | |
80 | 80 | echo '<div class="list_value_wrap">'; |
81 | 81 | |
82 | - foreach($lineages as $i => $lineage) { |
|
82 | + foreach ($lineages as $i => $lineage) { |
|
83 | 83 | $this->printRootLineage($lineage); |
84 | - if($i < $nb_lineages - 1) echo '<hr />'; |
|
84 | + if ($i < $nb_lineages - 1) echo '<hr />'; |
|
85 | 85 | } |
86 | 86 | |
87 | 87 | echo '</div>'; |
@@ -104,7 +104,7 @@ discard block |
||
104 | 104 | $list = array(); |
105 | 105 | /** @var \Fisharebest\Webtrees\Tree $tree */ |
106 | 106 | $tree = $this->data->get('tree'); |
107 | - $script_base_url = WT_SCRIPT_NAME . '?mod=' . \MyArtJaub\Webtrees\Constants::MODULE_MAJ_PATROLIN_NAME . '&mod_action=Lineage'; |
|
107 | + $script_base_url = WT_SCRIPT_NAME.'?mod='.\MyArtJaub\Webtrees\Constants::MODULE_MAJ_PATROLIN_NAME.'&mod_action=Lineage'; |
|
108 | 108 | |
109 | 109 | foreach (QueryName::surnameAlpha($tree, false, false) as $letter => $count) { |
110 | 110 | switch ($letter) { |
@@ -120,9 +120,9 @@ discard block |
||
120 | 120 | } |
121 | 121 | if ($count) { |
122 | 122 | if ($letter == $this->data->get('alpha')) { |
123 | - $list[] = '<a href="' . $script_base_url . '&alpha=' . rawurlencode($letter) . '&ged=' . $tree->getNameUrl() . '" class="warning" title="' . I18N::number($count) . '">' . $html . '</a>'; |
|
123 | + $list[] = '<a href="'.$script_base_url.'&alpha='.rawurlencode($letter).'&ged='.$tree->getNameUrl().'" class="warning" title="'.I18N::number($count).'">'.$html.'</a>'; |
|
124 | 124 | } else { |
125 | - $list[] = '<a href="' . $script_base_url . '&alpha=' . rawurlencode($letter) . '&ged=' . $tree->getNameUrl() . '" title="' . I18N::number($count) . '">' . $html . '</a>'; |
|
125 | + $list[] = '<a href="'.$script_base_url.'&alpha='.rawurlencode($letter).'&ged='.$tree->getNameUrl().'" title="'.I18N::number($count).'">'.$html.'</a>'; |
|
126 | 126 | } |
127 | 127 | } else { |
128 | 128 | $list[] = $html; |
@@ -132,9 +132,9 @@ discard block |
||
132 | 132 | // Search spiders don't get the "show all" option as the other links give them everything. |
133 | 133 | if (!Auth::isSearchEngine()) { |
134 | 134 | if ($this->data->get('show_all') === 'yes') { |
135 | - $list[] = '<span class="warning">' . I18N::translate('All') . '</span>'; |
|
135 | + $list[] = '<span class="warning">'.I18N::translate('All').'</span>'; |
|
136 | 136 | } else { |
137 | - $list[] = '<a href="' . $script_base_url . '&show_all=yes' . '&ged=' . $tree->getNameUrl() . '">' . I18N::translate('All') . '</a>'; |
|
137 | + $list[] = '<a href="'.$script_base_url.'&show_all=yes'.'&ged='.$tree->getNameUrl().'">'.I18N::translate('All').'</a>'; |
|
138 | 138 | } |
139 | 139 | } |
140 | 140 | |
@@ -147,11 +147,11 @@ discard block |
||
147 | 147 | */ |
148 | 148 | private function printRootLineage(LineageRootNode $node) { |
149 | 149 | print '<div class="patrolin_tree">'; |
150 | - if($node->getIndividual() === null) { |
|
150 | + if ($node->getIndividual() === null) { |
|
151 | 151 | $fam_nodes = $node->getFamiliesNodes(); |
152 | - foreach($fam_nodes as $fam){ |
|
153 | - foreach($fam_nodes[$fam] as $child_node) { |
|
154 | - if($child_node) { |
|
152 | + foreach ($fam_nodes as $fam) { |
|
153 | + foreach ($fam_nodes[$fam] as $child_node) { |
|
154 | + if ($child_node) { |
|
155 | 155 | $this->printLineage($child_node); |
156 | 156 | } |
157 | 157 | } |
@@ -163,7 +163,7 @@ discard block |
||
163 | 163 | echo '</div>'; |
164 | 164 | |
165 | 165 | $places = $node->getPlaces(); |
166 | - if($places && count($places)>0){ |
|
166 | + if ($places && count($places) > 0) { |
|
167 | 167 | echo '<div class="patrolin_places">'; |
168 | 168 | echo \MyArtJaub\Webtrees\Functions\FunctionsPrint::htmlPlacesCloud($places, false, $this->data->get('tree')); |
169 | 169 | echo '</div>'; |
@@ -178,34 +178,34 @@ discard block |
||
178 | 178 | |
179 | 179 | echo '<ul>'; |
180 | 180 | $fam_nodes = $node->getFamiliesNodes(); |
181 | - if(count($fam_nodes) > 0) { |
|
181 | + if (count($fam_nodes) > 0) { |
|
182 | 182 | $is_first_family = true; |
183 | - foreach($fam_nodes as $fam) { |
|
183 | + foreach ($fam_nodes as $fam) { |
|
184 | 184 | $node_indi = $node->getIndividual(); |
185 | 185 | echo '<li>'; |
186 | - if($is_first_family){ |
|
186 | + if ($is_first_family) { |
|
187 | 187 | echo FunctionsPrint::htmlIndividualForList($node_indi); |
188 | 188 | } |
189 | - else{ |
|
189 | + else { |
|
190 | 190 | echo FunctionsPrint::htmlIndividualForList($node_indi, false); |
191 | 191 | } |
192 | 192 | //Get individual's spouse |
193 | 193 | $dfam = new Family($fam); |
194 | - $spouse=$dfam->getSpouseById($node_indi); |
|
194 | + $spouse = $dfam->getSpouseById($node_indi); |
|
195 | 195 | //Print the spouse if relevant |
196 | - if($spouse){ |
|
196 | + if ($spouse) { |
|
197 | 197 | $marrdate = I18N::translate('yes'); |
198 | 198 | $marryear = ''; |
199 | 199 | echo ' <a href="'.$fam->getHtmlUrl().'">'; |
200 | - if ($fam->getMarriageYear()){ |
|
200 | + if ($fam->getMarriageYear()) { |
|
201 | 201 | $marrdate = strip_tags($fam->getMarriageDate()->Display()); |
202 | 202 | $marryear = $fam->getMarriageYear(); |
203 | 203 | } |
204 | 204 | echo '<span class="details1" title="'.$marrdate.'"><i class="icon-rings"></i>'.$marryear.'</span></a> '; |
205 | 205 | echo FunctionsPrint::htmlIndividualForList($spouse); |
206 | 206 | } |
207 | - foreach($fam_nodes[$fam] as $child_node) { |
|
208 | - if($child_node) { |
|
207 | + foreach ($fam_nodes[$fam] as $child_node) { |
|
208 | + if ($child_node) { |
|
209 | 209 | $this->printLineage($child_node); |
210 | 210 | } |
211 | 211 | else { |
@@ -218,10 +218,10 @@ discard block |
||
218 | 218 | else { |
219 | 219 | echo '<li>'; |
220 | 220 | echo \MyArtJaub\Webtrees\Functions\FunctionsPrint::htmlIndividualForList($node->getIndividual()); |
221 | - if($node->hasFollowUpSurname()) { |
|
222 | - $url_base = WT_SCRIPT_NAME . '?mod=' . \MyArtJaub\Webtrees\Constants::MODULE_MAJ_PATROLIN_NAME . '&mod_action=Lineage'; |
|
221 | + if ($node->hasFollowUpSurname()) { |
|
222 | + $url_base = WT_SCRIPT_NAME.'?mod='.\MyArtJaub\Webtrees\Constants::MODULE_MAJ_PATROLIN_NAME.'&mod_action=Lineage'; |
|
223 | 223 | echo ' '. |
224 | - '<a href="' . $url_base . '&surname=' . rawurlencode($node->getFollowUpSurname()) . '&ged=' . $this->data->get('tree')->getNameUrl() . '">'. |
|
224 | + '<a href="'.$url_base.'&surname='.rawurlencode($node->getFollowUpSurname()).'&ged='.$this->data->get('tree')->getNameUrl().'">'. |
|
225 | 225 | '('.I18N::translate('Go to %s lineages', $node->getFollowUpSurname()).')'. |
226 | 226 | '</a>'; |
227 | 227 | } |
@@ -31,116 +31,116 @@ discard block |
||
31 | 31 | * Sosa Module. |
32 | 32 | */ |
33 | 33 | class SosaModule |
34 | - extends AbstractModule |
|
35 | - implements ModuleMenuInterface, |
|
36 | - ModuleConfigInterface, |
|
37 | - HookSubscriberInterface, |
|
38 | - IndividualHeaderExtenderInterface, |
|
39 | - RecordNameTextExtenderInterface |
|
34 | + extends AbstractModule |
|
35 | + implements ModuleMenuInterface, |
|
36 | + ModuleConfigInterface, |
|
37 | + HookSubscriberInterface, |
|
38 | + IndividualHeaderExtenderInterface, |
|
39 | + RecordNameTextExtenderInterface |
|
40 | 40 | { |
41 | - // How to update the database schema for this module |
|
42 | - const SCHEMA_TARGET_VERSION = 1; |
|
43 | - const SCHEMA_SETTING_NAME = 'MAJ_SOSA_SCHEMA_VERSION'; |
|
44 | - const SCHEMA_MIGRATION_PREFIX = '\MyArtJaub\Webtrees\Module\Sosa\Schema'; |
|
41 | + // How to update the database schema for this module |
|
42 | + const SCHEMA_TARGET_VERSION = 1; |
|
43 | + const SCHEMA_SETTING_NAME = 'MAJ_SOSA_SCHEMA_VERSION'; |
|
44 | + const SCHEMA_MIGRATION_PREFIX = '\MyArtJaub\Webtrees\Module\Sosa\Schema'; |
|
45 | 45 | |
46 | - /** @var string For custom modules - link for support, upgrades, etc. */ |
|
47 | - const CUSTOM_WEBSITE = 'https://github.com/jon48/webtrees-lib'; |
|
48 | - |
|
49 | - /** |
|
50 | - * {@inhericDoc} |
|
51 | - */ |
|
52 | - public function getTitle() { |
|
53 | - return /* I18N: Name of the “Hooks” module */ I18N::translate('Sosa'); |
|
54 | - } |
|
55 | - |
|
56 | - /** |
|
57 | - * {@inhericDoc} |
|
58 | - */ |
|
59 | - public function getDescription() { |
|
60 | - return /* I18N: Description of the “Hooks” module */ I18N::translate('Calculate and display Sosa ancestors of the root person.'); |
|
61 | - } |
|
62 | - |
|
63 | - /** |
|
64 | - * {@inhericDoc} |
|
65 | - */ |
|
66 | - public function modAction($mod_action) { |
|
67 | - Database::updateSchema(self::SCHEMA_MIGRATION_PREFIX, self::SCHEMA_SETTING_NAME, self::SCHEMA_TARGET_VERSION); |
|
46 | + /** @var string For custom modules - link for support, upgrades, etc. */ |
|
47 | + const CUSTOM_WEBSITE = 'https://github.com/jon48/webtrees-lib'; |
|
48 | + |
|
49 | + /** |
|
50 | + * {@inhericDoc} |
|
51 | + */ |
|
52 | + public function getTitle() { |
|
53 | + return /* I18N: Name of the “Hooks” module */ I18N::translate('Sosa'); |
|
54 | + } |
|
55 | + |
|
56 | + /** |
|
57 | + * {@inhericDoc} |
|
58 | + */ |
|
59 | + public function getDescription() { |
|
60 | + return /* I18N: Description of the “Hooks” module */ I18N::translate('Calculate and display Sosa ancestors of the root person.'); |
|
61 | + } |
|
62 | + |
|
63 | + /** |
|
64 | + * {@inhericDoc} |
|
65 | + */ |
|
66 | + public function modAction($mod_action) { |
|
67 | + Database::updateSchema(self::SCHEMA_MIGRATION_PREFIX, self::SCHEMA_SETTING_NAME, self::SCHEMA_TARGET_VERSION); |
|
68 | 68 | |
69 | - \MyArtJaub\Webtrees\Mvc\Dispatcher::getInstance()->handle($this, $mod_action); |
|
70 | - } |
|
69 | + \MyArtJaub\Webtrees\Mvc\Dispatcher::getInstance()->handle($this, $mod_action); |
|
70 | + } |
|
71 | 71 | |
72 | - /********** |
|
72 | + /********** |
|
73 | 73 | * ModuleConfigInterface |
74 | 74 | **********/ |
75 | 75 | |
76 | - /** |
|
77 | - * {@inhericDoc} |
|
78 | - * @see \Fisharebest\Webtrees\Module\ModuleConfigInterface::getConfigLink() |
|
79 | - */ |
|
80 | - public function getConfigLink() { |
|
81 | - Database::updateSchema(self::SCHEMA_MIGRATION_PREFIX, self::SCHEMA_SETTING_NAME, self::SCHEMA_TARGET_VERSION); |
|
76 | + /** |
|
77 | + * {@inhericDoc} |
|
78 | + * @see \Fisharebest\Webtrees\Module\ModuleConfigInterface::getConfigLink() |
|
79 | + */ |
|
80 | + public function getConfigLink() { |
|
81 | + Database::updateSchema(self::SCHEMA_MIGRATION_PREFIX, self::SCHEMA_SETTING_NAME, self::SCHEMA_TARGET_VERSION); |
|
82 | 82 | |
83 | - return 'module.php?mod=' . $this->getName() . '&mod_action=SosaConfig'; |
|
84 | - } |
|
83 | + return 'module.php?mod=' . $this->getName() . '&mod_action=SosaConfig'; |
|
84 | + } |
|
85 | 85 | |
86 | - /********** |
|
86 | + /********** |
|
87 | 87 | * ModuleMenuInterface |
88 | 88 | **********/ |
89 | 89 | |
90 | - /** |
|
91 | - * {@inhericDoc} |
|
92 | - * @see \Fisharebest\Webtrees\Module\ModuleMenuInterface::defaultMenuOrder() |
|
93 | - */ |
|
94 | - public function defaultMenuOrder() { |
|
95 | - return 5; |
|
96 | - } |
|
97 | - |
|
98 | - /** |
|
99 | - * {@inhericDoc} |
|
100 | - * @see \Fisharebest\Webtrees\Module\ModuleMenuInterface::getMenu() |
|
101 | - */ |
|
102 | - public function getMenu() { |
|
103 | - global $WT_TREE, $controller; |
|
90 | + /** |
|
91 | + * {@inhericDoc} |
|
92 | + * @see \Fisharebest\Webtrees\Module\ModuleMenuInterface::defaultMenuOrder() |
|
93 | + */ |
|
94 | + public function defaultMenuOrder() { |
|
95 | + return 5; |
|
96 | + } |
|
97 | + |
|
98 | + /** |
|
99 | + * {@inhericDoc} |
|
100 | + * @see \Fisharebest\Webtrees\Module\ModuleMenuInterface::getMenu() |
|
101 | + */ |
|
102 | + public function getMenu() { |
|
103 | + global $WT_TREE, $controller; |
|
104 | 104 | |
105 | - $menu = null; |
|
106 | - if(ModuleManager::getInstance()->isOperational($this->getName())) { |
|
105 | + $menu = null; |
|
106 | + if(ModuleManager::getInstance()->isOperational($this->getName())) { |
|
107 | 107 | |
108 | - $root_url = 'module.php?mod=' . $this->getName() . '&ged=' . $WT_TREE->getNameUrl() . '&'; |
|
109 | - $sosa_stat_menu = new Menu(I18N::translate('Sosa Statistics'), $root_url . 'mod_action=SosaStats', 'menu-maj-sosa-stats'); |
|
108 | + $root_url = 'module.php?mod=' . $this->getName() . '&ged=' . $WT_TREE->getNameUrl() . '&'; |
|
109 | + $sosa_stat_menu = new Menu(I18N::translate('Sosa Statistics'), $root_url . 'mod_action=SosaStats', 'menu-maj-sosa-stats'); |
|
110 | 110 | |
111 | - $menu = clone $sosa_stat_menu; |
|
112 | - $menu->setClass('menu-maj-sosa'); |
|
111 | + $menu = clone $sosa_stat_menu; |
|
112 | + $menu->setClass('menu-maj-sosa'); |
|
113 | 113 | |
114 | - $submenus = array_filter(array( |
|
115 | - new Menu(I18N::translate('Sosa Ancestors'), $root_url . 'mod_action=SosaList', 'menu-maj-sosa-list', array('rel' => 'nofollow')), |
|
116 | - new Menu(I18N::translate('Missing Ancestors'), $root_url . 'mod_action=SosaList@missing', 'menu-maj-sosa-missing', array('rel' => 'nofollow')), |
|
117 | - $sosa_stat_menu |
|
118 | - )); |
|
114 | + $submenus = array_filter(array( |
|
115 | + new Menu(I18N::translate('Sosa Ancestors'), $root_url . 'mod_action=SosaList', 'menu-maj-sosa-list', array('rel' => 'nofollow')), |
|
116 | + new Menu(I18N::translate('Missing Ancestors'), $root_url . 'mod_action=SosaList@missing', 'menu-maj-sosa-missing', array('rel' => 'nofollow')), |
|
117 | + $sosa_stat_menu |
|
118 | + )); |
|
119 | 119 | |
120 | 120 | |
121 | - if (ModuleManager::getInstance()->isOperational(Constants::MODULE_MAJ_GEODISP_NAME) |
|
122 | - && $ga_list = Module::getModuleByName(Constants::MODULE_MAJ_GEODISP_NAME)->getProvider()->getGeoAnalysisList() |
|
123 | - ) |
|
124 | - { |
|
125 | - if(count($ga_list) > 0) { |
|
126 | - $submenus[] = new Menu(I18N::translate('Geographical Dispersion'), 'module.php?mod=' . Constants::MODULE_MAJ_GEODISP_NAME . '&ged=' . $WT_TREE->getNameUrl() . '&mod_action=GeoAnalysis@listAll', 'menu-maj-sosa-geodispersion'); |
|
127 | - } |
|
128 | - } |
|
121 | + if (ModuleManager::getInstance()->isOperational(Constants::MODULE_MAJ_GEODISP_NAME) |
|
122 | + && $ga_list = Module::getModuleByName(Constants::MODULE_MAJ_GEODISP_NAME)->getProvider()->getGeoAnalysisList() |
|
123 | + ) |
|
124 | + { |
|
125 | + if(count($ga_list) > 0) { |
|
126 | + $submenus[] = new Menu(I18N::translate('Geographical Dispersion'), 'module.php?mod=' . Constants::MODULE_MAJ_GEODISP_NAME . '&ged=' . $WT_TREE->getNameUrl() . '&mod_action=GeoAnalysis@listAll', 'menu-maj-sosa-geodispersion'); |
|
127 | + } |
|
128 | + } |
|
129 | 129 | |
130 | - if(Auth::check()) { |
|
131 | - $submenus[] = new Menu( |
|
132 | - I18N::translate('Sosa Configuration'), |
|
133 | - $this->getConfigLink(), |
|
134 | - 'menu-maj-sosa-configuration', |
|
135 | - array('rel' => 'nofollow')); |
|
136 | - } |
|
130 | + if(Auth::check()) { |
|
131 | + $submenus[] = new Menu( |
|
132 | + I18N::translate('Sosa Configuration'), |
|
133 | + $this->getConfigLink(), |
|
134 | + 'menu-maj-sosa-configuration', |
|
135 | + array('rel' => 'nofollow')); |
|
136 | + } |
|
137 | 137 | |
138 | - //-- recompute Sosa submenu |
|
139 | - if (!empty($controller) && $controller instanceof IndividualController |
|
140 | - && Auth::check() && $WT_TREE->getUserPreference(Auth::user(), 'MAJ_SOSA_ROOT_ID') |
|
141 | - ) { |
|
142 | - $controller |
|
143 | - ->addInlineJavascript(' |
|
138 | + //-- recompute Sosa submenu |
|
139 | + if (!empty($controller) && $controller instanceof IndividualController |
|
140 | + && Auth::check() && $WT_TREE->getUserPreference(Auth::user(), 'MAJ_SOSA_ROOT_ID') |
|
141 | + ) { |
|
142 | + $controller |
|
143 | + ->addInlineJavascript(' |
|
144 | 144 | function majComputeSosaFromIndi(){ |
145 | 145 | if($("#computesosadlg").length == 0) { |
146 | 146 | $("body").append("<div id=\"computesosadlg\" title=\"'. I18N::translate('Sosas computation') .'\"><div id=\"sosaloadingarea\"></div></div>"); |
@@ -163,87 +163,87 @@ discard block |
||
163 | 163 | }); |
164 | 164 | }'); |
165 | 165 | |
166 | - $submenus[] = new Menu( |
|
167 | - I18N::translate('Complete Sosas'), |
|
168 | - '#', |
|
169 | - 'menu-maj-sosa-recompute', |
|
170 | - array( |
|
171 | - 'rel' => 'nofollow', |
|
172 | - 'onclick' => 'return majComputeSosaFromIndi();' |
|
173 | - )); |
|
174 | - } |
|
166 | + $submenus[] = new Menu( |
|
167 | + I18N::translate('Complete Sosas'), |
|
168 | + '#', |
|
169 | + 'menu-maj-sosa-recompute', |
|
170 | + array( |
|
171 | + 'rel' => 'nofollow', |
|
172 | + 'onclick' => 'return majComputeSosaFromIndi();' |
|
173 | + )); |
|
174 | + } |
|
175 | 175 | |
176 | - } |
|
176 | + } |
|
177 | 177 | |
178 | - $menu->setSubmenus($submenus); |
|
178 | + $menu->setSubmenus($submenus); |
|
179 | 179 | |
180 | - return $menu; |
|
180 | + return $menu; |
|
181 | 181 | |
182 | - } |
|
182 | + } |
|
183 | 183 | |
184 | - /********** |
|
184 | + /********** |
|
185 | 185 | * Hooks |
186 | 186 | **********/ |
187 | 187 | |
188 | - /** |
|
189 | - * {@inhericDoc} |
|
190 | - * @see \MyArtJaub\Webtrees\Hook\HookSubscriberInterface::getSubscribedHooks() |
|
191 | - */ |
|
192 | - public function getSubscribedHooks() { |
|
193 | - return array( |
|
194 | - 'hExtendIndiHeaderIcons' => 20, |
|
195 | - 'hExtendIndiHeaderRight' => 20, |
|
196 | - 'hRecordNameAppend' => 20 |
|
197 | - ); |
|
198 | - } |
|
199 | - |
|
200 | - /** |
|
201 | - * {@inhericDoc} |
|
202 | - * @see \MyArtJaub\Webtrees\Hook\HookInterfaces\IndividualHeaderExtenderInterface::hExtendIndiHeaderIcons() |
|
203 | - */ |
|
204 | - public function hExtendIndiHeaderIcons(IndividualController $ctrlIndi) { |
|
205 | - if($ctrlIndi){ |
|
206 | - $dindi = new Individual($ctrlIndi->getSignificantIndividual()); |
|
207 | - return FunctionsPrint::formatSosaNumbers($dindi->getSosaNumbers(), 1, 'large'); |
|
208 | - } |
|
209 | - return ''; |
|
210 | - } |
|
211 | - |
|
212 | - /** |
|
213 | - * {@inhericDoc} |
|
214 | - * @see \MyArtJaub\Webtrees\Hook\HookInterfaces\IndividualHeaderExtenderInterface::hExtendIndiHeaderLeft() |
|
215 | - */ |
|
216 | - public function hExtendIndiHeaderLeft(IndividualController $ctrlIndi) { } |
|
217 | - |
|
218 | - /** |
|
219 | - * {@inhericDoc} |
|
220 | - * @see \MyArtJaub\Webtrees\Hook\HookInterfaces\IndividualHeaderExtenderInterface::hExtendIndiHeaderRight() |
|
221 | - */ |
|
222 | - public function hExtendIndiHeaderRight(IndividualController $ctrlIndi) { |
|
223 | - if($ctrlIndi){ |
|
224 | - $dindi = new Individual($ctrlIndi->getSignificantIndividual()); |
|
225 | - return array('indi-header-sosa', FunctionsPrint::formatSosaNumbers($dindi->getSosaNumbers(), 2, 'normal')); |
|
226 | - } |
|
227 | - return ''; |
|
228 | - } |
|
229 | - |
|
230 | - /** |
|
231 | - * {@inhericDoc} |
|
232 | - * @see \MyArtJaub\Webtrees\Hook\HookInterfaces\RecordNameTextExtenderInterface::hRecordNameAppend() |
|
233 | - */ |
|
234 | - public function hRecordNameAppend(GedcomRecord $grec) { |
|
235 | - if($grec instanceof \Fisharebest\Webtrees\Individual){ // Only apply to individuals |
|
236 | - $dindi = new Individual($grec); |
|
237 | - return FunctionsPrint::formatSosaNumbers($dindi->getSosaNumbers(), 1, 'small'); |
|
238 | - } |
|
239 | - return ''; |
|
240 | - } |
|
241 | - |
|
242 | - /** |
|
243 | - * {@inhericDoc} |
|
244 | - * @see \MyArtJaub\Webtrees\Hook\HookInterfaces\RecordNameTextExtenderInterface::hRecordNamePrepend() |
|
245 | - */ |
|
246 | - public function hRecordNamePrepend(GedcomRecord $grec) {} |
|
188 | + /** |
|
189 | + * {@inhericDoc} |
|
190 | + * @see \MyArtJaub\Webtrees\Hook\HookSubscriberInterface::getSubscribedHooks() |
|
191 | + */ |
|
192 | + public function getSubscribedHooks() { |
|
193 | + return array( |
|
194 | + 'hExtendIndiHeaderIcons' => 20, |
|
195 | + 'hExtendIndiHeaderRight' => 20, |
|
196 | + 'hRecordNameAppend' => 20 |
|
197 | + ); |
|
198 | + } |
|
199 | + |
|
200 | + /** |
|
201 | + * {@inhericDoc} |
|
202 | + * @see \MyArtJaub\Webtrees\Hook\HookInterfaces\IndividualHeaderExtenderInterface::hExtendIndiHeaderIcons() |
|
203 | + */ |
|
204 | + public function hExtendIndiHeaderIcons(IndividualController $ctrlIndi) { |
|
205 | + if($ctrlIndi){ |
|
206 | + $dindi = new Individual($ctrlIndi->getSignificantIndividual()); |
|
207 | + return FunctionsPrint::formatSosaNumbers($dindi->getSosaNumbers(), 1, 'large'); |
|
208 | + } |
|
209 | + return ''; |
|
210 | + } |
|
211 | + |
|
212 | + /** |
|
213 | + * {@inhericDoc} |
|
214 | + * @see \MyArtJaub\Webtrees\Hook\HookInterfaces\IndividualHeaderExtenderInterface::hExtendIndiHeaderLeft() |
|
215 | + */ |
|
216 | + public function hExtendIndiHeaderLeft(IndividualController $ctrlIndi) { } |
|
217 | + |
|
218 | + /** |
|
219 | + * {@inhericDoc} |
|
220 | + * @see \MyArtJaub\Webtrees\Hook\HookInterfaces\IndividualHeaderExtenderInterface::hExtendIndiHeaderRight() |
|
221 | + */ |
|
222 | + public function hExtendIndiHeaderRight(IndividualController $ctrlIndi) { |
|
223 | + if($ctrlIndi){ |
|
224 | + $dindi = new Individual($ctrlIndi->getSignificantIndividual()); |
|
225 | + return array('indi-header-sosa', FunctionsPrint::formatSosaNumbers($dindi->getSosaNumbers(), 2, 'normal')); |
|
226 | + } |
|
227 | + return ''; |
|
228 | + } |
|
229 | + |
|
230 | + /** |
|
231 | + * {@inhericDoc} |
|
232 | + * @see \MyArtJaub\Webtrees\Hook\HookInterfaces\RecordNameTextExtenderInterface::hRecordNameAppend() |
|
233 | + */ |
|
234 | + public function hRecordNameAppend(GedcomRecord $grec) { |
|
235 | + if($grec instanceof \Fisharebest\Webtrees\Individual){ // Only apply to individuals |
|
236 | + $dindi = new Individual($grec); |
|
237 | + return FunctionsPrint::formatSosaNumbers($dindi->getSosaNumbers(), 1, 'small'); |
|
238 | + } |
|
239 | + return ''; |
|
240 | + } |
|
241 | + |
|
242 | + /** |
|
243 | + * {@inhericDoc} |
|
244 | + * @see \MyArtJaub\Webtrees\Hook\HookInterfaces\RecordNameTextExtenderInterface::hRecordNamePrepend() |
|
245 | + */ |
|
246 | + public function hRecordNamePrepend(GedcomRecord $grec) {} |
|
247 | 247 | |
248 | 248 | |
249 | 249 |
@@ -19,46 +19,46 @@ |
||
19 | 19 | * Hooks Module. |
20 | 20 | */ |
21 | 21 | class HooksModule extends AbstractModule implements ModuleConfigInterface { |
22 | - // How to update the database schema for this module |
|
23 | - const SCHEMA_TARGET_VERSION = 1; |
|
24 | - const SCHEMA_SETTING_NAME = 'MAJ_HOOKS_SCHEMA_VERSION'; |
|
25 | - const SCHEMA_MIGRATION_PREFIX = '\MyArtJaub\Webtrees\Module\Hooks\Schema'; |
|
22 | + // How to update the database schema for this module |
|
23 | + const SCHEMA_TARGET_VERSION = 1; |
|
24 | + const SCHEMA_SETTING_NAME = 'MAJ_HOOKS_SCHEMA_VERSION'; |
|
25 | + const SCHEMA_MIGRATION_PREFIX = '\MyArtJaub\Webtrees\Module\Hooks\Schema'; |
|
26 | 26 | |
27 | - /** @var string For custom modules - link for support, upgrades, etc. */ |
|
28 | - const CUSTOM_WEBSITE = 'https://github.com/jon48/webtrees-lib'; |
|
27 | + /** @var string For custom modules - link for support, upgrades, etc. */ |
|
28 | + const CUSTOM_WEBSITE = 'https://github.com/jon48/webtrees-lib'; |
|
29 | 29 | |
30 | - /** |
|
31 | - * {@inhericDoc} |
|
32 | - */ |
|
33 | - public function getTitle() { |
|
34 | - return /* I18N: Name of the “Hooks” module */ I18N::translate('Hooks'); |
|
35 | - } |
|
30 | + /** |
|
31 | + * {@inhericDoc} |
|
32 | + */ |
|
33 | + public function getTitle() { |
|
34 | + return /* I18N: Name of the “Hooks” module */ I18N::translate('Hooks'); |
|
35 | + } |
|
36 | 36 | |
37 | - /** |
|
38 | - * {@inhericDoc} |
|
39 | - */ |
|
40 | - public function getDescription() { |
|
41 | - return /* I18N: Description of the “Hooks” module */ I18N::translate('Implements hooks management.'); |
|
42 | - } |
|
37 | + /** |
|
38 | + * {@inhericDoc} |
|
39 | + */ |
|
40 | + public function getDescription() { |
|
41 | + return /* I18N: Description of the “Hooks” module */ I18N::translate('Implements hooks management.'); |
|
42 | + } |
|
43 | 43 | |
44 | - /** |
|
45 | - * {@inhericDoc} |
|
46 | - */ |
|
47 | - public function modAction($mod_action) { |
|
48 | - Database::updateSchema(self::SCHEMA_MIGRATION_PREFIX, self::SCHEMA_SETTING_NAME, self::SCHEMA_TARGET_VERSION); |
|
44 | + /** |
|
45 | + * {@inhericDoc} |
|
46 | + */ |
|
47 | + public function modAction($mod_action) { |
|
48 | + Database::updateSchema(self::SCHEMA_MIGRATION_PREFIX, self::SCHEMA_SETTING_NAME, self::SCHEMA_TARGET_VERSION); |
|
49 | 49 | |
50 | - \MyArtJaub\Webtrees\Mvc\Dispatcher::getInstance()->handle($this, $mod_action); |
|
51 | - } |
|
50 | + \MyArtJaub\Webtrees\Mvc\Dispatcher::getInstance()->handle($this, $mod_action); |
|
51 | + } |
|
52 | 52 | |
53 | - /** |
|
54 | - * {@inhericDoc} |
|
55 | - * @see \Fisharebest\Webtrees\Module\ModuleConfigInterface::getConfigLink() |
|
56 | - */ |
|
57 | - public function getConfigLink() { |
|
58 | - Database::updateSchema(self::SCHEMA_MIGRATION_PREFIX, self::SCHEMA_SETTING_NAME, self::SCHEMA_TARGET_VERSION); |
|
53 | + /** |
|
54 | + * {@inhericDoc} |
|
55 | + * @see \Fisharebest\Webtrees\Module\ModuleConfigInterface::getConfigLink() |
|
56 | + */ |
|
57 | + public function getConfigLink() { |
|
58 | + Database::updateSchema(self::SCHEMA_MIGRATION_PREFIX, self::SCHEMA_SETTING_NAME, self::SCHEMA_TARGET_VERSION); |
|
59 | 59 | |
60 | - return 'module.php?mod=' . $this->getName() . '&mod_action=AdminConfig'; |
|
61 | - } |
|
60 | + return 'module.php?mod=' . $this->getName() . '&mod_action=AdminConfig'; |
|
61 | + } |
|
62 | 62 | |
63 | 63 | |
64 | 64 | } |
@@ -28,77 +28,77 @@ |
||
28 | 28 | */ |
29 | 29 | class AdminConfigController extends MvcController |
30 | 30 | { |
31 | - /** |
|
32 | - * Manage updates sent from the AdminConfig@index form. |
|
33 | - */ |
|
34 | - protected function update() { |
|
31 | + /** |
|
32 | + * Manage updates sent from the AdminConfig@index form. |
|
33 | + */ |
|
34 | + protected function update() { |
|
35 | 35 | |
36 | - if(Auth::isAdmin()){ |
|
36 | + if(Auth::isAdmin()){ |
|
37 | 37 | |
38 | - $this->module->setSetting('MAJ_SHOW_CERT', Filter::post('MAJ_SHOW_CERT')); |
|
39 | - $this->module->setSetting('MAJ_SHOW_NO_WATERMARK', Filter::post('MAJ_SHOW_NO_WATERMARK')); |
|
38 | + $this->module->setSetting('MAJ_SHOW_CERT', Filter::post('MAJ_SHOW_CERT')); |
|
39 | + $this->module->setSetting('MAJ_SHOW_NO_WATERMARK', Filter::post('MAJ_SHOW_NO_WATERMARK')); |
|
40 | 40 | |
41 | - if($MAJ_WM_DEFAULT = Filter::post('MAJ_WM_DEFAULT')) { |
|
42 | - $this->module->setSetting('MAJ_WM_DEFAULT', $MAJ_WM_DEFAULT); |
|
43 | - } |
|
41 | + if($MAJ_WM_DEFAULT = Filter::post('MAJ_WM_DEFAULT')) { |
|
42 | + $this->module->setSetting('MAJ_WM_DEFAULT', $MAJ_WM_DEFAULT); |
|
43 | + } |
|
44 | 44 | |
45 | - if($MAJ_WM_FONT_MAXSIZE = Filter::postInteger('MAJ_WM_FONT_MAXSIZE')) { |
|
46 | - $this->module->setSetting('MAJ_WM_FONT_MAXSIZE', $MAJ_WM_FONT_MAXSIZE); |
|
47 | - } |
|
45 | + if($MAJ_WM_FONT_MAXSIZE = Filter::postInteger('MAJ_WM_FONT_MAXSIZE')) { |
|
46 | + $this->module->setSetting('MAJ_WM_FONT_MAXSIZE', $MAJ_WM_FONT_MAXSIZE); |
|
47 | + } |
|
48 | 48 | |
49 | - // Only accept valid color for MAJ_WM_FONT_COLOR |
|
50 | - $MAJ_WM_FONT_COLOR = Filter::post('MAJ_WM_FONT_COLOR', '#([a-fA-F0-9]{3}){1,2}'); |
|
51 | - if($MAJ_WM_FONT_COLOR) { |
|
52 | - $this->module->setSetting('MAJ_WM_FONT_COLOR', $MAJ_WM_FONT_COLOR); |
|
53 | - } |
|
49 | + // Only accept valid color for MAJ_WM_FONT_COLOR |
|
50 | + $MAJ_WM_FONT_COLOR = Filter::post('MAJ_WM_FONT_COLOR', '#([a-fA-F0-9]{3}){1,2}'); |
|
51 | + if($MAJ_WM_FONT_COLOR) { |
|
52 | + $this->module->setSetting('MAJ_WM_FONT_COLOR', $MAJ_WM_FONT_COLOR); |
|
53 | + } |
|
54 | 54 | |
55 | - // Only accept valid folders for MAJ_CERT_ROOTDIR |
|
56 | - $MAJ_CERT_ROOTDIR = preg_replace('/[\/\\\\]+/', '/', Filter::post('MAJ_CERT_ROOTDIR') . '/'); |
|
57 | - if (substr($MAJ_CERT_ROOTDIR, 0, 1) === '/') { |
|
58 | - $MAJ_CERT_ROOTDIR = substr($MAJ_CERT_ROOTDIR, 1); |
|
59 | - } |
|
55 | + // Only accept valid folders for MAJ_CERT_ROOTDIR |
|
56 | + $MAJ_CERT_ROOTDIR = preg_replace('/[\/\\\\]+/', '/', Filter::post('MAJ_CERT_ROOTDIR') . '/'); |
|
57 | + if (substr($MAJ_CERT_ROOTDIR, 0, 1) === '/') { |
|
58 | + $MAJ_CERT_ROOTDIR = substr($MAJ_CERT_ROOTDIR, 1); |
|
59 | + } |
|
60 | 60 | |
61 | - if ($MAJ_CERT_ROOTDIR) { |
|
62 | - if (is_dir(WT_DATA_DIR . $MAJ_CERT_ROOTDIR)) { |
|
63 | - $this->module->setSetting('MAJ_CERT_ROOTDIR', $MAJ_CERT_ROOTDIR); |
|
64 | - } elseif (File::mkdir(WT_DATA_DIR . $MAJ_CERT_ROOTDIR)) { |
|
65 | - $this->module->setSetting('MAJ_CERT_ROOTDIR', $MAJ_CERT_ROOTDIR); |
|
66 | - FlashMessages::addMessage(I18N::translate('The folder %s has been created.', Html::filename(WT_DATA_DIR . $MAJ_CERT_ROOTDIR)), 'info'); |
|
67 | - } else { |
|
68 | - FlashMessages::addMessage(I18N::translate('The folder %s does not exist, and it could not be created.', Html::filename(WT_DATA_DIR . $MAJ_CERT_ROOTDIR)), 'danger'); |
|
69 | - } |
|
70 | - } |
|
61 | + if ($MAJ_CERT_ROOTDIR) { |
|
62 | + if (is_dir(WT_DATA_DIR . $MAJ_CERT_ROOTDIR)) { |
|
63 | + $this->module->setSetting('MAJ_CERT_ROOTDIR', $MAJ_CERT_ROOTDIR); |
|
64 | + } elseif (File::mkdir(WT_DATA_DIR . $MAJ_CERT_ROOTDIR)) { |
|
65 | + $this->module->setSetting('MAJ_CERT_ROOTDIR', $MAJ_CERT_ROOTDIR); |
|
66 | + FlashMessages::addMessage(I18N::translate('The folder %s has been created.', Html::filename(WT_DATA_DIR . $MAJ_CERT_ROOTDIR)), 'info'); |
|
67 | + } else { |
|
68 | + FlashMessages::addMessage(I18N::translate('The folder %s does not exist, and it could not be created.', Html::filename(WT_DATA_DIR . $MAJ_CERT_ROOTDIR)), 'danger'); |
|
69 | + } |
|
70 | + } |
|
71 | 71 | |
72 | - FlashMessages::addMessage(I18N::translate('The preferences for the module “%s” have been updated.', $this->module->getTitle()), 'success'); |
|
72 | + FlashMessages::addMessage(I18N::translate('The preferences for the module “%s” have been updated.', $this->module->getTitle()), 'success'); |
|
73 | 73 | |
74 | - return; |
|
75 | - } |
|
76 | - } |
|
74 | + return; |
|
75 | + } |
|
76 | + } |
|
77 | 77 | |
78 | - /** |
|
79 | - * Pages |
|
80 | - */ |
|
78 | + /** |
|
79 | + * Pages |
|
80 | + */ |
|
81 | 81 | |
82 | - /** |
|
83 | - * AdminConfig@index |
|
84 | - */ |
|
85 | - public function index() { |
|
86 | - global $WT_TREE; |
|
82 | + /** |
|
83 | + * AdminConfig@index |
|
84 | + */ |
|
85 | + public function index() { |
|
86 | + global $WT_TREE; |
|
87 | 87 | |
88 | - $action = Filter::post('action'); |
|
89 | - if($action == 'update' && Filter::checkCsrf()) $this->update(); |
|
88 | + $action = Filter::post('action'); |
|
89 | + if($action == 'update' && Filter::checkCsrf()) $this->update(); |
|
90 | 90 | |
91 | - Theme::theme(new AdministrationTheme)->init($WT_TREE); |
|
92 | - $ctrl = new PageController(); |
|
93 | - $ctrl |
|
94 | - ->restrictAccess(Auth::isAdmin()) |
|
95 | - ->setPageTitle($this->module->getTitle()); |
|
91 | + Theme::theme(new AdministrationTheme)->init($WT_TREE); |
|
92 | + $ctrl = new PageController(); |
|
93 | + $ctrl |
|
94 | + ->restrictAccess(Auth::isAdmin()) |
|
95 | + ->setPageTitle($this->module->getTitle()); |
|
96 | 96 | |
97 | - $view_bag = new ViewBag(); |
|
98 | - $view_bag->set('title', $ctrl->getPageTitle()); |
|
99 | - $view_bag->set('module', $this->module); |
|
97 | + $view_bag = new ViewBag(); |
|
98 | + $view_bag->set('title', $ctrl->getPageTitle()); |
|
99 | + $view_bag->set('module', $this->module); |
|
100 | 100 | |
101 | - ViewFactory::make('AdminConfig', $this, $ctrl, $view_bag)->render(); |
|
102 | - } |
|
101 | + ViewFactory::make('AdminConfig', $this, $ctrl, $view_bag)->render(); |
|
102 | + } |
|
103 | 103 | |
104 | 104 | } |
105 | 105 | \ No newline at end of file |
@@ -20,111 +20,111 @@ |
||
20 | 20 | */ |
21 | 21 | class CertificateFileProvider implements CertificateProviderInterface { |
22 | 22 | |
23 | - /** |
|
24 | - * Relative path to the root certificate folder |
|
25 | - * @var string $root_path |
|
26 | - */ |
|
27 | - protected $root_path; |
|
23 | + /** |
|
24 | + * Relative path to the root certificate folder |
|
25 | + * @var string $root_path |
|
26 | + */ |
|
27 | + protected $root_path; |
|
28 | 28 | |
29 | - /** |
|
30 | - * Reference tree |
|
31 | - * @var Tree $tree |
|
32 | - */ |
|
33 | - protected $tree; |
|
29 | + /** |
|
30 | + * Reference tree |
|
31 | + * @var Tree $tree |
|
32 | + */ |
|
33 | + protected $tree; |
|
34 | 34 | |
35 | - /** |
|
36 | - * Cached list of certificates' cities. |
|
37 | - * @var (null|array) $cities_list |
|
38 | - */ |
|
39 | - protected $cities_list = null; |
|
35 | + /** |
|
36 | + * Cached list of certificates' cities. |
|
37 | + * @var (null|array) $cities_list |
|
38 | + */ |
|
39 | + protected $cities_list = null; |
|
40 | 40 | |
41 | - /** |
|
42 | - * Constructor for the File Provider |
|
43 | - * @param string $root_path |
|
44 | - * @param Tree $tree |
|
45 | - */ |
|
46 | - public function __construct($root_path, Tree $tree) { |
|
47 | - $this->root_path = $root_path; |
|
48 | - $this->tree = $tree; |
|
49 | - } |
|
41 | + /** |
|
42 | + * Constructor for the File Provider |
|
43 | + * @param string $root_path |
|
44 | + * @param Tree $tree |
|
45 | + */ |
|
46 | + public function __construct($root_path, Tree $tree) { |
|
47 | + $this->root_path = $root_path; |
|
48 | + $this->tree = $tree; |
|
49 | + } |
|
50 | 50 | |
51 | - /** |
|
52 | - * {@inhericDoc} |
|
53 | - * @see \MyArtJaub\Webtrees\Module\Certificates\Model\CertificateProviderInterface::getRealCertificatesDirectory() |
|
54 | - */ |
|
55 | - public function getRealCertificatesDirectory(){ |
|
56 | - return WT_DATA_DIR . $this->root_path; |
|
57 | - } |
|
51 | + /** |
|
52 | + * {@inhericDoc} |
|
53 | + * @see \MyArtJaub\Webtrees\Module\Certificates\Model\CertificateProviderInterface::getRealCertificatesDirectory() |
|
54 | + */ |
|
55 | + public function getRealCertificatesDirectory(){ |
|
56 | + return WT_DATA_DIR . $this->root_path; |
|
57 | + } |
|
58 | 58 | |
59 | - /** |
|
60 | - * {@inhericDoc} |
|
61 | - * @see \MyArtJaub\Webtrees\Module\Certificates\Model\CertificateProviderInterface::getCitiesList() |
|
62 | - */ |
|
63 | - public function getCitiesList(){ |
|
64 | - if(!isset($this->cities_list) || is_null($this->cities_list)){ |
|
65 | - $certdir = $this->getRealCertificatesDirectory(); |
|
66 | - $this->cities_list = array(); |
|
59 | + /** |
|
60 | + * {@inhericDoc} |
|
61 | + * @see \MyArtJaub\Webtrees\Module\Certificates\Model\CertificateProviderInterface::getCitiesList() |
|
62 | + */ |
|
63 | + public function getCitiesList(){ |
|
64 | + if(!isset($this->cities_list) || is_null($this->cities_list)){ |
|
65 | + $certdir = $this->getRealCertificatesDirectory(); |
|
66 | + $this->cities_list = array(); |
|
67 | 67 | |
68 | - $dir = opendir($certdir); |
|
68 | + $dir = opendir($certdir); |
|
69 | 69 | |
70 | - while($entry = readdir($dir)){ |
|
71 | - if($entry != '.' && $entry != '..' && is_dir($certdir.$entry)){ |
|
72 | - $this->cities_list[]= Functions::encodeFileSystemToUtf8($entry); |
|
73 | - } |
|
74 | - } |
|
75 | - sort($this->cities_list); |
|
76 | - } |
|
77 | - return $this->cities_list; |
|
78 | - } |
|
70 | + while($entry = readdir($dir)){ |
|
71 | + if($entry != '.' && $entry != '..' && is_dir($certdir.$entry)){ |
|
72 | + $this->cities_list[]= Functions::encodeFileSystemToUtf8($entry); |
|
73 | + } |
|
74 | + } |
|
75 | + sort($this->cities_list); |
|
76 | + } |
|
77 | + return $this->cities_list; |
|
78 | + } |
|
79 | 79 | |
80 | - /** |
|
81 | - * {@inhericDoc} |
|
82 | - * @see \MyArtJaub\Webtrees\Module\Certificates\Model\CertificateProviderInterface::getCertificatesList() |
|
83 | - */ |
|
84 | - public function getCertificatesList($selCity){ |
|
80 | + /** |
|
81 | + * {@inhericDoc} |
|
82 | + * @see \MyArtJaub\Webtrees\Module\Certificates\Model\CertificateProviderInterface::getCertificatesList() |
|
83 | + */ |
|
84 | + public function getCertificatesList($selCity){ |
|
85 | 85 | |
86 | - $selCity = Functions::encodeUtf8ToFileSystem($selCity); |
|
86 | + $selCity = Functions::encodeUtf8ToFileSystem($selCity); |
|
87 | 87 | |
88 | - $certdir = $this->getRealCertificatesDirectory(); |
|
89 | - $tabCertif= array(); |
|
88 | + $certdir = $this->getRealCertificatesDirectory(); |
|
89 | + $tabCertif= array(); |
|
90 | 90 | |
91 | - if(is_dir($certdir.$selCity)){ |
|
92 | - $dir=opendir($certdir.$selCity); |
|
93 | - while($entry = readdir($dir)){ |
|
94 | - if($entry!='.' && $entry!='..' && !is_dir($certdir.$entry.'/')){ |
|
95 | - $path = Functions::encodeFileSystemToUtf8($selCity.'/'.$entry); |
|
96 | - $certificate = new Certificate($path, $this->tree, $this); |
|
97 | - if(Functions::isImageTypeSupported($certificate->extension())){ |
|
98 | - $tabCertif[] = $certificate; |
|
99 | - } |
|
100 | - } |
|
101 | - } |
|
102 | - } |
|
103 | - return $tabCertif; |
|
104 | - } |
|
91 | + if(is_dir($certdir.$selCity)){ |
|
92 | + $dir=opendir($certdir.$selCity); |
|
93 | + while($entry = readdir($dir)){ |
|
94 | + if($entry!='.' && $entry!='..' && !is_dir($certdir.$entry.'/')){ |
|
95 | + $path = Functions::encodeFileSystemToUtf8($selCity.'/'.$entry); |
|
96 | + $certificate = new Certificate($path, $this->tree, $this); |
|
97 | + if(Functions::isImageTypeSupported($certificate->extension())){ |
|
98 | + $tabCertif[] = $certificate; |
|
99 | + } |
|
100 | + } |
|
101 | + } |
|
102 | + } |
|
103 | + return $tabCertif; |
|
104 | + } |
|
105 | 105 | |
106 | - /** |
|
107 | - * {@inhericDoc} |
|
108 | - * @see \MyArtJaub\Webtrees\Module\Certificates\Model\CertificateProviderInterface::getCertificatesListBeginWith() |
|
109 | - */ |
|
110 | - public function getCertificatesListBeginWith($city, $contains, $limit= 9999){ |
|
111 | - $tabFiles= array(); |
|
112 | - $dirPath= $this->getRealCertificatesDirectory() . Functions::encodeUtf8ToFileSystem($city).'/'; |
|
113 | - $contains = utf8_decode($contains); |
|
114 | - $nbCert = 0; |
|
106 | + /** |
|
107 | + * {@inhericDoc} |
|
108 | + * @see \MyArtJaub\Webtrees\Module\Certificates\Model\CertificateProviderInterface::getCertificatesListBeginWith() |
|
109 | + */ |
|
110 | + public function getCertificatesListBeginWith($city, $contains, $limit= 9999){ |
|
111 | + $tabFiles= array(); |
|
112 | + $dirPath= $this->getRealCertificatesDirectory() . Functions::encodeUtf8ToFileSystem($city).'/'; |
|
113 | + $contains = utf8_decode($contains); |
|
114 | + $nbCert = 0; |
|
115 | 115 | |
116 | - if(is_dir($dirPath)){ |
|
117 | - $dir=opendir($dirPath); |
|
118 | - while(($entry = readdir($dir)) && $nbCert < $limit){ |
|
119 | - if($entry!='.' && $entry!='..' && $entry!='Thumbs.db' &&!is_dir($dirPath.$entry.'/') && stripos($entry, $contains)!== false){ |
|
120 | - $tabFiles[]= Functions::encodeFileSystemToUtf8($entry); |
|
121 | - $nbCert++; |
|
122 | - } |
|
123 | - } |
|
124 | - } |
|
125 | - sort($tabFiles); |
|
126 | - return $tabFiles; |
|
127 | - } |
|
116 | + if(is_dir($dirPath)){ |
|
117 | + $dir=opendir($dirPath); |
|
118 | + while(($entry = readdir($dir)) && $nbCert < $limit){ |
|
119 | + if($entry!='.' && $entry!='..' && $entry!='Thumbs.db' &&!is_dir($dirPath.$entry.'/') && stripos($entry, $contains)!== false){ |
|
120 | + $tabFiles[]= Functions::encodeFileSystemToUtf8($entry); |
|
121 | + $nbCert++; |
|
122 | + } |
|
123 | + } |
|
124 | + } |
|
125 | + sort($tabFiles); |
|
126 | + return $tabFiles; |
|
127 | + } |
|
128 | 128 | |
129 | 129 | } |
130 | 130 |
@@ -52,24 +52,24 @@ discard block |
||
52 | 52 | * {@inhericDoc} |
53 | 53 | * @see \MyArtJaub\Webtrees\Module\Certificates\Model\CertificateProviderInterface::getRealCertificatesDirectory() |
54 | 54 | */ |
55 | - public function getRealCertificatesDirectory(){ |
|
56 | - return WT_DATA_DIR . $this->root_path; |
|
55 | + public function getRealCertificatesDirectory() { |
|
56 | + return WT_DATA_DIR.$this->root_path; |
|
57 | 57 | } |
58 | 58 | |
59 | 59 | /** |
60 | 60 | * {@inhericDoc} |
61 | 61 | * @see \MyArtJaub\Webtrees\Module\Certificates\Model\CertificateProviderInterface::getCitiesList() |
62 | 62 | */ |
63 | - public function getCitiesList(){ |
|
64 | - if(!isset($this->cities_list) || is_null($this->cities_list)){ |
|
63 | + public function getCitiesList() { |
|
64 | + if (!isset($this->cities_list) || is_null($this->cities_list)) { |
|
65 | 65 | $certdir = $this->getRealCertificatesDirectory(); |
66 | 66 | $this->cities_list = array(); |
67 | 67 | |
68 | 68 | $dir = opendir($certdir); |
69 | 69 | |
70 | - while($entry = readdir($dir)){ |
|
71 | - if($entry != '.' && $entry != '..' && is_dir($certdir.$entry)){ |
|
72 | - $this->cities_list[]= Functions::encodeFileSystemToUtf8($entry); |
|
70 | + while ($entry = readdir($dir)) { |
|
71 | + if ($entry != '.' && $entry != '..' && is_dir($certdir.$entry)) { |
|
72 | + $this->cities_list[] = Functions::encodeFileSystemToUtf8($entry); |
|
73 | 73 | } |
74 | 74 | } |
75 | 75 | sort($this->cities_list); |
@@ -81,21 +81,21 @@ discard block |
||
81 | 81 | * {@inhericDoc} |
82 | 82 | * @see \MyArtJaub\Webtrees\Module\Certificates\Model\CertificateProviderInterface::getCertificatesList() |
83 | 83 | */ |
84 | - public function getCertificatesList($selCity){ |
|
84 | + public function getCertificatesList($selCity) { |
|
85 | 85 | |
86 | 86 | $selCity = Functions::encodeUtf8ToFileSystem($selCity); |
87 | 87 | |
88 | 88 | $certdir = $this->getRealCertificatesDirectory(); |
89 | - $tabCertif= array(); |
|
89 | + $tabCertif = array(); |
|
90 | 90 | |
91 | - if(is_dir($certdir.$selCity)){ |
|
92 | - $dir=opendir($certdir.$selCity); |
|
93 | - while($entry = readdir($dir)){ |
|
94 | - if($entry!='.' && $entry!='..' && !is_dir($certdir.$entry.'/')){ |
|
91 | + if (is_dir($certdir.$selCity)) { |
|
92 | + $dir = opendir($certdir.$selCity); |
|
93 | + while ($entry = readdir($dir)) { |
|
94 | + if ($entry != '.' && $entry != '..' && !is_dir($certdir.$entry.'/')) { |
|
95 | 95 | $path = Functions::encodeFileSystemToUtf8($selCity.'/'.$entry); |
96 | 96 | $certificate = new Certificate($path, $this->tree, $this); |
97 | - if(Functions::isImageTypeSupported($certificate->extension())){ |
|
98 | - $tabCertif[] = $certificate; |
|
97 | + if (Functions::isImageTypeSupported($certificate->extension())) { |
|
98 | + $tabCertif[] = $certificate; |
|
99 | 99 | } |
100 | 100 | } |
101 | 101 | } |
@@ -107,17 +107,17 @@ discard block |
||
107 | 107 | * {@inhericDoc} |
108 | 108 | * @see \MyArtJaub\Webtrees\Module\Certificates\Model\CertificateProviderInterface::getCertificatesListBeginWith() |
109 | 109 | */ |
110 | - public function getCertificatesListBeginWith($city, $contains, $limit= 9999){ |
|
111 | - $tabFiles= array(); |
|
112 | - $dirPath= $this->getRealCertificatesDirectory() . Functions::encodeUtf8ToFileSystem($city).'/'; |
|
110 | + public function getCertificatesListBeginWith($city, $contains, $limit = 9999) { |
|
111 | + $tabFiles = array(); |
|
112 | + $dirPath = $this->getRealCertificatesDirectory().Functions::encodeUtf8ToFileSystem($city).'/'; |
|
113 | 113 | $contains = utf8_decode($contains); |
114 | 114 | $nbCert = 0; |
115 | 115 | |
116 | - if(is_dir($dirPath)){ |
|
117 | - $dir=opendir($dirPath); |
|
118 | - while(($entry = readdir($dir)) && $nbCert < $limit){ |
|
119 | - if($entry!='.' && $entry!='..' && $entry!='Thumbs.db' &&!is_dir($dirPath.$entry.'/') && stripos($entry, $contains)!== false){ |
|
120 | - $tabFiles[]= Functions::encodeFileSystemToUtf8($entry); |
|
116 | + if (is_dir($dirPath)) { |
|
117 | + $dir = opendir($dirPath); |
|
118 | + while (($entry = readdir($dir)) && $nbCert < $limit) { |
|
119 | + if ($entry != '.' && $entry != '..' && $entry != 'Thumbs.db' && !is_dir($dirPath.$entry.'/') && stripos($entry, $contains) !== false) { |
|
120 | + $tabFiles[] = Functions::encodeFileSystemToUtf8($entry); |
|
121 | 121 | $nbCert++; |
122 | 122 | } |
123 | 123 | } |
@@ -18,40 +18,40 @@ |
||
18 | 18 | * Patronymic Lineage Module. |
19 | 19 | */ |
20 | 20 | class PatronymicLineageModule extends fw\Module\AbstractModule |
21 | - implements ModuleMenuItemInterface |
|
21 | + implements ModuleMenuItemInterface |
|
22 | 22 | { |
23 | - /** @var string For custom modules - link for support, upgrades, etc. */ |
|
24 | - const CUSTOM_WEBSITE = 'https://github.com/jon48/webtrees-lib'; |
|
23 | + /** @var string For custom modules - link for support, upgrades, etc. */ |
|
24 | + const CUSTOM_WEBSITE = 'https://github.com/jon48/webtrees-lib'; |
|
25 | 25 | |
26 | - /** |
|
27 | - * {@inhericDoc} |
|
28 | - */ |
|
29 | - public function getTitle() { |
|
30 | - return /* I18N: Name of the “Patronymic lineage” module */ I18N::translate('Patronymic Lineages'); |
|
31 | - } |
|
26 | + /** |
|
27 | + * {@inhericDoc} |
|
28 | + */ |
|
29 | + public function getTitle() { |
|
30 | + return /* I18N: Name of the “Patronymic lineage” module */ I18N::translate('Patronymic Lineages'); |
|
31 | + } |
|
32 | 32 | |
33 | - /** |
|
34 | - * {@inhericDoc} |
|
35 | - */ |
|
36 | - public function getDescription() { |
|
37 | - return /* I18N: Description of the “Patronymic lineage” module */ I18N::translate('Display lineages of people holding the same surname.'); |
|
38 | - } |
|
33 | + /** |
|
34 | + * {@inhericDoc} |
|
35 | + */ |
|
36 | + public function getDescription() { |
|
37 | + return /* I18N: Description of the “Patronymic lineage” module */ I18N::translate('Display lineages of people holding the same surname.'); |
|
38 | + } |
|
39 | 39 | |
40 | - /** |
|
41 | - * {@inhericDoc} |
|
42 | - */ |
|
43 | - public function modAction($mod_action) { |
|
44 | - \MyArtJaub\Webtrees\Mvc\Dispatcher::getInstance()->handle($this, $mod_action); |
|
45 | - } |
|
46 | - /** |
|
47 | - * {@inhericDoc} |
|
48 | - * @see \MyArtJaub\Webtrees\Module\ModuleMenuItemInterface::getMenu() |
|
49 | - */ |
|
50 | - public function getMenu(fw\Tree $tree, $reference) { |
|
51 | - $tree_url = $tree ? $tree->getNameUrl() : ''; |
|
52 | - $surname = $reference && is_string($reference) ? $reference : ''; |
|
53 | - return new fw\Menu($this->getTitle(), 'module.php?mod=' . $this->getName() . '&mod_action=Lineage&ged=' . $tree_url . '&surname=' . $surname , 'menu-maj-list-lineage', array('rel' => 'nofollow')); |
|
54 | - } |
|
40 | + /** |
|
41 | + * {@inhericDoc} |
|
42 | + */ |
|
43 | + public function modAction($mod_action) { |
|
44 | + \MyArtJaub\Webtrees\Mvc\Dispatcher::getInstance()->handle($this, $mod_action); |
|
45 | + } |
|
46 | + /** |
|
47 | + * {@inhericDoc} |
|
48 | + * @see \MyArtJaub\Webtrees\Module\ModuleMenuItemInterface::getMenu() |
|
49 | + */ |
|
50 | + public function getMenu(fw\Tree $tree, $reference) { |
|
51 | + $tree_url = $tree ? $tree->getNameUrl() : ''; |
|
52 | + $surname = $reference && is_string($reference) ? $reference : ''; |
|
53 | + return new fw\Menu($this->getTitle(), 'module.php?mod=' . $this->getName() . '&mod_action=Lineage&ged=' . $tree_url . '&surname=' . $surname , 'menu-maj-list-lineage', array('rel' => 'nofollow')); |
|
54 | + } |
|
55 | 55 | |
56 | 56 | } |
57 | 57 | |
58 | 58 | \ No newline at end of file |
@@ -30,49 +30,49 @@ discard block |
||
30 | 30 | class MiscExtensionsModule extends AbstractModule |
31 | 31 | implements HookSubscriberInterface, IndividualHeaderExtenderInterface, PageHeaderExtenderInterface, PageFooterExtenderInterface, ModuleConfigInterface |
32 | 32 | { |
33 | - /** @var string For custom modules - link for support, upgrades, etc. */ |
|
34 | - const CUSTOM_WEBSITE = 'https://github.com/jon48/webtrees-lib'; |
|
33 | + /** @var string For custom modules - link for support, upgrades, etc. */ |
|
34 | + const CUSTOM_WEBSITE = 'https://github.com/jon48/webtrees-lib'; |
|
35 | 35 | |
36 | - /** |
|
37 | - * {@inheritDoc} |
|
38 | - * @see \Fisharebest\Webtrees\Module\AbstractModule::getTitle() |
|
39 | - */ |
|
40 | - public function getTitle() { |
|
41 | - return I18N::translate('Miscellaneous extensions'); |
|
42 | - } |
|
36 | + /** |
|
37 | + * {@inheritDoc} |
|
38 | + * @see \Fisharebest\Webtrees\Module\AbstractModule::getTitle() |
|
39 | + */ |
|
40 | + public function getTitle() { |
|
41 | + return I18N::translate('Miscellaneous extensions'); |
|
42 | + } |
|
43 | 43 | |
44 | 44 | /** |
45 | 45 | * {@inheritDoc} |
46 | 46 | * @see \Fisharebest\Webtrees\Module\AbstractModule::getDescription() |
47 | 47 | */ |
48 | - public function getDescription() { |
|
49 | - return I18N::translate('Miscellaneous extensions for <strong>webtrees</strong>.'); |
|
50 | - } |
|
48 | + public function getDescription() { |
|
49 | + return I18N::translate('Miscellaneous extensions for <strong>webtrees</strong>.'); |
|
50 | + } |
|
51 | 51 | |
52 | - /** |
|
53 | - * {@inhericDoc} |
|
54 | - */ |
|
55 | - public function modAction($mod_action) { |
|
56 | - \MyArtJaub\Webtrees\Mvc\Dispatcher::getInstance()->handle($this, $mod_action); |
|
57 | - } |
|
52 | + /** |
|
53 | + * {@inhericDoc} |
|
54 | + */ |
|
55 | + public function modAction($mod_action) { |
|
56 | + \MyArtJaub\Webtrees\Mvc\Dispatcher::getInstance()->handle($this, $mod_action); |
|
57 | + } |
|
58 | 58 | |
59 | - /** |
|
60 | - * {@inhericDoc} |
|
61 | - * @see \Fisharebest\Webtrees\Module\ModuleConfigInterface::getConfigLink() |
|
62 | - */ |
|
63 | - public function getConfigLink() { |
|
64 | - return 'module.php?mod=' . $this->getName() . '&mod_action=AdminConfig'; |
|
65 | - } |
|
59 | + /** |
|
60 | + * {@inhericDoc} |
|
61 | + * @see \Fisharebest\Webtrees\Module\ModuleConfigInterface::getConfigLink() |
|
62 | + */ |
|
63 | + public function getConfigLink() { |
|
64 | + return 'module.php?mod=' . $this->getName() . '&mod_action=AdminConfig'; |
|
65 | + } |
|
66 | 66 | |
67 | - /** |
|
68 | - * {@inheritDoc} |
|
69 | - * @see \MyArtJaub\Webtrees\Hook\HookSubscriberInterface::getSubscribedHooks() |
|
70 | - */ |
|
67 | + /** |
|
68 | + * {@inheritDoc} |
|
69 | + * @see \MyArtJaub\Webtrees\Hook\HookSubscriberInterface::getSubscribedHooks() |
|
70 | + */ |
|
71 | 71 | public function getSubscribedHooks() { |
72 | 72 | return array( |
73 | - 'hExtendIndiHeaderLeft' => 20, |
|
74 | - 'hPrintHeader' => 20, |
|
75 | - 'hPrintFooter' => 20 |
|
73 | + 'hExtendIndiHeaderLeft' => 20, |
|
74 | + 'hPrintHeader' => 20, |
|
75 | + 'hPrintFooter' => 20 |
|
76 | 76 | ); |
77 | 77 | } |
78 | 78 | |
@@ -87,22 +87,22 @@ discard block |
||
87 | 87 | * @see \MyArtJaub\Webtrees\Hook\HookInterfaces\IndividualHeaderExtenderInterface::hExtendIndiHeaderLeft() |
88 | 88 | */ |
89 | 89 | public function hExtendIndiHeaderLeft(IndividualController $ctrlIndi) { |
90 | - $res = ''; |
|
91 | - $dindi = new Individual($ctrlIndi->getSignificantIndividual()); |
|
92 | - $titles = $dindi->getTitles(); |
|
93 | - if(count($titles)>0){ |
|
94 | - $res = ' |
|
90 | + $res = ''; |
|
91 | + $dindi = new Individual($ctrlIndi->getSignificantIndividual()); |
|
92 | + $titles = $dindi->getTitles(); |
|
93 | + if(count($titles)>0){ |
|
94 | + $res = ' |
|
95 | 95 | <dl> |
96 | 96 | <dt class="label">'.I18N::translate('Titles').'</dt>'; |
97 | - foreach($titles as $title=>$props){ |
|
98 | - $res .= |
|
99 | - '<dd class="field">' . $title. ' ' . |
|
100 | - FunctionsPrint::getListFromArray($props) . |
|
101 | - '</dd>'; |
|
102 | - } |
|
103 | - $res .= '</dl>'; |
|
104 | - } |
|
105 | - return array( 'indi-header-titles' , $res); |
|
97 | + foreach($titles as $title=>$props){ |
|
98 | + $res .= |
|
99 | + '<dd class="field">' . $title. ' ' . |
|
100 | + FunctionsPrint::getListFromArray($props) . |
|
101 | + '</dd>'; |
|
102 | + } |
|
103 | + $res .= '</dl>'; |
|
104 | + } |
|
105 | + return array( 'indi-header-titles' , $res); |
|
106 | 106 | } |
107 | 107 | |
108 | 108 | /** |
@@ -116,15 +116,15 @@ discard block |
||
116 | 116 | * @see \MyArtJaub\Webtrees\Hook\HookInterfaces\PageHeaderExtenderInterface::hPrintHeader() |
117 | 117 | */ |
118 | 118 | public function hPrintHeader() { |
119 | - global $WT_TREE; |
|
119 | + global $WT_TREE; |
|
120 | 120 | |
121 | - $html = ''; |
|
122 | - if($this->getSetting('MAJ_ADD_HTML_HEADER', 0) == 1){ |
|
123 | - if(Auth::accessLevel($WT_TREE) >= $this->getSetting('MAJ_SHOW_HTML_HEADER', Auth::PRIV_HIDE) && !Filter::getBool('noheader')){ |
|
124 | - $html .= $this->getSetting('MAJ_HTML_HEADER', ''); |
|
125 | - } |
|
126 | - } |
|
127 | - return $html; |
|
121 | + $html = ''; |
|
122 | + if($this->getSetting('MAJ_ADD_HTML_HEADER', 0) == 1){ |
|
123 | + if(Auth::accessLevel($WT_TREE) >= $this->getSetting('MAJ_SHOW_HTML_HEADER', Auth::PRIV_HIDE) && !Filter::getBool('noheader')){ |
|
124 | + $html .= $this->getSetting('MAJ_HTML_HEADER', ''); |
|
125 | + } |
|
126 | + } |
|
127 | + return $html; |
|
128 | 128 | } |
129 | 129 | |
130 | 130 | /** |
@@ -132,26 +132,26 @@ discard block |
||
132 | 132 | * @see \MyArtJaub\Webtrees\Hook\HookInterfaces\PageFooterExtenderInterface::hPrintFooter() |
133 | 133 | */ |
134 | 134 | public function hPrintFooter() { |
135 | - global $WT_TREE; |
|
135 | + global $WT_TREE; |
|
136 | 136 | |
137 | - $html = ''; |
|
138 | - if($this->getSetting('MAJ_DISPLAY_CNIL', 0) == 1){ |
|
139 | - $html .= '<br/>'; |
|
140 | - $html .= '<div class="center">'; |
|
141 | - $cnil_ref = $this->getSetting('MAJ_CNIL_REFERENCE', ''); |
|
142 | - if($cnil_ref != ''){ |
|
143 | - $html .= I18N::translate('This site has been notified to the French National Commission for Data protection (CNIL) and registered under number %s. ', $cnil_ref); |
|
144 | - } |
|
145 | - $html .= I18N::translate('In accordance with the French Data protection Act (<em>Loi Informatique et Libertés</em>) of January 6th, 1978, you have the right to access, modify, rectify and delete personal information that pertains to you. To exercice this right, please contact %s, and provide your name, address and a proof of your identity.', Theme::theme()->contactLink(User::find($WT_TREE->getPreference('WEBMASTER_USER_ID')))); |
|
146 | - $html .= '</div>'; |
|
147 | - } |
|
137 | + $html = ''; |
|
138 | + if($this->getSetting('MAJ_DISPLAY_CNIL', 0) == 1){ |
|
139 | + $html .= '<br/>'; |
|
140 | + $html .= '<div class="center">'; |
|
141 | + $cnil_ref = $this->getSetting('MAJ_CNIL_REFERENCE', ''); |
|
142 | + if($cnil_ref != ''){ |
|
143 | + $html .= I18N::translate('This site has been notified to the French National Commission for Data protection (CNIL) and registered under number %s. ', $cnil_ref); |
|
144 | + } |
|
145 | + $html .= I18N::translate('In accordance with the French Data protection Act (<em>Loi Informatique et Libertés</em>) of January 6th, 1978, you have the right to access, modify, rectify and delete personal information that pertains to you. To exercice this right, please contact %s, and provide your name, address and a proof of your identity.', Theme::theme()->contactLink(User::find($WT_TREE->getPreference('WEBMASTER_USER_ID')))); |
|
146 | + $html .= '</div>'; |
|
147 | + } |
|
148 | 148 | |
149 | - if($this->getSetting('MAJ_ADD_HTML_FOOTER', 0) == 1){ |
|
150 | - if(Auth::accessLevel($WT_TREE) >= $this->getSetting('MAJ_SHOW_HTML_FOOTER', Auth::PRIV_HIDE) && !Filter::getBool('nofooter')){ |
|
151 | - $html .= $this->getSetting('MAJ_HTML_FOOTER', ''); |
|
152 | - } |
|
153 | - } |
|
154 | - return $html; |
|
149 | + if($this->getSetting('MAJ_ADD_HTML_FOOTER', 0) == 1){ |
|
150 | + if(Auth::accessLevel($WT_TREE) >= $this->getSetting('MAJ_SHOW_HTML_FOOTER', Auth::PRIV_HIDE) && !Filter::getBool('nofooter')){ |
|
151 | + $html .= $this->getSetting('MAJ_HTML_FOOTER', ''); |
|
152 | + } |
|
153 | + } |
|
154 | + return $html; |
|
155 | 155 | } |
156 | 156 | |
157 | 157 | } |
@@ -19,76 +19,76 @@ |
||
19 | 19 | * Welcome Block Module. |
20 | 20 | */ |
21 | 21 | class WelcomeBlockModule extends AbstractModule |
22 | - implements ModuleBlockInterface |
|
22 | + implements ModuleBlockInterface |
|
23 | 23 | { |
24 | - /** @var string For custom modules - link for support, upgrades, etc. */ |
|
25 | - const CUSTOM_WEBSITE = 'https://github.com/jon48/webtrees-lib'; |
|
24 | + /** @var string For custom modules - link for support, upgrades, etc. */ |
|
25 | + const CUSTOM_WEBSITE = 'https://github.com/jon48/webtrees-lib'; |
|
26 | 26 | |
27 | - /** |
|
28 | - * {@inhericDoc} |
|
29 | - */ |
|
30 | - public function getTitle() { |
|
31 | - return /* I18N: Name of the “WelcomeBlock” module */ I18N::translate('MyArtJaub Welcome Block'); |
|
32 | - } |
|
27 | + /** |
|
28 | + * {@inhericDoc} |
|
29 | + */ |
|
30 | + public function getTitle() { |
|
31 | + return /* I18N: Name of the “WelcomeBlock” module */ I18N::translate('MyArtJaub Welcome Block'); |
|
32 | + } |
|
33 | 33 | |
34 | - /** |
|
35 | - * {@inhericDoc} |
|
36 | - */ |
|
37 | - public function getDescription() { |
|
38 | - return /* I18N: Description of the “WelcomeBlock” module */ I18N::translate('The MyArtJaub Welcome block welcomes the visitor to the site, allows a quick login to the site, and displays statistics on visits.'); |
|
39 | - } |
|
34 | + /** |
|
35 | + * {@inhericDoc} |
|
36 | + */ |
|
37 | + public function getDescription() { |
|
38 | + return /* I18N: Description of the “WelcomeBlock” module */ I18N::translate('The MyArtJaub Welcome block welcomes the visitor to the site, allows a quick login to the site, and displays statistics on visits.'); |
|
39 | + } |
|
40 | 40 | |
41 | - /** |
|
42 | - * {@inhericDoc} |
|
43 | - */ |
|
44 | - public function modAction($mod_action) { |
|
45 | - \MyArtJaub\Webtrees\Mvc\Dispatcher::getInstance()->handle($this, $mod_action); |
|
46 | - } |
|
41 | + /** |
|
42 | + * {@inhericDoc} |
|
43 | + */ |
|
44 | + public function modAction($mod_action) { |
|
45 | + \MyArtJaub\Webtrees\Mvc\Dispatcher::getInstance()->handle($this, $mod_action); |
|
46 | + } |
|
47 | 47 | |
48 | - /** |
|
49 | - * {@inhericDoc} |
|
50 | - * @see \Fisharebest\Webtrees\Module\ModuleBlockInterface::getBlock() |
|
51 | - */ |
|
48 | + /** |
|
49 | + * {@inhericDoc} |
|
50 | + * @see \Fisharebest\Webtrees\Module\ModuleBlockInterface::getBlock() |
|
51 | + */ |
|
52 | 52 | public function getBlock($block_id, $template = true, $cfg = array()) { |
53 | - global $controller, $WT_TREE; |
|
53 | + global $controller, $WT_TREE; |
|
54 | 54 | |
55 | - $wb_controller = new WelcomeBlockController($this); |
|
56 | - return $wb_controller->index($controller, $WT_TREE, $block_id, $template); |
|
57 | - } |
|
55 | + $wb_controller = new WelcomeBlockController($this); |
|
56 | + return $wb_controller->index($controller, $WT_TREE, $block_id, $template); |
|
57 | + } |
|
58 | 58 | |
59 | - /** |
|
60 | - * {@inhericDoc} |
|
61 | - * @see \Fisharebest\Webtrees\Module\ModuleBlockInterface::loadAjax() |
|
62 | - */ |
|
63 | - public function loadAjax() { |
|
64 | - return false; |
|
65 | - } |
|
59 | + /** |
|
60 | + * {@inhericDoc} |
|
61 | + * @see \Fisharebest\Webtrees\Module\ModuleBlockInterface::loadAjax() |
|
62 | + */ |
|
63 | + public function loadAjax() { |
|
64 | + return false; |
|
65 | + } |
|
66 | 66 | |
67 | - /** |
|
68 | - * {@inhericDoc} |
|
69 | - * @see \Fisharebest\Webtrees\Module\ModuleBlockInterface::isUserBlock() |
|
70 | - */ |
|
71 | - public function isUserBlock() { |
|
72 | - return false; |
|
73 | - } |
|
67 | + /** |
|
68 | + * {@inhericDoc} |
|
69 | + * @see \Fisharebest\Webtrees\Module\ModuleBlockInterface::isUserBlock() |
|
70 | + */ |
|
71 | + public function isUserBlock() { |
|
72 | + return false; |
|
73 | + } |
|
74 | 74 | |
75 | - /** |
|
76 | - * {@inhericDoc} |
|
77 | - * @see \Fisharebest\Webtrees\Module\ModuleBlockInterface::isGedcomBlock() |
|
78 | - */ |
|
79 | - public function isGedcomBlock() { |
|
80 | - return true; |
|
81 | - } |
|
75 | + /** |
|
76 | + * {@inhericDoc} |
|
77 | + * @see \Fisharebest\Webtrees\Module\ModuleBlockInterface::isGedcomBlock() |
|
78 | + */ |
|
79 | + public function isGedcomBlock() { |
|
80 | + return true; |
|
81 | + } |
|
82 | 82 | |
83 | - /** |
|
84 | - * {@inhericDoc} |
|
85 | - * @see \Fisharebest\Webtrees\Module\ModuleBlockInterface::configureBlock() |
|
86 | - */ |
|
87 | - public function configureBlock($block_id) { |
|
83 | + /** |
|
84 | + * {@inhericDoc} |
|
85 | + * @see \Fisharebest\Webtrees\Module\ModuleBlockInterface::configureBlock() |
|
86 | + */ |
|
87 | + public function configureBlock($block_id) { |
|
88 | 88 | |
89 | - $wb_controller = new WelcomeBlockController($this); |
|
90 | - return $wb_controller->config($block_id); |
|
91 | - } |
|
89 | + $wb_controller = new WelcomeBlockController($this); |
|
90 | + return $wb_controller->config($block_id); |
|
91 | + } |
|
92 | 92 | |
93 | 93 | } |
94 | 94 | |
95 | 95 | \ No newline at end of file |
@@ -29,89 +29,89 @@ discard block |
||
29 | 29 | */ |
30 | 30 | class AdminConfigController extends MvcController |
31 | 31 | { |
32 | - /** |
|
33 | - * Manage updates sent from the AdminConfig@index form. |
|
34 | - */ |
|
35 | - protected function update() { |
|
36 | - if(Auth::isAdmin()){ |
|
37 | - $ihooks = HookProvider::getInstalledHooks(); |
|
32 | + /** |
|
33 | + * Manage updates sent from the AdminConfig@index form. |
|
34 | + */ |
|
35 | + protected function update() { |
|
36 | + if(Auth::isAdmin()){ |
|
37 | + $ihooks = HookProvider::getInstalledHooks(); |
|
38 | 38 | |
39 | - $module_names= Database::prepare( |
|
40 | - "SELECT module_name FROM `##module` WHERE status='disabled'" |
|
41 | - )->fetchOneColumn(); |
|
39 | + $module_names= Database::prepare( |
|
40 | + "SELECT module_name FROM `##module` WHERE status='disabled'" |
|
41 | + )->fetchOneColumn(); |
|
42 | 42 | |
43 | - if($ihooks !== null){ |
|
44 | - foreach ($ihooks as $ihook => $params) { |
|
45 | - if(Filter::post('hook-' . $params['id']) === 'yes') { |
|
46 | - $array_hook = explode('#', $ihook); |
|
47 | - //Update status |
|
48 | - $new_status= Filter::postBool('status-' . $params['id']); |
|
49 | - if(in_array($array_hook[0], $module_names)) $new_status = false; |
|
50 | - $previous_status = $params['status']; |
|
51 | - if ($new_status !== null) { |
|
52 | - $new_status= $new_status ? 'enabled' : 'disabled'; |
|
53 | - if($new_status != $previous_status){ |
|
54 | - $chook = new Hook($array_hook[1], $array_hook[2]); |
|
55 | - switch($new_status){ |
|
56 | - case 'enabled': |
|
57 | - $chook->enable($array_hook[0]); |
|
58 | - break; |
|
59 | - case 'disabled': |
|
60 | - $chook->disable($array_hook[0]); |
|
61 | - break; |
|
62 | - default: |
|
63 | - break; |
|
64 | - } |
|
65 | - } |
|
66 | - } |
|
43 | + if($ihooks !== null){ |
|
44 | + foreach ($ihooks as $ihook => $params) { |
|
45 | + if(Filter::post('hook-' . $params['id']) === 'yes') { |
|
46 | + $array_hook = explode('#', $ihook); |
|
47 | + //Update status |
|
48 | + $new_status= Filter::postBool('status-' . $params['id']); |
|
49 | + if(in_array($array_hook[0], $module_names)) $new_status = false; |
|
50 | + $previous_status = $params['status']; |
|
51 | + if ($new_status !== null) { |
|
52 | + $new_status= $new_status ? 'enabled' : 'disabled'; |
|
53 | + if($new_status != $previous_status){ |
|
54 | + $chook = new Hook($array_hook[1], $array_hook[2]); |
|
55 | + switch($new_status){ |
|
56 | + case 'enabled': |
|
57 | + $chook->enable($array_hook[0]); |
|
58 | + break; |
|
59 | + case 'disabled': |
|
60 | + $chook->disable($array_hook[0]); |
|
61 | + break; |
|
62 | + default: |
|
63 | + break; |
|
64 | + } |
|
65 | + } |
|
66 | + } |
|
67 | 67 | |
68 | - //Update priority |
|
69 | - $new_priority = Filter::postInteger("moduleorder-{$params['id']}"); |
|
70 | - $previous_priority = $params['priority']; |
|
71 | - if ($new_priority !== null) { |
|
72 | - if($new_priority != $previous_priority){ |
|
73 | - $chook = new Hook($array_hook[1], $array_hook[2]); |
|
74 | - $chook->setPriority($array_hook[0], $new_priority); |
|
75 | - } |
|
76 | - } |
|
77 | - } |
|
78 | - } |
|
79 | - } |
|
80 | - } |
|
81 | - } |
|
68 | + //Update priority |
|
69 | + $new_priority = Filter::postInteger("moduleorder-{$params['id']}"); |
|
70 | + $previous_priority = $params['priority']; |
|
71 | + if ($new_priority !== null) { |
|
72 | + if($new_priority != $previous_priority){ |
|
73 | + $chook = new Hook($array_hook[1], $array_hook[2]); |
|
74 | + $chook->setPriority($array_hook[0], $new_priority); |
|
75 | + } |
|
76 | + } |
|
77 | + } |
|
78 | + } |
|
79 | + } |
|
80 | + } |
|
81 | + } |
|
82 | 82 | |
83 | - /** |
|
84 | - * Pages |
|
85 | - */ |
|
83 | + /** |
|
84 | + * Pages |
|
85 | + */ |
|
86 | 86 | |
87 | - /** |
|
88 | - * AdminConfig@index |
|
89 | - */ |
|
90 | - public function index() { |
|
91 | - global $WT_TREE; |
|
87 | + /** |
|
88 | + * AdminConfig@index |
|
89 | + */ |
|
90 | + public function index() { |
|
91 | + global $WT_TREE; |
|
92 | 92 | |
93 | - HookProvider::updateHooks(); |
|
93 | + HookProvider::updateHooks(); |
|
94 | 94 | |
95 | - $action = Filter::post('action'); |
|
96 | - if($action == 'update' && Filter::checkCsrf()) $this->update(); |
|
95 | + $action = Filter::post('action'); |
|
96 | + if($action == 'update' && Filter::checkCsrf()) $this->update(); |
|
97 | 97 | |
98 | - Theme::theme(new AdministrationTheme)->init($WT_TREE); |
|
99 | - $ctrl = new PageController(); |
|
100 | - $ctrl |
|
101 | - ->restrictAccess(Auth::isAdmin()) |
|
102 | - ->setPageTitle($this->module->getTitle()); |
|
98 | + Theme::theme(new AdministrationTheme)->init($WT_TREE); |
|
99 | + $ctrl = new PageController(); |
|
100 | + $ctrl |
|
101 | + ->restrictAccess(Auth::isAdmin()) |
|
102 | + ->setPageTitle($this->module->getTitle()); |
|
103 | 103 | |
104 | - $table_id = 'table-installedhooks-' . Uuid::uuid4(); |
|
104 | + $table_id = 'table-installedhooks-' . Uuid::uuid4(); |
|
105 | 105 | |
106 | - $view_bag = new ViewBag(); |
|
107 | - $view_bag->set('title', $ctrl->getPageTitle()); |
|
108 | - $view_bag->set('table_id', $table_id); |
|
109 | - $view_bag->set('hook_list', HookProvider::getRawInstalledHooks()); |
|
106 | + $view_bag = new ViewBag(); |
|
107 | + $view_bag->set('title', $ctrl->getPageTitle()); |
|
108 | + $view_bag->set('table_id', $table_id); |
|
109 | + $view_bag->set('hook_list', HookProvider::getRawInstalledHooks()); |
|
110 | 110 | |
111 | - $ctrl |
|
112 | - ->addExternalJavascript(WT_JQUERY_DATATABLES_JS_URL) |
|
113 | - ->addExternalJavascript(WT_DATATABLES_BOOTSTRAP_JS_URL) |
|
114 | - ->addInlineJavascript(' |
|
111 | + $ctrl |
|
112 | + ->addExternalJavascript(WT_JQUERY_DATATABLES_JS_URL) |
|
113 | + ->addExternalJavascript(WT_DATATABLES_BOOTSTRAP_JS_URL) |
|
114 | + ->addInlineJavascript(' |
|
115 | 115 | jQuery(document).ready(function() { |
116 | 116 | jQuery("#'.$table_id.'").dataTable( { |
117 | 117 | '.I18N::datatablesI18N().', |
@@ -131,7 +131,7 @@ discard block |
||
131 | 131 | }); |
132 | 132 | '); |
133 | 133 | |
134 | - ViewFactory::make('AdminConfig', $this, $ctrl, $view_bag)->render(); |
|
135 | - } |
|
134 | + ViewFactory::make('AdminConfig', $this, $ctrl, $view_bag)->render(); |
|
135 | + } |
|
136 | 136 | |
137 | 137 | } |
138 | 138 | \ No newline at end of file |
@@ -33,26 +33,26 @@ discard block |
||
33 | 33 | * Manage updates sent from the AdminConfig@index form. |
34 | 34 | */ |
35 | 35 | protected function update() { |
36 | - if(Auth::isAdmin()){ |
|
36 | + if (Auth::isAdmin()) { |
|
37 | 37 | $ihooks = HookProvider::getInstalledHooks(); |
38 | 38 | |
39 | - $module_names= Database::prepare( |
|
39 | + $module_names = Database::prepare( |
|
40 | 40 | "SELECT module_name FROM `##module` WHERE status='disabled'" |
41 | 41 | )->fetchOneColumn(); |
42 | 42 | |
43 | - if($ihooks !== null){ |
|
43 | + if ($ihooks !== null) { |
|
44 | 44 | foreach ($ihooks as $ihook => $params) { |
45 | - if(Filter::post('hook-' . $params['id']) === 'yes') { |
|
45 | + if (Filter::post('hook-'.$params['id']) === 'yes') { |
|
46 | 46 | $array_hook = explode('#', $ihook); |
47 | 47 | //Update status |
48 | - $new_status= Filter::postBool('status-' . $params['id']); |
|
49 | - if(in_array($array_hook[0], $module_names)) $new_status = false; |
|
48 | + $new_status = Filter::postBool('status-'.$params['id']); |
|
49 | + if (in_array($array_hook[0], $module_names)) $new_status = false; |
|
50 | 50 | $previous_status = $params['status']; |
51 | 51 | if ($new_status !== null) { |
52 | - $new_status= $new_status ? 'enabled' : 'disabled'; |
|
53 | - if($new_status != $previous_status){ |
|
52 | + $new_status = $new_status ? 'enabled' : 'disabled'; |
|
53 | + if ($new_status != $previous_status) { |
|
54 | 54 | $chook = new Hook($array_hook[1], $array_hook[2]); |
55 | - switch($new_status){ |
|
55 | + switch ($new_status) { |
|
56 | 56 | case 'enabled': |
57 | 57 | $chook->enable($array_hook[0]); |
58 | 58 | break; |
@@ -69,7 +69,7 @@ discard block |
||
69 | 69 | $new_priority = Filter::postInteger("moduleorder-{$params['id']}"); |
70 | 70 | $previous_priority = $params['priority']; |
71 | 71 | if ($new_priority !== null) { |
72 | - if($new_priority != $previous_priority){ |
|
72 | + if ($new_priority != $previous_priority) { |
|
73 | 73 | $chook = new Hook($array_hook[1], $array_hook[2]); |
74 | 74 | $chook->setPriority($array_hook[0], $new_priority); |
75 | 75 | } |
@@ -93,7 +93,7 @@ discard block |
||
93 | 93 | HookProvider::updateHooks(); |
94 | 94 | |
95 | 95 | $action = Filter::post('action'); |
96 | - if($action == 'update' && Filter::checkCsrf()) $this->update(); |
|
96 | + if ($action == 'update' && Filter::checkCsrf()) $this->update(); |
|
97 | 97 | |
98 | 98 | Theme::theme(new AdministrationTheme)->init($WT_TREE); |
99 | 99 | $ctrl = new PageController(); |
@@ -101,7 +101,7 @@ discard block |
||
101 | 101 | ->restrictAccess(Auth::isAdmin()) |
102 | 102 | ->setPageTitle($this->module->getTitle()); |
103 | 103 | |
104 | - $table_id = 'table-installedhooks-' . Uuid::uuid4(); |
|
104 | + $table_id = 'table-installedhooks-'.Uuid::uuid4(); |
|
105 | 105 | |
106 | 106 | $view_bag = new ViewBag(); |
107 | 107 | $view_bag->set('title', $ctrl->getPageTitle()); |