Passed
Branch feature/2.0 (2da243)
by Jonathan
05:05
created
src/Webtrees/Hook/HookInterfaces/RecordNameTextExtenderInterface.php 1 patch
Indentation   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -1,13 +1,13 @@
 block discarded – undo
1 1
 <?php
2 2
  /**
3
- * webtrees-lib: MyArtJaub library for webtrees
4
- *
5
- * @package MyArtJaub\Webtrees
6
- * @subpackage Hook
7
- * @author Jonathan Jaubart <[email protected]>
8
- * @copyright Copyright (c) 2011-2016, Jonathan Jaubart
9
- * @license http://www.gnu.org/licenses/gpl.html GNU General Public License, version 3
10
- */
3
+  * webtrees-lib: MyArtJaub library for webtrees
4
+  *
5
+  * @package MyArtJaub\Webtrees
6
+  * @subpackage Hook
7
+  * @author Jonathan Jaubart <[email protected]>
8
+  * @copyright Copyright (c) 2011-2016, Jonathan Jaubart
9
+  * @license http://www.gnu.org/licenses/gpl.html GNU General Public License, version 3
10
+  */
11 11
 namespace MyArtJaub\Webtrees\Hook\HookInterfaces;
12 12
 
13 13
 use Fisharebest\Webtrees\GedcomRecord;
Please login to merge, or discard this patch.
src/Webtrees/Hook/HookInterfaces/FactSourceTextExtenderInterface.php 1 patch
Indentation   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -1,13 +1,13 @@
 block discarded – undo
1 1
 <?php
2 2
  /**
3
- * webtrees-lib: MyArtJaub library for webtrees
4
- *
5
- * @package MyArtJaub\Webtrees
6
- * @subpackage Hook
7
- * @author Jonathan Jaubart <[email protected]>
8
- * @copyright Copyright (c) 2011-2016, Jonathan Jaubart
9
- * @license http://www.gnu.org/licenses/gpl.html GNU General Public License, version 3
10
- */
3
+  * webtrees-lib: MyArtJaub library for webtrees
4
+  *
5
+  * @package MyArtJaub\Webtrees
6
+  * @subpackage Hook
7
+  * @author Jonathan Jaubart <[email protected]>
8
+  * @copyright Copyright (c) 2011-2016, Jonathan Jaubart
9
+  * @license http://www.gnu.org/licenses/gpl.html GNU General Public License, version 3
10
+  */
11 11
 namespace MyArtJaub\Webtrees\Hook\HookInterfaces;
12 12
 
13 13
 /**
Please login to merge, or discard this patch.
src/Webtrees/Hook/HookInterfaces/PageHeaderExtenderInterface.php 1 patch
Indentation   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -1,13 +1,13 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
  /**
3
- * webtrees-lib: MyArtJaub library for webtrees
4
- *
5
- * @package MyArtJaub\Webtrees
6
- * @subpackage Hook
7
- * @author Jonathan Jaubart <[email protected]>
8
- * @copyright Copyright (c) 2011-2016, Jonathan Jaubart
9
- * @license http://www.gnu.org/licenses/gpl.html GNU General Public License, version 3
10
- */
3
+  * webtrees-lib: MyArtJaub library for webtrees
4
+  *
5
+  * @package MyArtJaub\Webtrees
6
+  * @subpackage Hook
7
+  * @author Jonathan Jaubart <[email protected]>
8
+  * @copyright Copyright (c) 2011-2016, Jonathan Jaubart
9
+  * @license http://www.gnu.org/licenses/gpl.html GNU General Public License, version 3
10
+  */
11 11
 namespace MyArtJaub\Webtrees\Hook\HookInterfaces;
12 12
 
13 13
 /**
@@ -15,12 +15,12 @@  discard block
 block discarded – undo
15 15
  */
16 16
 interface PageHeaderExtenderInterface {
17 17
 		
18
-    /**
19
-     * Get HTML code for extending the header of a page.
20
-     * 
21
-     * @return string HTML code extension
22
-     */
23
-    public function hPrintHeader();
18
+	/**
19
+	 * Get HTML code for extending the header of a page.
20
+	 * 
21
+	 * @return string HTML code extension
22
+	 */
23
+	public function hPrintHeader();
24 24
 	
25 25
 }
26 26
 
