@@ -74,16 +74,14 @@ |
||
| 74 | 74 | if(is_int($key)) { |
| 75 | 75 | $hook_item = $value; |
| 76 | 76 | $priority = self::DEFAULT_PRIORITY; |
| 77 | - } |
|
| 78 | - else{ |
|
| 77 | + } else{ |
|
| 79 | 78 | $hook_item = explode('#', $key, 2); |
| 80 | 79 | $priority = $value; |
| 81 | 80 | } |
| 82 | 81 | if($hook_item && count($hook_item) == 2){ |
| 83 | 82 | $hook_func = $hook_item[0]; |
| 84 | 83 | $hook_cont = $hook_item[1]; |
| 85 | - } |
|
| 86 | - else{ |
|
| 84 | + } else{ |
|
| 87 | 85 | $hook_func = $hook_item[0]; |
| 88 | 86 | $hook_cont = 'all'; |
| 89 | 87 | } |
@@ -80,7 +80,9 @@ discard block |
||
| 80 | 80 | * |
| 81 | 81 | */ |
| 82 | 82 | protected function checkInit(){ |
| 83 | - if(!$this->is_init) $this->init(); |
|
| 83 | + if(!$this->is_init) { |
|
| 84 | + $this->init(); |
|
| 85 | + } |
|
| 84 | 86 | } |
| 85 | 87 | |
| 86 | 88 | /** |
@@ -93,7 +95,9 @@ discard block |
||
| 93 | 95 | protected function getKeyName($value, AbstractModule $mod = null){ |
| 94 | 96 | $this->checkInit(); |
| 95 | 97 | $mod_name = 'myartjaub'; |
| 96 | - if($mod !== null) $mod_name = $mod->getName(); |
|
| 98 | + if($mod !== null) { |
|
| 99 | + $mod_name = $mod->getName(); |
|
| 100 | + } |
|
| 97 | 101 | return $mod_name.'_'.$value; |
| 98 | 102 | } |
| 99 | 103 | |
@@ -104,9 +104,12 @@ discard block |
||
| 104 | 104 | public function canDisplayIsSourced($access_level = null){ |
| 105 | 105 | global $global_facts; |
| 106 | 106 | |
| 107 | - if(!$this->gedcomrecord->canShow($access_level)) return false; |
|
| 108 | - if($access_level === null ) |
|
| 109 | - $access_level = \Fisharebest\Webtrees\Auth::accessLevel($this->gedcomrecord->getTree()); |
|
| 107 | + if(!$this->gedcomrecord->canShow($access_level)) { |
|
| 108 | + return false; |
|
| 109 | + } |
|
| 110 | + if($access_level === null ) { |
|
| 111 | + $access_level = \Fisharebest\Webtrees\Auth::accessLevel($this->gedcomrecord->getTree()); |
|
| 112 | + } |
|
| 110 | 113 | |
| 111 | 114 | if (isset($global_facts['SOUR'])) { |
| 112 | 115 | return $global_facts['SOUR'] >= $access_level; |
@@ -125,7 +128,9 @@ discard block |
||
| 125 | 128 | * @return int Level of sources |
| 126 | 129 | */ |
| 127 | 130 | public function isSourced(){ |
| 128 | - if($this->_issourced !== null) return $this->_issourced; |
|
| 131 | + if($this->_issourced !== null) { |
|
| 132 | + return $this->_issourced; |
|
| 133 | + } |
|
| 129 | 134 | $this->_issourced=-1; |
| 130 | 135 | $sourcesfacts = $this->gedcomrecord->getFacts('SOUR'); |
| 131 | 136 | foreach($sourcesfacts as $sourcefact){ |
@@ -144,7 +149,9 @@ discard block |
||
| 144 | 149 | * @return int Level of sources |
| 145 | 150 | */ |
| 146 | 151 | public function isFactSourced($eventslist){ |
| 147 | - if(empty($eventslist)) return 0; |
|
| 152 | + if(empty($eventslist)) { |
|
| 153 | + return 0; |
|
| 154 | + } |
|
| 148 | 155 | $isSourced=0; |
| 149 | 156 | $facts = $this->gedcomrecord->getFacts($eventslist); |
| 150 | 157 | foreach($facts as $fact){ |
@@ -154,8 +161,7 @@ discard block |
||
| 154 | 161 | if($tmpIsSourced != 0) { |
| 155 | 162 | if($isSourced==0) { |
| 156 | 163 | $isSourced = $tmpIsSourced; |
| 157 | - } |
|
| 158 | - else{ |
|
| 164 | + } else{ |
|
| 159 | 165 | $isSourced = max($isSourced, $tmpIsSourced); |
| 160 | 166 | } |
| 161 | 167 | } |
@@ -77,8 +77,7 @@ |
||
| 77 | 77 | $index = str_replace('%', '', $match2); |
| 78 | 78 | if(is_numeric($index) && $index >0 && $index <= $nbLevels){ |
| 79 | 79 | $displayPlace = str_replace($match2, $levels[$index-1] , $displayPlace); |
| 80 | - } |
|
| 81 | - else{ |
|
| 80 | + } else{ |
|
| 82 | 81 | $displayPlace = str_replace($match2, '' , $displayPlace); |
| 83 | 82 | } |
| 84 | 83 | } |
@@ -54,7 +54,9 @@ discard block |
||
| 54 | 54 | public function buildLineages() { |
| 55 | 55 | $indis = \Fisharebest\Webtrees\Query\QueryName::individuals($this->tree, $this->surname, null, null, false, false); |
| 56 | 56 | |
| 57 | - if(count($indis) == 0) return null; |
|
| 57 | + if(count($indis) == 0) { |
|
| 58 | + return null; |
|
| 59 | + } |
|
| 58 | 60 | |
| 59 | 61 | $root_lineages = array(); |
| 60 | 62 | |
@@ -72,12 +74,13 @@ discard block |
||
| 72 | 74 | if($indiChildFamily !== null){ |
| 73 | 75 | $root_node = new LineageRootNode(null); |
| 74 | 76 | $root_node->addFamily($indiChildFamily); |
| 75 | - } |
|
| 76 | - else{ |
|
| 77 | + } else{ |
|
| 77 | 78 | $root_node = new LineageRootNode($indiFirst); |
| 78 | 79 | } |
| 79 | 80 | $root_node = $this->buildLineage($root_node); |
| 80 | - if($root_node) $root_lineages[] = $root_node; |
|
| 81 | + if($root_node) { |
|
| 82 | + $root_lineages[] = $root_node; |
|
| 83 | + } |
|
| 81 | 84 | } |
| 82 | 85 | } |
| 83 | 86 | } |
@@ -116,23 +119,19 @@ discard block |
||
| 116 | 119 | //Check if the child is a natural child of the mother (based on the surname - Warning : surname must be identical) |
| 117 | 120 | if(!$dwife->isNewAddition() && I18N::strcasecmp($wife_surname, $indi_surname) == 0){ |
| 118 | 121 | $resIndi=$wife; |
| 119 | - } |
|
| 120 | - else{ |
|
| 122 | + } else{ |
|
| 121 | 123 | $is_first=true; |
| 122 | 124 | } |
| 123 | - } |
|
| 124 | - else{ |
|
| 125 | + } else{ |
|
| 125 | 126 | $is_first=true; |
| 126 | 127 | } |
| 127 | - } |
|
| 128 | - else{ |
|
| 128 | + } else{ |
|
| 129 | 129 | $is_first=true; |
| 130 | 130 | } |
| 131 | 131 | } |
| 132 | 132 | if(isset($this->used_indis[$resIndi->getXref()])){ |
| 133 | 133 | return null; |
| 134 | - } |
|
| 135 | - else{ |
|
| 134 | + } else{ |
|
| 136 | 135 | return $resIndi; |
| 137 | 136 | } |
| 138 | 137 | } |
@@ -145,7 +144,9 @@ discard block |
||
| 145 | 144 | * @return LineageNode Computed lineage |
| 146 | 145 | */ |
| 147 | 146 | protected function buildLineage(LineageNode $node) { |
| 148 | - if($node === null) return; |
|
| 147 | + if($node === null) { |
|
| 148 | + return; |
|
| 149 | + } |
|
| 149 | 150 | |
| 150 | 151 | $indi_surname = null; |
| 151 | 152 | |
@@ -198,7 +199,9 @@ discard block |
||
| 198 | 199 | $nbNatural++; |
| 199 | 200 | $node_child = new LineageNode($child, $node->getRootNode()); |
| 200 | 201 | $node_child = $this->buildLineage($node_child); |
| 201 | - if($node_child) $node->addChild($family, $node_child); |
|
| 202 | + if($node_child) { |
|
| 203 | + $node->addChild($family, $node_child); |
|
| 204 | + } |
|
| 202 | 205 | } |
| 203 | 206 | } |
| 204 | 207 | } |
@@ -212,12 +215,15 @@ discard block |
||
| 212 | 215 | $nbNatural++; |
| 213 | 216 | $node_child = new LineageNode($child, $node->getRootNode()); |
| 214 | 217 | $node_child = $this->buildLineage($node_child); |
| 215 | - if($node_child) $node->addChild($family, $node_child); |
|
| 216 | - } |
|
| 217 | - else { |
|
| 218 | + if($node_child) { |
|
| 219 | + $node->addChild($family, $node_child); |
|
| 220 | + } |
|
| 221 | + } else { |
|
| 218 | 222 | $nbNatural++; |
| 219 | 223 | $node_child = new LineageNode($child, $node->getRootNode(), $child_surname); |
| 220 | - if($node_child) $node->addChild($family, $node_child); |
|
| 224 | + if($node_child) { |
|
| 225 | + $node->addChild($family, $node_child); |
|
| 226 | + } |
|
| 221 | 227 | } |
| 222 | 228 | } |
| 223 | 229 | } |
@@ -88,7 +88,9 @@ |
||
| 88 | 88 | global $WT_TREE; |
| 89 | 89 | |
| 90 | 90 | $action = Filter::post('action'); |
| 91 | - if($action == 'update' && Filter::checkCsrf()) $this->update(); |
|
| 91 | + if($action == 'update' && Filter::checkCsrf()) { |
|
| 92 | + $this->update(); |
|
| 93 | + } |
|
| 92 | 94 | |
| 93 | 95 | Theme::theme(new AdministrationTheme)->init($WT_TREE); |
| 94 | 96 | $ctrl = new PageController(); |
@@ -160,7 +160,9 @@ discard block |
||
| 160 | 160 | public static function htmlIndividualForList(\Fisharebest\Webtrees\Individual $individual, $isStrong = true){ |
| 161 | 161 | $html = ''; |
| 162 | 162 | $tag = 'em'; |
| 163 | - if($isStrong) $tag = 'strong'; |
|
| 163 | + if($isStrong) { |
|
| 164 | + $tag = 'strong'; |
|
| 165 | + } |
|
| 164 | 166 | if($individual && $individual->canShow()){ |
| 165 | 167 | $dindi = new Individual($individual); |
| 166 | 168 | $html = $individual->getSexImage(); |
@@ -174,8 +176,7 @@ discard block |
||
| 174 | 176 | $html .= ' <span><small><em>'.$dindi->format_first_major_fact(WT_EVENTS_BIRT, 10).'</em></small></span>'; |
| 175 | 177 | $html .= ' <span><small><em>'.$dindi->format_first_major_fact(WT_EVENTS_DEAT, 10).'</em></small></span>'; |
| 176 | 178 | $html .= '</a>'; |
| 177 | - } |
|
| 178 | - else { |
|
| 179 | + } else { |
|
| 179 | 180 | $html .= '<span class=\"list_item\"><'.$tag.'>' . I18N::translate('Private') . '</'.$tag.'></span>'; |
| 180 | 181 | } |
| 181 | 182 | return $html; |
@@ -195,8 +196,7 @@ discard block |
||
| 195 | 196 | $date = $fact->getDate(); |
| 196 | 197 | if($date->isOK()){ |
| 197 | 198 | $html.=' '.$date->Display($anchor && !$SEARCH_SPIDER, '%Y'); |
| 198 | - } |
|
| 199 | - else{ |
|
| 199 | + } else{ |
|
| 200 | 200 | // 1 DEAT Y with no DATE => print YES |
| 201 | 201 | // 1 BIRT 2 SOUR @S1@ => print YES |
| 202 | 202 | // 1 DEAT N is not allowed |
@@ -220,7 +220,9 @@ discard block |
||
| 220 | 220 | public static function formatFactPlaceShort(\Fisharebest\Webtrees\Fact $fact, $format, $anchor=false){ |
| 221 | 221 | $html=''; |
| 222 | 222 | |
| 223 | - if ($fact === null) return $html; |
|
| 223 | + if ($fact === null) { |
|
| 224 | + return $html; |
|
| 225 | + } |
|
| 224 | 226 | $place = $fact->getPlace(); |
| 225 | 227 | if($place){ |
| 226 | 228 | $dplace = new Place($place); |
@@ -339,7 +341,9 @@ discard block |
||
| 339 | 341 | default: |
| 340 | 342 | break; |
| 341 | 343 | } |
| 342 | - if($image && $title) $html = '<i class="icon-maj-sourced-'.$size.'_'.$image.'" title="'.$title.'"></i>'; |
|
| 344 | + if($image && $title) { |
|
| 345 | + $html = '<i class="icon-maj-sourced-'.$size.'_'.$image.'" title="'.$title.'"></i>'; |
|
| 346 | + } |
|
| 343 | 347 | break; |
| 344 | 348 | default: |
| 345 | 349 | break; |
@@ -124,7 +124,9 @@ |
||
| 124 | 124 | |
| 125 | 125 | $cid = Filter::get('cid'); |
| 126 | 126 | $certificate = null; |
| 127 | - if(!empty($cid)) $certificate = Certificate::getInstance($cid, $WT_TREE, null, $this->provider); |
|
| 127 | + if(!empty($cid)) { |
|
| 128 | + $certificate = Certificate::getInstance($cid, $WT_TREE, null, $this->provider); |
|
| 129 | + } |
|
| 128 | 130 | |
| 129 | 131 | $imageBuilder = new ImageBuilder($certificate); |
| 130 | 132 | |
@@ -45,7 +45,9 @@ |
||
| 45 | 45 | * @return int Level of sources |
| 46 | 46 | * */ |
| 47 | 47 | function isMarriageSourced(){ |
| 48 | - if($this->is_marriage_sourced !== null) return $this->is_marriage_sourced; |
|
| 48 | + if($this->is_marriage_sourced !== null) { |
|
| 49 | + return $this->is_marriage_sourced; |
|
| 50 | + } |
|
| 49 | 51 | $this->is_marriage_sourced = $this->isFactSourced(WT_EVENTS_MARR.'|MARC'); |
| 50 | 52 | return $this->is_marriage_sourced; |
| 51 | 53 | } |