Please login to merge, or discard this patch.
src/Webtrees/Hook/HookInterfaces/PageFooterExtenderInterface.php 1 patch
Indentation   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -1,13 +1,13 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
  /**
3
- * webtrees-lib: MyArtJaub library for webtrees
4
- *
5
- * @package MyArtJaub\Webtrees
6
- * @subpackage Hook
7
- * @author Jonathan Jaubart <[email protected]>
8
- * @copyright Copyright (c) 2011-2016, Jonathan Jaubart
9
- * @license http://www.gnu.org/licenses/gpl.html GNU General Public License, version 3
10
- */
3
+  * webtrees-lib: MyArtJaub library for webtrees
4
+  *
5
+  * @package MyArtJaub\Webtrees
6
+  * @subpackage Hook
7
+  * @author Jonathan Jaubart <[email protected]>
8
+  * @copyright Copyright (c) 2011-2016, Jonathan Jaubart
9
+  * @license http://www.gnu.org/licenses/gpl.html GNU General Public License, version 3
10
+  */
11 11
 namespace MyArtJaub\Webtrees\Hook\HookInterfaces;
12 12
 
13 13
 /**
@@ -15,12 +15,12 @@  discard block
 block discarded – undo
15 15
  */
16 16
 interface PageFooterExtenderInterface {
17 17
 		
18
-    /**
19
-     * Get HTML code for extending the footer of a page.
20
-     * 
21
-     * @return string HTML code extension
22
-     */
23
-    public function hPrintFooter();
18
+	/**
19
+	 * Get HTML code for extending the footer of a page.
20
+	 * 
21
+	 * @return string HTML code extension
22
+	 */
23
+	public function hPrintFooter();
24 24
 	
25 25
 }
26 26
 
Please login to merge, or discard this patch.
src/Webtrees/Hook/HookInterfaces/IndividualHeaderExtenderInterface.php 1 patch
Indentation   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -1,13 +1,13 @@
 block discarded – undo
1 1
 <?php
2 2
  /**
3
- * webtrees-lib: MyArtJaub library for webtrees
4
- *
5
- * @package MyArtJaub\Webtrees
6
- * @subpackage Hook
7
- * @author Jonathan Jaubart <[email protected]>
8
- * @copyright Copyright (c) 2011-2016, Jonathan Jaubart
9
- * @license http://www.gnu.org/licenses/gpl.html GNU General Public License, version 3
10
- */
3
+  * webtrees-lib: MyArtJaub library for webtrees
4
+  *
5
+  * @package MyArtJaub\Webtrees
6
+  * @subpackage Hook
7
+  * @author Jonathan Jaubart <[email protected]>
8
+  * @copyright Copyright (c) 2011-2016, Jonathan Jaubart
9
+  * @license http://www.gnu.org/licenses/gpl.html GNU General Public License, version 3
10
+  */
11 11
 namespace MyArtJaub\Webtrees\Hook\HookInterfaces;
12 12
 
13 13
 use Fisharebest\Webtrees\Controller\IndividualController;
Please login to merge, or discard this patch.
src/Webtrees/Hook/HookInterfaces/CustomSimpleTagManagerInterface.php 1 patch
Indentation   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -1,13 +1,13 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
  /**
3
- * webtrees-lib: MyArtJaub library for webtrees
4
- *
5
- * @package MyArtJaub\Webtrees
6
- * @subpackage Hook
7
- * @author Jonathan Jaubart <[email protected]>
8
- * @copyright Copyright (c) 2011-2016, Jonathan Jaubart
9
- * @license http://www.gnu.org/licenses/gpl.html GNU General Public License, version 3
10
- */
3
+  * webtrees-lib: MyArtJaub library for webtrees
4
+  *
5
+  * @package MyArtJaub\Webtrees
6
+  * @subpackage Hook
7
+  * @author Jonathan Jaubart <[email protected]>
8
+  * @copyright Copyright (c) 2011-2016, Jonathan Jaubart
9
+  * @license http://www.gnu.org/licenses/gpl.html GNU General Public License, version 3
10
+  */
11 11
 namespace MyArtJaub\Webtrees\Hook\HookInterfaces;
12 12
 
13 13
 /**
@@ -18,12 +18,12 @@  discard block
 block discarded – undo
18 18
 interface CustomSimpleTagManagerInterface {
19 19
 
20 20
 
21
-    /**
22
-     * Returns the list of expected tags, classified by type of records.
23
-     *
24
-     * @return array List of expected tags
25
-     */
26
-    public function hGetExpectedTags();
21
+	/**
22
+	 * Returns the list of expected tags, classified by type of records.
23
+	 *
24
+	 * @return array List of expected tags
25
+	 */
26
+	public function hGetExpectedTags();
27 27
     
28 28
 	/**
29 29
 	 * Return the HTML code to be display for this tag.
Please login to merge, or discard this patch.
src/Webtrees/Map/GoogleMapsProvider.php 2 patches
Braces   +7 added lines, -2 removed lines patch added patch discarded remove patch
@@ -31,11 +31,16 @@
 block discarded – undo
31 31
 			$nb_levels = count($parent);
32 32
 			for ($i=0; $i < $nb_levels; $i++) {
33 33
 				$parent[$i] = trim($parent[$i]);
34
-				if (empty($parent[$i])) $parent[$i]='unknown';// GoogleMap module uses "unknown" while GEDCOM uses , ,
34
+				if (empty($parent[$i])) {
35
+					$parent[$i]='unknown';
36
+				}
37
+				// GoogleMap module uses "unknown" while GEDCOM uses , ,
35 38
 				$pl_id=Database::prepare('SELECT pl_id FROM `##placelocation` WHERE pl_level=? AND pl_parent_id=? AND pl_place LIKE ? ORDER BY pl_place')
36 39
 					->execute(array($i, $place_id, $parent[$i]))
37 40
 					->fetchOne();
38
-				if (empty($pl_id)) break;
41
+				if (empty($pl_id)) {
42
+					break;
43
+				}
39 44
 				$place_id = $pl_id;
40 45
 			}
41 46
 			return $place_id;
Please login to merge, or discard this patch.
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -25,14 +25,14 @@  discard block
 block discarded – undo
25 25
 	 * @see \MyArtJaub\Webtrees\Map\MapProviderInterface::getProviderPlaceId()
26 26
 	 */
27 27
 	public function getProviderPlaceId(\Fisharebest\Webtrees\Place $place) {
28
-		if(!$place->isEmpty()) {
29
-			$parent = array_reverse(explode (',', $place->getGedcomName()));
28
+		if (!$place->isEmpty()) {
29
+			$parent = array_reverse(explode(',', $place->getGedcomName()));
30 30
 			$place_id = 0;
31 31
 			$nb_levels = count($parent);
32
-			for ($i=0; $i < $nb_levels; $i++) {
32
+			for ($i = 0; $i < $nb_levels; $i++) {
33 33
 				$parent[$i] = trim($parent[$i]);
34
-				if (empty($parent[$i])) $parent[$i]='unknown';// GoogleMap module uses "unknown" while GEDCOM uses , ,
35
-				$pl_id=Database::prepare('SELECT pl_id FROM `##placelocation` WHERE pl_level=? AND pl_parent_id=? AND pl_place LIKE ? ORDER BY pl_place')
34
+				if (empty($parent[$i])) $parent[$i] = 'unknown'; // GoogleMap module uses "unknown" while GEDCOM uses , ,
35
+				$pl_id = Database::prepare('SELECT pl_id FROM `##placelocation` WHERE pl_level=? AND pl_parent_id=? AND pl_place LIKE ? ORDER BY pl_place')
36 36
 					->execute(array($i, $place_id, $parent[$i]))
37 37
 					->fetchOne();
38 38
 				if (empty($pl_id)) break;
@@ -48,12 +48,12 @@  discard block
 block discarded – undo
48 48
 	 * @see \MyArtJaub\Webtrees\Map\MapProviderInterface::getPlaceIcon()
49 49
 	 */
50 50
 	public function getPlaceIcon(\Fisharebest\Webtrees\Place $place) {
51
-		if(!$place->isEmpty()){
51
+		if (!$place->isEmpty()) {
52 52
 			$place_details =
53 53
 				Database::prepare('SELECT pl_icon FROM `##placelocation` WHERE pl_id=? ORDER BY pl_place')	
54 54
 				->execute(array($this->getProviderPlaceId($place)))
55 55
 				->fetchOneRow();
56
-			if($place_details){
56
+			if ($place_details) {
57 57
 				return WT_MODULES_DIR.'googlemap/'.$place_details->pl_icon;
58 58
 			}
59 59
 		}
Please login to merge, or discard this patch.
src/Webtrees/Fact.php 2 patches
Indentation   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -34,26 +34,26 @@
 block discarded – undo
34 34
 	protected $fact; 
35 35
 	
36 36
 	/**
37
-	* Contructor for the decorator
38
-	*
39
-	* @param \Fisharebest\Webtrees\Fact $fact_in The Fact to extend
40
-	*/
37
+	 * Contructor for the decorator
38
+	 *
39
+	 * @param \Fisharebest\Webtrees\Fact $fact_in The Fact to extend
40
+	 */
41 41
 	public function __construct(\Fisharebest\Webtrees\Fact $fact_in){
42 42
 		$this->fact = $fact_in;
43 43
 	}
44 44
 	
45 45
 	/**
46
-	* Check if a fact has a date and is sourced
47
-	* Values:
48
-	* 		- 0, if no date is found for the fact
49
-	* 		- -1, if the date is not precise
50
-	* 		- -2, if the date is precise, but no source is found
51
-	* 		- 1, if the date is precise, and a source is found
52
-	* 		- 2, if the date is precise, a source exists, and is supported by a certificate (requires _ACT usage)
53
-	* 		- 3, if the date is precise, a source exists, and the certificate supporting the fact is within an acceptable range of date
54
-	*
55
-	* @return int Level of sources
56
-	*/
46
+	 * Check if a fact has a date and is sourced
47
+	 * Values:
48
+	 * 		- 0, if no date is found for the fact
49
+	 * 		- -1, if the date is not precise
50
+	 * 		- -2, if the date is precise, but no source is found
51
+	 * 		- 1, if the date is precise, and a source is found
52
+	 * 		- 2, if the date is precise, a source exists, and is supported by a certificate (requires _ACT usage)
53
+	 * 		- 3, if the date is precise, a source exists, and the certificate supporting the fact is within an acceptable range of date
54
+	 *
55
+	 * @return int Level of sources
56
+	 */
57 57
 	public function isSourced(){
58 58
 		$isSourced=0;
59 59
 		$date = $this->fact->getDate();
Please login to merge, or discard this patch.
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -38,7 +38,7 @@  discard block
 block discarded – undo
38 38
 	*
39 39
 	* @param \Fisharebest\Webtrees\Fact $fact_in The Fact to extend
40 40
 	*/
41
-	public function __construct(\Fisharebest\Webtrees\Fact $fact_in){
41
+	public function __construct(\Fisharebest\Webtrees\Fact $fact_in) {
42 42
 		$this->fact = $fact_in;
43 43
 	}
44 44
 	
@@ -54,22 +54,22 @@  discard block
 block discarded – undo
54 54
 	*
55 55
 	* @return int Level of sources
56 56
 	*/
57
-	public function isSourced(){
58
-		$isSourced=0;
57
+	public function isSourced() {
58
+		$isSourced = 0;
59 59
 		$date = $this->fact->getDate();
60
-		if($date->isOK()) {
61
-			$isSourced=-1;
62
-			if($date->qual1=='' && $date->minimumJulianDay() == $date->maximumJulianDay()){
63
-				$isSourced=-2;
60
+		if ($date->isOK()) {
61
+			$isSourced = -1;
62
+			if ($date->qual1 == '' && $date->minimumJulianDay() == $date->maximumJulianDay()) {
63
+				$isSourced = -2;
64 64
 				$citations = $this->fact->getCitations();
65
-				foreach($citations as $citation){
66
-					$isSourced=max($isSourced, 1);
67
-					if(preg_match('/3 _ACT (.*)/', $citation) ){
68
- 						$isSourced=max($isSourced, 2);
65
+				foreach ($citations as $citation) {
66
+					$isSourced = max($isSourced, 1);
67
+					if (preg_match('/3 _ACT (.*)/', $citation)) {
68
+ 						$isSourced = max($isSourced, 2);
69 69
  						preg_match_all("/4 DATE (.*)/", $citation, $datessource, PREG_SET_ORDER);
70
- 						foreach($datessource as $daterec){
70
+ 						foreach ($datessource as $daterec) {
71 71
  							$datesource = new Date($daterec[1]);
72
- 							if(abs($datesource->julianDay() - $date->julianDay()) < self::DATE_PRECISION_MARGIN){
72
+ 							if (abs($datesource->julianDay() - $date->julianDay()) < self::DATE_PRECISION_MARGIN) {
73 73
  								$isSourced = max($isSourced, 3); //If this level increases, do not forget to change the constant MAX_IS_SOURCED_LEVEL
74 74
  							}
75 75
  						}
Please login to merge, or discard this patch.
src/Webtrees/Module/IsSourcedModule.php 3 patches
Spacing   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -63,7 +63,7 @@  discard block
 block discarded – undo
63 63
 	 * @see \MyArtJaub\Webtrees\Hook\HookInterfaces\IndividualHeaderExtenderInterface::hExtendIndiHeaderIcons()
64 64
 	 */
65 65
 	public function hExtendIndiHeaderIcons(IndividualController $ctrlIndi) {
66
-	    if($ctrlIndi){
66
+	    if ($ctrlIndi) {
67 67
 	        $dindi = new Individual($ctrlIndi->getSignificantIndividual());
68 68
 	        if ($dindi->canDisplayIsSourced()) 
69 69
 	            return FunctionsPrint::formatIsSourcedIcon('R', $dindi->isSourced(), 'INDI', 1, 'large');
@@ -87,19 +87,19 @@  discard block
 block discarded – undo
87 87
 	 * {@inheritDoc}
88 88
 	 * @see \MyArtJaub\Webtrees\Hook\HookInterfaces\RecordNameTextExtenderInterface::hRecordNamePrepend()
89 89
 	 */
90
-	public function hRecordNamePrepend(GedcomRecord $grec, $size){ }
90
+	public function hRecordNamePrepend(GedcomRecord $grec, $size) { }
91 91
 	
92 92
 	/**
93 93
 	 * {@inheritDoc}
94 94
 	 * @see \MyArtJaub\Webtrees\Hook\HookInterfaces\RecordNameTextExtenderInterface::hRecordNameAppend()
95 95
 	 */
96
-	public function hRecordNameAppend(GedcomRecord $grec, $size = 'small'){
96
+	public function hRecordNameAppend(GedcomRecord $grec, $size = 'small') {
97 97
 	    $html = '';
98
-	    if($grec instanceof \Fisharebest\Webtrees\Individual){
98
+	    if ($grec instanceof \Fisharebest\Webtrees\Individual) {
99 99
 	        $dindi = new Individual($grec);
100 100
 	        $html .= FunctionsPrint::formatIsSourcedIcon('R', $dindi->isSourced(), 'INDI', 1, $size);
101 101
 	        $html .= FunctionsPrint::formatIsSourcedIcon('E', $dindi->isBirthSourced(), 'BIRT', 1, $size);
102
-	        if($grec->isDead())
102
+	        if ($grec->isDead())
103 103
 	            $html .= FunctionsPrint::formatIsSourcedIcon('E', $dindi->isDeathSourced(), 'DEAT', 1, $size);
104 104
 	    }
105 105
 	    return $html;
@@ -117,7 +117,7 @@  discard block
 block discarded – undo
117 117
 	 * {@inheritDoc}
118 118
 	 * @see \Fisharebest\Webtrees\Module\ModuleSidebarInterface::hasSidebarContent()
119 119
 	 */
120
-	public function hasSidebarContent(){ 
120
+	public function hasSidebarContent() { 
121 121
 	    return true;
122 122
 	}
123 123
 	
@@ -147,24 +147,24 @@  discard block
 block discarded – undo
147 147
 	            echo '
148 148
 	                <table class="issourcedtable">
149 149
 	                   <tr>
150
-	                       <td class="slabel"> ' . GedcomTag::getLabel('INDI') . '</td>
150
+	                       <td class="slabel"> ' . GedcomTag::getLabel('INDI').'</td>
151 151
 	                       <td class="svalue">' . FunctionsPrint::formatIsSourcedIcon('R', $dindi->isSourced(), 'INDI', 1).'</td>
152 152
 	                   </tr>
153 153
 	                   <tr>
154
-	                       <td class="slabel">' . GedcomTag::getLabel('BIRT') . '</td>
154
+	                       <td class="slabel">' . GedcomTag::getLabel('BIRT').'</td>
155 155
 	                       <td class="svalue">' . FunctionsPrint::formatIsSourcedIcon('E', $dindi->isBirthSourced(), 'BIRT', 1).'</td>
156 156
 	                   </tr>';
157 157
 	            
158 158
 	            $fams = $root->getSpouseFamilies();
159
-	            ($ct = count($fams)) > 1 ? $nb=1 : $nb=' ';	            
160
-	            foreach($fams as $fam){
159
+	            ($ct = count($fams)) > 1 ? $nb = 1 : $nb = ' ';	            
160
+	            foreach ($fams as $fam) {
161 161
 	                $dfam = new Family($fam);
162 162
 	                echo '
163 163
 	                    <tr>
164 164
 	                       <td class="slabel right">
165
-	                           <a href="' . $fam->getHtmlUrl() . '"> '. GedcomTag::getLabel('MARR');
166
-	                if($ct > 1){
167
-	                    echo ' ',$nb;
165
+	                           <a href="' . $fam->getHtmlUrl().'"> '.GedcomTag::getLabel('MARR');
166
+	                if ($ct > 1) {
167
+	                    echo ' ', $nb;
168 168
 	                    $nb++;
169 169
 	                }
170 170
 	                echo '     </a>
@@ -173,10 +173,10 @@  discard block
 block discarded – undo
173 173
 	                   </tr>';
174 174
 	            }
175 175
 	            
176
-	            if( $root->isDead() )
176
+	            if ($root->isDead())
177 177
 	                echo '
178 178
 	                    <tr>
179
-	                       <td class="slabel">' . GedcomTag::getLabel('DEAT') . '</td>
179
+	                       <td class="slabel">' . GedcomTag::getLabel('DEAT').'</td>
180 180
 	                       <td class="svalue">' . FunctionsPrint::formatIsSourcedIcon('E', $dindi->isDeathSourced(), 'DEAT', 1).'</td>
181 181
 	                   </tr>';
182 182
 	            
Please login to merge, or discard this patch.
Braces   +9 added lines, -6 removed lines patch added patch discarded remove patch
@@ -65,8 +65,9 @@  discard block
 block discarded – undo
65 65
 	public function hExtendIndiHeaderIcons(IndividualController $ctrlIndi) {
66 66
 	    if($ctrlIndi){
67 67
 	        $dindi = new Individual($ctrlIndi->getSignificantIndividual());
68
-	        if ($dindi->canDisplayIsSourced()) 
69
-	            return FunctionsPrint::formatIsSourcedIcon('R', $dindi->isSourced(), 'INDI', 1, 'large');
68
+	        if ($dindi->canDisplayIsSourced()) {
69
+	        	            return FunctionsPrint::formatIsSourcedIcon('R', $dindi->isSourced(), 'INDI', 1, 'large');
70
+	        }
70 71
 	    }
71 72
 	    return '';
72 73
 	}
@@ -99,8 +100,9 @@  discard block
 block discarded – undo
99 100
 	        $dindi = new Individual($grec);
100 101
 	        $html .= FunctionsPrint::formatIsSourcedIcon('R', $dindi->isSourced(), 'INDI', 1, $size);
101 102
 	        $html .= FunctionsPrint::formatIsSourcedIcon('E', $dindi->isBirthSourced(), 'BIRT', 1, $size);
102
-	        if($grec->isDead())
103
-	            $html .= FunctionsPrint::formatIsSourcedIcon('E', $dindi->isDeathSourced(), 'DEAT', 1, $size);
103
+	        if($grec->isDead()) {
104
+	        	            $html .= FunctionsPrint::formatIsSourcedIcon('E', $dindi->isDeathSourced(), 'DEAT', 1, $size);
105
+	        }
104 106
 	    }
105 107
 	    return $html;
106 108
 	}
@@ -173,12 +175,13 @@  discard block
 block discarded – undo
173 175
 	                   </tr>';
174 176
 	            }
175 177
 	            
176
-	            if( $root->isDead() )
177
-	                echo '
178
+	            if( $root->isDead() ) {
179
+	            	                echo '
178 180
 	                    <tr>
179 181
 	                       <td class="slabel">' . GedcomTag::getLabel('DEAT') . '</td>
180 182
 	                       <td class="svalue">' . FunctionsPrint::formatIsSourcedIcon('E', $dindi->isDeathSourced(), 'DEAT', 1).'</td>
181 183
 	                   </tr>';
184
+	            }
182 185
 	            
183 186
 	            echo '</table>';
184 187
 	        }
Please login to merge, or discard this patch.
Indentation   +59 added lines, -59 removed lines patch added patch discarded remove patch
@@ -30,29 +30,29 @@  discard block
 block discarded – undo
30 30
 class IsSourcedModule extends AbstractModule 
31 31
 implements ModuleSidebarInterface, HookSubscriberInterface, IndividualHeaderExtenderInterface, RecordNameTextExtenderInterface
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('Sourced events');
42
-    }
36
+	/**
37
+	 * {@inheritDoc}
38
+	 * @see \Fisharebest\Webtrees\Module\AbstractModule::getTitle()
39
+	 */
40
+	public function getTitle() {
41
+		return I18N::translate('Sourced events');
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('Indicate if events related to an record are sourced.');
50
-    }
48
+	public function getDescription() {
49
+		return I18N::translate('Indicate if events related to an record are sourced.');
50
+	}
51 51
     
52
-    /**
53
-     * {@inheritDoc}
54
-     * @see \MyArtJaub\Webtrees\Hook\HookSubscriberInterface::getSubscribedHooks()
55
-     */
52
+	/**
53
+	 * {@inheritDoc}
54
+	 * @see \MyArtJaub\Webtrees\Hook\HookSubscriberInterface::getSubscribedHooks()
55
+	 */
56 56
 	public function getSubscribedHooks() {
57 57
 		return array(
58 58
  			'hExtendIndiHeaderIcons' => 10,
@@ -65,12 +65,12 @@  discard block
 block discarded – undo
65 65
 	 * @see \MyArtJaub\Webtrees\Hook\HookInterfaces\IndividualHeaderExtenderInterface::hExtendIndiHeaderIcons()
66 66
 	 */
67 67
 	public function hExtendIndiHeaderIcons(IndividualController $ctrlIndi) {
68
-	    if($ctrlIndi){
69
-	        $dindi = new Individual($ctrlIndi->getSignificantIndividual());
70
-	        if ($dindi->canDisplayIsSourced()) 
71
-	            return FunctionsPrint::formatIsSourcedIcon('R', $dindi->isSourced(), 'INDI', 1, 'large');
72
-	    }
73
-	    return '';
68
+		if($ctrlIndi){
69
+			$dindi = new Individual($ctrlIndi->getSignificantIndividual());
70
+			if ($dindi->canDisplayIsSourced()) 
71
+				return FunctionsPrint::formatIsSourcedIcon('R', $dindi->isSourced(), 'INDI', 1, 'large');
72
+		}
73
+		return '';
74 74
 	}
75 75
 	
76 76
 	/**
@@ -96,15 +96,15 @@  discard block
 block discarded – undo
96 96
 	 * @see \MyArtJaub\Webtrees\Hook\HookInterfaces\RecordNameTextExtenderInterface::hRecordNameAppend()
97 97
 	 */
98 98
 	public function hRecordNameAppend(GedcomRecord $grec, $size = 'small'){
99
-	    $html = '';
100
-	    if($grec instanceof \Fisharebest\Webtrees\Individual){
101
-	        $dindi = new Individual($grec);
102
-	        $html .= FunctionsPrint::formatIsSourcedIcon('R', $dindi->isSourced(), 'INDI', 1, $size);
103
-	        $html .= FunctionsPrint::formatIsSourcedIcon('E', $dindi->isBirthSourced(), 'BIRT', 1, $size);
104
-	        if($grec->isDead())
105
-	            $html .= FunctionsPrint::formatIsSourcedIcon('E', $dindi->isDeathSourced(), 'DEAT', 1, $size);
106
-	    }
107
-	    return $html;
99
+		$html = '';
100
+		if($grec instanceof \Fisharebest\Webtrees\Individual){
101
+			$dindi = new Individual($grec);
102
+			$html .= FunctionsPrint::formatIsSourcedIcon('R', $dindi->isSourced(), 'INDI', 1, $size);
103
+			$html .= FunctionsPrint::formatIsSourcedIcon('E', $dindi->isBirthSourced(), 'BIRT', 1, $size);
104
+			if($grec->isDead())
105
+				$html .= FunctionsPrint::formatIsSourcedIcon('E', $dindi->isDeathSourced(), 'DEAT', 1, $size);
106
+		}
107
+		return $html;
108 108
 	}
109 109
 	
110 110
 	/**
@@ -112,7 +112,7 @@  discard block
 block discarded – undo
112 112
 	 * @see \Fisharebest\Webtrees\Module\ModuleSidebarInterface::defaultSidebarOrder()
113 113
 	 */
114 114
 	public function defaultSidebarOrder() {
115
-	    return 15;
115
+		return 15;
116 116
 	}
117 117
 	
118 118
 	/**
@@ -120,7 +120,7 @@  discard block
 block discarded – undo
120 120
 	 * @see \Fisharebest\Webtrees\Module\ModuleSidebarInterface::hasSidebarContent()
121 121
 	 */
122 122
 	public function hasSidebarContent(){ 
123
-	    return true;
123
+		return true;
124 124
 	}
125 125
 	
126 126
 	/**
@@ -128,7 +128,7 @@  discard block
 block discarded – undo
128 128
 	 * @see \Fisharebest\Webtrees\Module\ModuleSidebarInterface::getSidebarAjaxContent()
129 129
 	 */
130 130
 	public function getSidebarAjaxContent() {
131
-	    return '';
131
+		return '';
132 132
 	}
133 133
 	
134 134
 	/**
@@ -136,15 +136,15 @@  discard block
 block discarded – undo
136 136
 	 * @see \Fisharebest\Webtrees\Module\ModuleSidebarInterface::getSidebarContent()
137 137
 	 */
138 138
 	public function getSidebarContent() {
139
-	    ob_start();
140
-	    $root = Globals::getController()->getSignificantIndividual();
141
-	    if ($root) {
142
-	        $dindi = new Individual($root);
139
+		ob_start();
140
+		$root = Globals::getController()->getSignificantIndividual();
141
+		if ($root) {
142
+			$dindi = new Individual($root);
143 143
 	        	
144
-	        if (!$dindi->canDisplayIsSourced()) {
145
-	            echo '<div class="error">', I18N::translate('This information is private and cannot be shown.'), '</div>';
146
-	        } else {
147
-	            echo '
144
+			if (!$dindi->canDisplayIsSourced()) {
145
+				echo '<div class="error">', I18N::translate('This information is private and cannot be shown.'), '</div>';
146
+			} else {
147
+				echo '
148 148
 	                <table class="issourcedtable">
149 149
 	                   <tr>
150 150
 	                       <td class="slabel"> ' . GedcomTag::getLabel('INDI') . '</td>
@@ -155,35 +155,35 @@  discard block
 block discarded – undo
155 155
 	                       <td class="svalue">' . FunctionsPrint::formatIsSourcedIcon('E', $dindi->isBirthSourced(), 'BIRT', 1).'</td>
156 156
 	                   </tr>';
157 157
 	            
158
-	            $fams = $root->getSpouseFamilies();
159
-	            ($ct = count($fams)) > 1 ? $nb=1 : $nb=' ';	            
160
-	            foreach($fams as $fam){
161
-	                $dfam = new Family($fam);
162
-	                echo '
158
+				$fams = $root->getSpouseFamilies();
159
+				($ct = count($fams)) > 1 ? $nb=1 : $nb=' ';	            
160
+				foreach($fams as $fam){
161
+					$dfam = new Family($fam);
162
+					echo '
163 163
 	                    <tr>
164 164
 	                       <td class="slabel right">
165 165
 	                           <a href="' . $fam->getHtmlUrl() . '"> '. GedcomTag::getLabel('MARR');
166
-	                if($ct > 1){
167
-	                    echo ' ',$nb;
168
-	                    $nb++;
169
-	                }
170
-	                echo '     </a>
166
+					if($ct > 1){
167
+						echo ' ',$nb;
168
+						$nb++;
169
+					}
170
+					echo '     </a>
171 171
 	                       </td>
172 172
 	                       <td class="svalue">' . FunctionsPrint::formatIsSourcedIcon('E', $dfam->isMarriageSourced(), 'MARR', 1).'</td>
173 173
 	                   </tr>';
174
-	            }
174
+				}
175 175
 	            
176
-	            if( $root->isDead() )
177
-	                echo '
176
+				if( $root->isDead() )
177
+					echo '
178 178
 	                    <tr>
179 179
 	                       <td class="slabel">' . GedcomTag::getLabel('DEAT') . '</td>
180 180
 	                       <td class="svalue">' . FunctionsPrint::formatIsSourcedIcon('E', $dindi->isDeathSourced(), 'DEAT', 1).'</td>
181 181
 	                   </tr>';
182 182
 	            
183
-	            echo '</table>';
184
-	        }
185
-	    }
186
-	    return ob_get_clean();	    
183
+				echo '</table>';
184
+			}
185
+		}
186
+		return ob_get_clean();	    
187 187
 	}
188 188
 	
189 189
 	
Please login to merge, or discard this patch.