@@ -52,7 +52,7 @@ |
||
| 52 | 52 | /** |
| 53 | 53 | * Find the spouse of a person, using the Xref comparison. |
| 54 | 54 | * |
| 55 | - * @param Individual $person |
|
| 55 | + * @param fw\Individual $person |
|
| 56 | 56 | * |
| 57 | 57 | * @return Individual|null |
| 58 | 58 | */ |
@@ -30,10 +30,10 @@ discard block |
||
| 30 | 30 | * @param string $gedcom |
| 31 | 31 | * @return NULL|\MyArtJaub\Webtrees\Family |
| 32 | 32 | */ |
| 33 | - public static function getIntance($xref, Tree $tree, $gedcom = null){ |
|
| 33 | + public static function getIntance($xref, Tree $tree, $gedcom = null) { |
|
| 34 | 34 | $dfam = null; |
| 35 | 35 | $fam = fw\Family::getInstance($xref, $tree, $gedcom); |
| 36 | - if($fam){ |
|
| 36 | + if ($fam) { |
|
| 37 | 37 | $dfam = new Family($fam); |
| 38 | 38 | } |
| 39 | 39 | return $dfam; |
@@ -44,8 +44,8 @@ discard block |
||
| 44 | 44 | * |
| 45 | 45 | * @return int Level of sources |
| 46 | 46 | * */ |
| 47 | - function isMarriageSourced(){ |
|
| 48 | - if($this->is_marriage_sourced !== null) return $this->is_marriage_sourced; |
|
| 47 | + function isMarriageSourced() { |
|
| 48 | + if ($this->is_marriage_sourced !== null) return $this->is_marriage_sourced; |
|
| 49 | 49 | $this->is_marriage_sourced = $this->isFactSourced(WT_EVENTS_MARR.'|MARC'); |
| 50 | 50 | return $this->is_marriage_sourced; |
| 51 | 51 | } |
@@ -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 | } |
@@ -40,10 +40,10 @@ |
||
| 40 | 40 | } |
| 41 | 41 | |
| 42 | 42 | /** |
| 43 | - * Check if this family's marriages are sourced |
|
| 44 | - * |
|
| 45 | - * @return int Level of sources |
|
| 46 | - * */ |
|
| 43 | + * Check if this family's marriages are sourced |
|
| 44 | + * |
|
| 45 | + * @return int Level of sources |
|
| 46 | + * */ |
|
| 47 | 47 | function isMarriageSourced(){ |
| 48 | 48 | if($this->is_marriage_sourced !== null) return $this->is_marriage_sourced; |
| 49 | 49 | $this->is_marriage_sourced = $this->isFactSourced(WT_EVENTS_MARR.'|MARC'); |
@@ -74,7 +74,7 @@ discard block |
||
| 74 | 74 | * |
| 75 | 75 | * @param \Fisharebest\Webtrees\Place $place |
| 76 | 76 | * @param string $icon_path |
| 77 | - * @param number $size |
|
| 77 | + * @param integer $size |
|
| 78 | 78 | * @return string HTML code of the inserted flag |
| 79 | 79 | */ |
| 80 | 80 | public static function htmlPlaceIcon(\Fisharebest\Webtrees\Place $place, $icon_path , $size = 50) { |
@@ -184,7 +184,6 @@ discard block |
||
| 184 | 184 | /** |
| 185 | 185 | * Format date to display short (just years) |
| 186 | 186 | * |
| 187 | - * @param \Fisharebest\Webtrees\Fact $eventObj Fact to display date |
|
| 188 | 187 | * @param boolean $anchor option to print a link to calendar |
| 189 | 188 | * @return string HTML code for short date |
| 190 | 189 | */ |
@@ -212,7 +211,6 @@ discard block |
||
| 212 | 211 | /** |
| 213 | 212 | * Format fact place to display short |
| 214 | 213 | * |
| 215 | - * @param \Fisharebest\Webtrees\Fact $eventObj Fact to display date |
|
| 216 | 214 | * @param string $format Format of the place |
| 217 | 215 | * @param boolean $anchor option to print a link to placelist |
| 218 | 216 | * @return string HTML code for short place |
@@ -79,7 +79,7 @@ discard block |
||
| 79 | 79 | * @return string HTML code of the inserted flag |
| 80 | 80 | */ |
| 81 | 81 | public static function htmlPlaceIcon(\Fisharebest\Webtrees\Place $place, $icon_path , $size = 50) { |
| 82 | - return '<img class="flag_gm_h'. $size . '" src="' . $icon_path . '" title="' . $place->getGedcomName() . '" alt="' . $place->getGedcomName() . '" />'; |
|
| 82 | + return '<img class="flag_gm_h'. $size . '" src="' . $icon_path . '" title="' . $place->getGedcomName() . '" alt="' . $place->getGedcomName() . '" />'; |
|
| 83 | 83 | } |
| 84 | 84 | |
| 85 | 85 | /** |
@@ -355,7 +355,7 @@ discard block |
||
| 355 | 355 | * @return boolean |
| 356 | 356 | */ |
| 357 | 357 | public static function isDateWithinChartsRange(Date $date) { |
| 358 | - return $date->gregorianYear() >= 1550 && $date->gregorianYear() < 2030; |
|
| 358 | + return $date->gregorianYear() >= 1550 && $date->gregorianYear() < 2030; |
|
| 359 | 359 | } |
| 360 | 360 | |
| 361 | 361 | } |
@@ -32,7 +32,7 @@ discard block |
||
| 32 | 32 | * @return string List of elements |
| 33 | 33 | */ |
| 34 | 34 | public static function getListFromArray(array $array) { |
| 35 | - $n=count($array); |
|
| 35 | + $n = count($array); |
|
| 36 | 36 | switch ($n) { |
| 37 | 37 | case 0: |
| 38 | 38 | return ''; |
@@ -41,10 +41,10 @@ discard block |
||
| 41 | 41 | default: |
| 42 | 42 | return implode( |
| 43 | 43 | /* I18N: list separator */ I18N::translate(', '), |
| 44 | - array_slice($array, 0, $n-1) |
|
| 45 | - ) . |
|
| 46 | - /* I18N: last list separator, " and " in English, " et " in French */ I18N::translate(' and ') . |
|
| 47 | - $array[$n-1]; |
|
| 44 | + array_slice($array, 0, $n - 1) |
|
| 45 | + ). |
|
| 46 | + /* I18N: last list separator, " and " in English, " et " in French */ I18N::translate(' and '). |
|
| 47 | + $array[$n - 1]; |
|
| 48 | 48 | } |
| 49 | 49 | } |
| 50 | 50 | |
@@ -60,10 +60,10 @@ discard block |
||
| 60 | 60 | \MyArtJaub\Webtrees\Map\MapProviderInterface $mapProvider |
| 61 | 61 | ) { |
| 62 | 62 | $place = $fact->getPlace(); |
| 63 | - if(!$place->isEmpty()) { |
|
| 64 | - $iconPlace= $mapProvider->getPlaceIcon($place); |
|
| 65 | - if($iconPlace && strlen($iconPlace) > 0){ |
|
| 66 | - return '<div class="fact_flag">'. self::htmlPlaceIcon($place, $iconPlace, 50). '</div>'; |
|
| 63 | + if (!$place->isEmpty()) { |
|
| 64 | + $iconPlace = $mapProvider->getPlaceIcon($place); |
|
| 65 | + if ($iconPlace && strlen($iconPlace) > 0) { |
|
| 66 | + return '<div class="fact_flag">'.self::htmlPlaceIcon($place, $iconPlace, 50).'</div>'; |
|
| 67 | 67 | } |
| 68 | 68 | } |
| 69 | 69 | return ''; |
@@ -77,8 +77,8 @@ discard block |
||
| 77 | 77 | * @param number $size |
| 78 | 78 | * @return string HTML code of the inserted flag |
| 79 | 79 | */ |
| 80 | - public static function htmlPlaceIcon(\Fisharebest\Webtrees\Place $place, $icon_path , $size = 50) { |
|
| 81 | - return '<img class="flag_gm_h'. $size . '" src="' . $icon_path . '" title="' . $place->getGedcomName() . '" alt="' . $place->getGedcomName() . '" />'; |
|
| 80 | + public static function htmlPlaceIcon(\Fisharebest\Webtrees\Place $place, $icon_path, $size = 50) { |
|
| 81 | + return '<img class="flag_gm_h'.$size.'" src="'.$icon_path.'" title="'.$place->getGedcomName().'" alt="'.$place->getGedcomName().'" />'; |
|
| 82 | 82 | } |
| 83 | 83 | |
| 84 | 84 | /** |
@@ -96,7 +96,7 @@ discard block |
||
| 96 | 96 | $minimum = PHP_INT_MAX; |
| 97 | 97 | $maximum = 1; |
| 98 | 98 | foreach ($list as $params) { |
| 99 | - if(array_key_exists('count', $params)) { |
|
| 99 | + if (array_key_exists('count', $params)) { |
|
| 100 | 100 | $maximum = max($maximum, $params['count']); |
| 101 | 101 | $minimum = min($minimum, $params['count']); |
| 102 | 102 | } |
@@ -114,15 +114,15 @@ discard block |
||
| 114 | 114 | $size = 75.0 + 125.0 * ($count - $minimum) / ($maximum - $minimum); |
| 115 | 115 | } |
| 116 | 116 | |
| 117 | - $html .= '<a style="font-size:' . $size . '%" href="' . $url . '">'; |
|
| 117 | + $html .= '<a style="font-size:'.$size.'%" href="'.$url.'">'; |
|
| 118 | 118 | if ($totals) { |
| 119 | - $html .= I18N::translate('%1$s (%2$s)', '<span dir="auto">' . $text . '</span>', I18N::number($count)); |
|
| 119 | + $html .= I18N::translate('%1$s (%2$s)', '<span dir="auto">'.$text.'</span>', I18N::number($count)); |
|
| 120 | 120 | } else { |
| 121 | 121 | $html .= $text; |
| 122 | 122 | } |
| 123 | 123 | $html .= '</a>'; |
| 124 | 124 | } |
| 125 | - return '<div class="tag_cloud">' . $html . '</div>'; |
|
| 125 | + return '<div class="tag_cloud">'.$html.'</div>'; |
|
| 126 | 126 | } |
| 127 | 127 | |
| 128 | 128 | |
@@ -157,11 +157,11 @@ discard block |
||
| 157 | 157 | * @param bool $isStrong Bolden the name ? |
| 158 | 158 | * @return string HTML Code for individual item |
| 159 | 159 | */ |
| 160 | - public static function htmlIndividualForList(\Fisharebest\Webtrees\Individual $individual, $isStrong = true){ |
|
| 160 | + public static function htmlIndividualForList(\Fisharebest\Webtrees\Individual $individual, $isStrong = true) { |
|
| 161 | 161 | $html = ''; |
| 162 | 162 | $tag = 'em'; |
| 163 | - if($isStrong) $tag = 'strong'; |
|
| 164 | - if($individual && $individual->canShow()){ |
|
| 163 | + if ($isStrong) $tag = 'strong'; |
|
| 164 | + if ($individual && $individual->canShow()) { |
|
| 165 | 165 | $dindi = new Individual($individual); |
| 166 | 166 | $html = $individual->getSexImage(); |
| 167 | 167 | $html .= '<a class="list_item" href="'. |
@@ -176,7 +176,7 @@ discard block |
||
| 176 | 176 | $html .= '</a>'; |
| 177 | 177 | } |
| 178 | 178 | else { |
| 179 | - $html .= '<span class=\"list_item\"><'.$tag.'>' . I18N::translate('Private') . '</'.$tag.'></span>'; |
|
| 179 | + $html .= '<span class=\"list_item\"><'.$tag.'>'.I18N::translate('Private').'</'.$tag.'></span>'; |
|
| 180 | 180 | } |
| 181 | 181 | return $html; |
| 182 | 182 | } |
@@ -188,20 +188,20 @@ discard block |
||
| 188 | 188 | * @param boolean $anchor option to print a link to calendar |
| 189 | 189 | * @return string HTML code for short date |
| 190 | 190 | */ |
| 191 | - public static function formatFactDateShort(\Fisharebest\Webtrees\Fact $fact, $anchor=false) { |
|
| 192 | - $html=''; |
|
| 191 | + public static function formatFactDateShort(\Fisharebest\Webtrees\Fact $fact, $anchor = false) { |
|
| 192 | + $html = ''; |
|
| 193 | 193 | $date = $fact->getDate(); |
| 194 | - if($date->isOK()){ |
|
| 195 | - $html.=' '.$date->Display($anchor && !Globals::isSearchSpider(), '%Y'); |
|
| 194 | + if ($date->isOK()) { |
|
| 195 | + $html .= ' '.$date->Display($anchor && !Globals::isSearchSpider(), '%Y'); |
|
| 196 | 196 | } |
| 197 | - else{ |
|
| 197 | + else { |
|
| 198 | 198 | // 1 DEAT Y with no DATE => print YES |
| 199 | 199 | // 1 BIRT 2 SOUR @S1@ => print YES |
| 200 | 200 | // 1 DEAT N is not allowed |
| 201 | 201 | // It is not proper GEDCOM form to use a N(o) value with an event tag to infer that it did not happen. |
| 202 | 202 | $factdetail = explode(' ', trim($fact->getGedcom())); |
| 203 | 203 | if (isset($factdetail) && (count($factdetail) == 3 && strtoupper($factdetail[2]) == 'Y') || (count($factdetail) == 4 && $factdetail[2] == 'SOUR')) { |
| 204 | - $html.=I18N::translate('yes'); |
|
| 204 | + $html .= I18N::translate('yes'); |
|
| 205 | 205 | } |
| 206 | 206 | } |
| 207 | 207 | return $html; |
@@ -215,12 +215,12 @@ discard block |
||
| 215 | 215 | * @param boolean $anchor option to print a link to placelist |
| 216 | 216 | * @return string HTML code for short place |
| 217 | 217 | */ |
| 218 | - public static function formatFactPlaceShort(\Fisharebest\Webtrees\Fact $fact, $format, $anchor=false){ |
|
| 219 | - $html=''; |
|
| 218 | + public static function formatFactPlaceShort(\Fisharebest\Webtrees\Fact $fact, $format, $anchor = false) { |
|
| 219 | + $html = ''; |
|
| 220 | 220 | |
| 221 | 221 | if ($fact === null) return $html; |
| 222 | 222 | $place = $fact->getPlace(); |
| 223 | - if($place){ |
|
| 223 | + if ($place) { |
|
| 224 | 224 | $dplace = new Place($place); |
| 225 | 225 | $html .= $dplace->htmlFormattedName($format, $anchor); |
| 226 | 226 | } |
@@ -238,21 +238,21 @@ discard block |
||
| 238 | 238 | * @param string $size CSS size for the icon. A CSS style css_$size is required |
| 239 | 239 | * @return string HTML code for the formatted Sosa numbers |
| 240 | 240 | */ |
| 241 | - public static function formatSosaNumbers(array $sosatab, $format = 1, $size = 'small'){ |
|
| 241 | + public static function formatSosaNumbers(array $sosatab, $format = 1, $size = 'small') { |
|
| 242 | 242 | $html = ''; |
| 243 | - switch($format){ |
|
| 243 | + switch ($format) { |
|
| 244 | 244 | case 1: |
| 245 | - if(count($sosatab)>0){ |
|
| 245 | + if (count($sosatab) > 0) { |
|
| 246 | 246 | $html = '<i class="icon-maj-sosa_'.$size.'" title="'.I18N::translate('Sosa').'"></i>'; |
| 247 | 247 | } |
| 248 | 248 | break; |
| 249 | 249 | case 2: |
| 250 | - if(count($sosatab)>0){ |
|
| 250 | + if (count($sosatab) > 0) { |
|
| 251 | 251 | ksort($sosatab); |
| 252 | 252 | $tmp_html = array(); |
| 253 | 253 | foreach ($sosatab as $sosa => $gen) { |
| 254 | 254 | $tmp_html[] = sprintf( |
| 255 | - '<i class="icon-maj-sosa_%1$s" title="'.I18N::translate('Sosa').'"></i> <strong>%2$d '.I18N::translate('(G%s)', $gen) .'</strong>', |
|
| 255 | + '<i class="icon-maj-sosa_%1$s" title="'.I18N::translate('Sosa').'"></i> <strong>%2$d '.I18N::translate('(G%s)', $gen).'</strong>', |
|
| 256 | 256 | $size, |
| 257 | 257 | $sosa |
| 258 | 258 | ); |
@@ -278,15 +278,15 @@ discard block |
||
| 278 | 278 | * @param string $size CSS size for the icon. A CSS style css_$size is required |
| 279 | 279 | * @return string HTML code for IsSourced icon |
| 280 | 280 | */ |
| 281 | - public static function formatIsSourcedIcon($sourceType, $isSourced, $tag='EVEN', $format = 1, $size='normal'){ |
|
| 282 | - $html=''; |
|
| 283 | - $image=null; |
|
| 284 | - $title=null; |
|
| 285 | - switch($format){ |
|
| 281 | + public static function formatIsSourcedIcon($sourceType, $isSourced, $tag = 'EVEN', $format = 1, $size = 'normal') { |
|
| 282 | + $html = ''; |
|
| 283 | + $image = null; |
|
| 284 | + $title = null; |
|
| 285 | + switch ($format) { |
|
| 286 | 286 | case 1: |
| 287 | - switch($sourceType){ |
|
| 287 | + switch ($sourceType) { |
|
| 288 | 288 | case 'E': |
| 289 | - switch($isSourced){ |
|
| 289 | + switch ($isSourced) { |
|
| 290 | 290 | case 0: |
| 291 | 291 | $image = 'event_unknown'; |
| 292 | 292 | $title = I18N::translate('%s not found', GedcomTag::getLabel($tag)); |
@@ -316,7 +316,7 @@ discard block |
||
| 316 | 316 | } |
| 317 | 317 | break; |
| 318 | 318 | case 'R': |
| 319 | - switch($isSourced){ |
|
| 319 | + switch ($isSourced) { |
|
| 320 | 320 | case -1: |
| 321 | 321 | $image = 'record_notsourced'; |
| 322 | 322 | $title = I18N::translate('%s not sourced', GedcomTag::getLabel($tag)); |
@@ -336,7 +336,7 @@ discard block |
||
| 336 | 336 | default: |
| 337 | 337 | break; |
| 338 | 338 | } |
| 339 | - if($image && $title) $html = '<i class="icon-maj-sourced-'.$size.'_'.$image.'" title="'.$title.'"></i>'; |
|
| 339 | + if ($image && $title) $html = '<i class="icon-maj-sourced-'.$size.'_'.$image.'" title="'.$title.'"></i>'; |
|
| 340 | 340 | break; |
| 341 | 341 | default: |
| 342 | 342 | break; |
@@ -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->formatFirstMajorFact(WT_EVENTS_BIRT, 10).'</em></small></span>'; |
| 175 | 177 | $html .= ' <span><small><em>'.$dindi->formatFirstMajorFact(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; |
@@ -193,8 +194,7 @@ discard block |
||
| 193 | 194 | $date = $fact->getDate(); |
| 194 | 195 | if($date->isOK()){ |
| 195 | 196 | $html.=' '.$date->Display($anchor && !Globals::isSearchSpider(), '%Y'); |
| 196 | - } |
|
| 197 | - else{ |
|
| 197 | + } else{ |
|
| 198 | 198 | // 1 DEAT Y with no DATE => print YES |
| 199 | 199 | // 1 BIRT 2 SOUR @S1@ => print YES |
| 200 | 200 | // 1 DEAT N is not allowed |
@@ -218,7 +218,9 @@ discard block |
||
| 218 | 218 | public static function formatFactPlaceShort(\Fisharebest\Webtrees\Fact $fact, $format, $anchor=false){ |
| 219 | 219 | $html=''; |
| 220 | 220 | |
| 221 | - if ($fact === null) return $html; |
|
| 221 | + if ($fact === null) { |
|
| 222 | + return $html; |
|
| 223 | + } |
|
| 222 | 224 | $place = $fact->getPlace(); |
| 223 | 225 | if($place){ |
| 224 | 226 | $dplace = new Place($place); |
@@ -336,7 +338,9 @@ discard block |
||
| 336 | 338 | default: |
| 337 | 339 | break; |
| 338 | 340 | } |
| 339 | - if($image && $title) $html = '<i class="icon-maj-sourced-'.$size.'_'.$image.'" title="'.$title.'"></i>'; |
|
| 341 | + if($image && $title) { |
|
| 342 | + $html = '<i class="icon-maj-sourced-'.$size.'_'.$image.'" title="'.$title.'"></i>'; |
|
| 343 | + } |
|
| 340 | 344 | break; |
| 341 | 345 | default: |
| 342 | 346 | break; |
@@ -93,7 +93,7 @@ discard block |
||
| 93 | 93 | * Returns an estimated birth place based on statistics on the base |
| 94 | 94 | * |
| 95 | 95 | * @param boolean $perc Should the coefficient of reliability be returned |
| 96 | - * @return string|array Estimated birth place if found, null otherwise |
|
| 96 | + * @return string Estimated birth place if found, null otherwise |
|
| 97 | 97 | */ |
| 98 | 98 | public function getEstimatedBirthPlace($perc=false){ |
| 99 | 99 | if($bplace = $this->gedcomrecord->getBirthPlace()){ |
@@ -110,7 +110,6 @@ discard block |
||
| 110 | 110 | /** |
| 111 | 111 | * Returns a significant place for the individual |
| 112 | 112 | * |
| 113 | - * @param boolean $perc Should the coefficient of reliability be returned |
|
| 114 | 113 | * @return string|array Estimated birth place if found, null otherwise |
| 115 | 114 | */ |
| 116 | 115 | public function getSignificantPlace(){ |
@@ -113,29 +113,29 @@ discard block |
||
| 113 | 113 | * @return string|array Estimated birth place if found, null otherwise |
| 114 | 114 | */ |
| 115 | 115 | public function getSignificantPlace(){ |
| 116 | - if($bplace = $this->gedcomrecord->getBirthPlace()){ |
|
| 117 | - return $bplace; |
|
| 118 | - } |
|
| 116 | + if($bplace = $this->gedcomrecord->getBirthPlace()){ |
|
| 117 | + return $bplace; |
|
| 118 | + } |
|
| 119 | 119 | |
| 120 | - foreach ($this->gedcomrecord->getAllEventPlaces('RESI') as $rplace) { |
|
| 121 | - if ($rplace) { |
|
| 122 | - return $rplace; |
|
| 123 | - } |
|
| 124 | - } |
|
| 120 | + foreach ($this->gedcomrecord->getAllEventPlaces('RESI') as $rplace) { |
|
| 121 | + if ($rplace) { |
|
| 122 | + return $rplace; |
|
| 123 | + } |
|
| 124 | + } |
|
| 125 | 125 | |
| 126 | - if($dplace = $this->gedcomrecord->getDeathPlace()){ |
|
| 127 | - return $dplace; |
|
| 128 | - } |
|
| 126 | + if($dplace = $this->gedcomrecord->getDeathPlace()){ |
|
| 127 | + return $dplace; |
|
| 128 | + } |
|
| 129 | 129 | |
| 130 | - foreach($this->gedcomrecord->getSpouseFamilies() as $fams) { |
|
| 131 | - foreach ($fams->getAllEventPlaces('RESI') as $rplace) { |
|
| 132 | - if ($rplace) { |
|
| 133 | - return $rplace; |
|
| 134 | - } |
|
| 135 | - } |
|
| 136 | - } |
|
| 130 | + foreach($this->gedcomrecord->getSpouseFamilies() as $fams) { |
|
| 131 | + foreach ($fams->getAllEventPlaces('RESI') as $rplace) { |
|
| 132 | + if ($rplace) { |
|
| 133 | + return $rplace; |
|
| 134 | + } |
|
| 135 | + } |
|
| 136 | + } |
|
| 137 | 137 | |
| 138 | - return null; |
|
| 138 | + return null; |
|
| 139 | 139 | } |
| 140 | 140 | |
| 141 | 141 | /** |
@@ -144,7 +144,7 @@ discard block |
||
| 144 | 144 | * @return boolean Is the individual a Sosa ancestor |
| 145 | 145 | */ |
| 146 | 146 | public function isSosa(){ |
| 147 | - return count($this->getSosaNumbers()) > 0; |
|
| 147 | + return count($this->getSosaNumbers()) > 0; |
|
| 148 | 148 | } |
| 149 | 149 | |
| 150 | 150 | /** |
@@ -155,11 +155,11 @@ discard block |
||
| 155 | 155 | * @return array List of Sosa numbers |
| 156 | 156 | */ |
| 157 | 157 | public function getSosaNumbers(){ |
| 158 | - if($this->sosa === null) { |
|
| 159 | - $provider = new SosaProvider($this->gedcomrecord->getTree()); |
|
| 160 | - $this->sosa = $provider->getSosaNumbers($this->gedcomrecord); |
|
| 161 | - } |
|
| 162 | - return $this->sosa; |
|
| 158 | + if($this->sosa === null) { |
|
| 159 | + $provider = new SosaProvider($this->gedcomrecord->getTree()); |
|
| 160 | + $this->sosa = $provider->getSosaNumbers($this->gedcomrecord); |
|
| 161 | + } |
|
| 162 | + return $this->sosa; |
|
| 163 | 163 | } |
| 164 | 164 | |
| 165 | 165 | /** |
@@ -174,10 +174,10 @@ discard block |
||
| 174 | 174 | } |
| 175 | 175 | |
| 176 | 176 | /** |
| 177 | - * Check if this individual's death is sourced |
|
| 178 | - * |
|
| 179 | - * @return int Level of sources |
|
| 180 | - * */ |
|
| 177 | + * Check if this individual's death is sourced |
|
| 178 | + * |
|
| 179 | + * @return int Level of sources |
|
| 180 | + * */ |
|
| 181 | 181 | public function isDeathSourced(){ |
| 182 | 182 | if($this->is_death_sourced !== null) return $this->is_death_sourced; |
| 183 | 183 | $this->is_death_sourced = $this->isFactSourced(WT_EVENTS_DEAT); |
@@ -21,7 +21,7 @@ discard block |
||
| 21 | 21 | class Individual extends GedcomRecord { |
| 22 | 22 | |
| 23 | 23 | /** @var array|null List of titles the individal holds */ |
| 24 | - protected $titles=null; |
|
| 24 | + protected $titles = null; |
|
| 25 | 25 | |
| 26 | 26 | /** @var string|null Individual's primary surname, without any privacy applied to it */ |
| 27 | 27 | protected $unprotected_prim_surname = null; |
@@ -43,9 +43,9 @@ discard block |
||
| 43 | 43 | * @param null|string $gedcom |
| 44 | 44 | * @return null|Individual |
| 45 | 45 | */ |
| 46 | - public static function getIntance($xref, Tree $tree, $gedcom = null){ |
|
| 46 | + public static function getIntance($xref, Tree $tree, $gedcom = null) { |
|
| 47 | 47 | $indi = \Fisharebest\Webtrees\Individual::getInstance($xref, $tree, $gedcom); |
| 48 | - if($indi){ |
|
| 48 | + if ($indi) { |
|
| 49 | 49 | return new Individual($indi); |
| 50 | 50 | } |
| 51 | 51 | return null; |
@@ -56,18 +56,18 @@ discard block |
||
| 56 | 56 | * |
| 57 | 57 | * @return array Array of titles |
| 58 | 58 | */ |
| 59 | - public function getTitles(){ |
|
| 60 | - if(is_null($this->titles) && $module = Module::getModuleByName(Constants::MODULE_MAJ_MISC_NAME)){ |
|
| 59 | + public function getTitles() { |
|
| 60 | + if (is_null($this->titles) && $module = Module::getModuleByName(Constants::MODULE_MAJ_MISC_NAME)) { |
|
| 61 | 61 | $pattern = '/(.*) (('.$module->getSetting('MAJ_TITLE_PREFIX', '').')(.*))/'; |
| 62 | - $this->titles=array(); |
|
| 62 | + $this->titles = array(); |
|
| 63 | 63 | $titlefacts = $this->gedcomrecord->getFacts('TITL'); |
| 64 | - foreach($titlefacts as $titlefact){ |
|
| 64 | + foreach ($titlefacts as $titlefact) { |
|
| 65 | 65 | $ct2 = preg_match_all($pattern, $titlefact->getValue(), $match2); |
| 66 | - if($ct2>0){ |
|
| 67 | - $this->titles[$match2[1][0]][]= trim($match2[2][0]); |
|
| 66 | + if ($ct2 > 0) { |
|
| 67 | + $this->titles[$match2[1][0]][] = trim($match2[2][0]); |
|
| 68 | 68 | } |
| 69 | - else{ |
|
| 70 | - $this->titles[$titlefact->getValue()][]=''; |
|
| 69 | + else { |
|
| 70 | + $this->titles[$titlefact->getValue()][] = ''; |
|
| 71 | 71 | } |
| 72 | 72 | } |
| 73 | 73 | } |
@@ -81,8 +81,8 @@ discard block |
||
| 81 | 81 | * @return string Primary surname |
| 82 | 82 | */ |
| 83 | 83 | public function getUnprotectedPrimarySurname() { |
| 84 | - if(!$this->unprotected_prim_surname){ |
|
| 85 | - $tmp=$this->gedcomrecord->getAllNames(); |
|
| 84 | + if (!$this->unprotected_prim_surname) { |
|
| 85 | + $tmp = $this->gedcomrecord->getAllNames(); |
|
| 86 | 86 | $this->unprotected_prim_surname = $tmp[$this->gedcomrecord->getPrimaryName()]['surname']; |
| 87 | 87 | } |
| 88 | 88 | return $this->unprotected_prim_surname; |
@@ -94,12 +94,12 @@ discard block |
||
| 94 | 94 | * @param boolean $perc Should the coefficient of reliability be returned |
| 95 | 95 | * @return string|array Estimated birth place if found, null otherwise |
| 96 | 96 | */ |
| 97 | - public function getEstimatedBirthPlace($perc=false){ |
|
| 98 | - if($bplace = $this->gedcomrecord->getBirthPlace()){ |
|
| 99 | - if($perc){ |
|
| 100 | - return array ($bplace, 1); |
|
| 97 | + public function getEstimatedBirthPlace($perc = false) { |
|
| 98 | + if ($bplace = $this->gedcomrecord->getBirthPlace()) { |
|
| 99 | + if ($perc) { |
|
| 100 | + return array($bplace, 1); |
|
| 101 | 101 | } |
| 102 | - else{ |
|
| 102 | + else { |
|
| 103 | 103 | return $bplace; |
| 104 | 104 | } |
| 105 | 105 | } |
@@ -112,8 +112,8 @@ discard block |
||
| 112 | 112 | * @param boolean $perc Should the coefficient of reliability be returned |
| 113 | 113 | * @return string|array Estimated birth place if found, null otherwise |
| 114 | 114 | */ |
| 115 | - public function getSignificantPlace(){ |
|
| 116 | - if($bplace = $this->gedcomrecord->getBirthPlace()){ |
|
| 115 | + public function getSignificantPlace() { |
|
| 116 | + if ($bplace = $this->gedcomrecord->getBirthPlace()) { |
|
| 117 | 117 | return $bplace; |
| 118 | 118 | } |
| 119 | 119 | |
@@ -123,11 +123,11 @@ discard block |
||
| 123 | 123 | } |
| 124 | 124 | } |
| 125 | 125 | |
| 126 | - if($dplace = $this->gedcomrecord->getDeathPlace()){ |
|
| 126 | + if ($dplace = $this->gedcomrecord->getDeathPlace()) { |
|
| 127 | 127 | return $dplace; |
| 128 | 128 | } |
| 129 | 129 | |
| 130 | - foreach($this->gedcomrecord->getSpouseFamilies() as $fams) { |
|
| 130 | + foreach ($this->gedcomrecord->getSpouseFamilies() as $fams) { |
|
| 131 | 131 | foreach ($fams->getAllEventPlaces('RESI') as $rplace) { |
| 132 | 132 | if ($rplace) { |
| 133 | 133 | return $rplace; |
@@ -143,7 +143,7 @@ discard block |
||
| 143 | 143 | * |
| 144 | 144 | * @return boolean Is the individual a Sosa ancestor |
| 145 | 145 | */ |
| 146 | - public function isSosa(){ |
|
| 146 | + public function isSosa() { |
|
| 147 | 147 | return count($this->getSosaNumbers()) > 0; |
| 148 | 148 | } |
| 149 | 149 | |
@@ -154,8 +154,8 @@ discard block |
||
| 154 | 154 | * @uses \MyArtJaub\Webtrees\Functions\ModuleManager |
| 155 | 155 | * @return array List of Sosa numbers |
| 156 | 156 | */ |
| 157 | - public function getSosaNumbers(){ |
|
| 158 | - if($this->sosa === null) { |
|
| 157 | + public function getSosaNumbers() { |
|
| 158 | + if ($this->sosa === null) { |
|
| 159 | 159 | $provider = new SosaProvider($this->gedcomrecord->getTree()); |
| 160 | 160 | $this->sosa = $provider->getSosaNumbers($this->gedcomrecord); |
| 161 | 161 | } |
@@ -167,8 +167,8 @@ discard block |
||
| 167 | 167 | * |
| 168 | 168 | * @return int Level of sources |
| 169 | 169 | * */ |
| 170 | - public function isBirthSourced(){ |
|
| 171 | - if($this->is_birth_sourced !== null) return $this->is_birth_sourced; |
|
| 170 | + public function isBirthSourced() { |
|
| 171 | + if ($this->is_birth_sourced !== null) return $this->is_birth_sourced; |
|
| 172 | 172 | $this->is_birth_sourced = $this->isFactSourced(WT_EVENTS_BIRT); |
| 173 | 173 | return $this->is_birth_sourced; |
| 174 | 174 | } |
@@ -178,8 +178,8 @@ discard block |
||
| 178 | 178 | * |
| 179 | 179 | * @return int Level of sources |
| 180 | 180 | * */ |
| 181 | - public function isDeathSourced(){ |
|
| 182 | - if($this->is_death_sourced !== null) return $this->is_death_sourced; |
|
| 181 | + public function isDeathSourced() { |
|
| 182 | + if ($this->is_death_sourced !== null) return $this->is_death_sourced; |
|
| 183 | 183 | $this->is_death_sourced = $this->isFactSourced(WT_EVENTS_DEAT); |
| 184 | 184 | return $this->is_death_sourced; |
| 185 | 185 | } |
@@ -65,8 +65,7 @@ discard block |
||
| 65 | 65 | $ct2 = preg_match_all($pattern, $titlefact->getValue(), $match2); |
| 66 | 66 | if($ct2>0){ |
| 67 | 67 | $this->titles[$match2[1][0]][]= trim($match2[2][0]); |
| 68 | - } |
|
| 69 | - else{ |
|
| 68 | + } else{ |
|
| 70 | 69 | $this->titles[$titlefact->getValue()][]=''; |
| 71 | 70 | } |
| 72 | 71 | } |
@@ -98,8 +97,7 @@ discard block |
||
| 98 | 97 | if($bplace = $this->gedcomrecord->getBirthPlace()){ |
| 99 | 98 | if($perc){ |
| 100 | 99 | return array ($bplace, 1); |
| 101 | - } |
|
| 102 | - else{ |
|
| 100 | + } else{ |
|
| 103 | 101 | return $bplace; |
| 104 | 102 | } |
| 105 | 103 | } |
@@ -168,7 +166,9 @@ discard block |
||
| 168 | 166 | * @return int Level of sources |
| 169 | 167 | * */ |
| 170 | 168 | public function isBirthSourced(){ |
| 171 | - if($this->is_birth_sourced !== null) return $this->is_birth_sourced; |
|
| 169 | + if($this->is_birth_sourced !== null) { |
|
| 170 | + return $this->is_birth_sourced; |
|
| 171 | + } |
|
| 172 | 172 | $this->is_birth_sourced = $this->isFactSourced(WT_EVENTS_BIRT); |
| 173 | 173 | return $this->is_birth_sourced; |
| 174 | 174 | } |
@@ -179,7 +179,9 @@ discard block |
||
| 179 | 179 | * @return int Level of sources |
| 180 | 180 | * */ |
| 181 | 181 | public function isDeathSourced(){ |
| 182 | - if($this->is_death_sourced !== null) return $this->is_death_sourced; |
|
| 182 | + if($this->is_death_sourced !== null) { |
|
| 183 | + return $this->is_death_sourced; |
|
| 184 | + } |
|
| 183 | 185 | $this->is_death_sourced = $this->isFactSourced(WT_EVENTS_DEAT); |
| 184 | 186 | return $this->is_death_sourced; |
| 185 | 187 | } |
@@ -110,7 +110,7 @@ |
||
| 110 | 110 | * Set parameters of the Task |
| 111 | 111 | * |
| 112 | 112 | * @param bool $is_enabled Status of the task |
| 113 | - * @param \DateTime $lastupdated Time of the last task run |
|
| 113 | + * @param \DateTime $last_updated Time of the last task run |
|
| 114 | 114 | * @param bool $last_result Result of the last run, true for success, false for failure |
| 115 | 115 | * @param int $frequency Frequency of execution in minutes |
| 116 | 116 | * @param int $nb_occur Number of remaining occurrences, 0 for tasks not limited |
@@ -20,253 +20,253 @@ |
||
| 20 | 20 | */ |
| 21 | 21 | abstract class AbstractTask { |
| 22 | 22 | |
| 23 | - /** |
|
| 24 | - * Time out for runnign tasks, in seconds. Default 5 min |
|
| 25 | - * @var int TASK_TIME_OUT |
|
| 26 | - */ |
|
| 27 | - const TASK_TIME_OUT = 300; |
|
| 23 | + /** |
|
| 24 | + * Time out for runnign tasks, in seconds. Default 5 min |
|
| 25 | + * @var int TASK_TIME_OUT |
|
| 26 | + */ |
|
| 27 | + const TASK_TIME_OUT = 300; |
|
| 28 | 28 | |
| 29 | - /** |
|
| 30 | - * Task provider |
|
| 31 | - * @var TaskProviderInterface $provider |
|
| 32 | - */ |
|
| 29 | + /** |
|
| 30 | + * Task provider |
|
| 31 | + * @var TaskProviderInterface $provider |
|
| 32 | + */ |
|
| 33 | 33 | protected $provider; |
| 34 | 34 | |
| 35 | 35 | /** |
| 36 | 36 | * Task name |
| 37 | 37 | * @var string $name |
| 38 | 38 | */ |
| 39 | - protected $name; |
|
| 39 | + protected $name; |
|
| 40 | 40 | |
| 41 | - /** |
|
| 42 | - * Status of the task |
|
| 43 | - * @var bool $is_enabled |
|
| 44 | - */ |
|
| 45 | - protected $is_enabled; |
|
| 41 | + /** |
|
| 42 | + * Status of the task |
|
| 43 | + * @var bool $is_enabled |
|
| 44 | + */ |
|
| 45 | + protected $is_enabled; |
|
| 46 | 46 | |
| 47 | - /** |
|
| 48 | - * Last updated date |
|
| 49 | - * @var \DateTime $last_updated |
|
| 50 | - */ |
|
| 51 | - protected $last_updated; |
|
| 47 | + /** |
|
| 48 | + * Last updated date |
|
| 49 | + * @var \DateTime $last_updated |
|
| 50 | + */ |
|
| 51 | + protected $last_updated; |
|
| 52 | 52 | |
| 53 | - /** |
|
| 54 | - * Last run result |
|
| 55 | - * @var bool $last_result |
|
| 56 | - */ |
|
| 57 | - protected $last_result; |
|
| 53 | + /** |
|
| 54 | + * Last run result |
|
| 55 | + * @var bool $last_result |
|
| 56 | + */ |
|
| 57 | + protected $last_result; |
|
| 58 | 58 | |
| 59 | - /** |
|
| 60 | - * Task run frequency |
|
| 61 | - * @var int $frequency |
|
| 62 | - */ |
|
| 63 | - protected $frequency; |
|
| 59 | + /** |
|
| 60 | + * Task run frequency |
|
| 61 | + * @var int $frequency |
|
| 62 | + */ |
|
| 63 | + protected $frequency; |
|
| 64 | 64 | |
| 65 | - /** |
|
| 66 | - * Task remaining runs |
|
| 67 | - * @var int $nb_occurrences |
|
| 68 | - */ |
|
| 69 | - protected $nb_occurrences; |
|
| 65 | + /** |
|
| 66 | + * Task remaining runs |
|
| 67 | + * @var int $nb_occurrences |
|
| 68 | + */ |
|
| 69 | + protected $nb_occurrences; |
|
| 70 | 70 | |
| 71 | - /** |
|
| 72 | - * Current running status of the task |
|
| 73 | - * @var bool $is_running |
|
| 74 | - */ |
|
| 75 | - protected $is_running; |
|
| 71 | + /** |
|
| 72 | + * Current running status of the task |
|
| 73 | + * @var bool $is_running |
|
| 74 | + */ |
|
| 75 | + protected $is_running; |
|
| 76 | 76 | |
| 77 | - /** |
|
| 78 | - * Constructor for the Admin task class |
|
| 77 | + /** |
|
| 78 | + * Constructor for the Admin task class |
|
| 79 | 79 | * |
| 80 | 80 | * @param string $file Filename containing the task object |
| 81 | 81 | * @param TaskProviderInterface $provider Provider for tasks |
| 82 | - */ |
|
| 83 | - public function __construct($file, TaskProviderInterface $provider = null){ |
|
| 84 | - $this->name = trim(basename($file, '.php')); |
|
| 82 | + */ |
|
| 83 | + public function __construct($file, TaskProviderInterface $provider = null){ |
|
| 84 | + $this->name = trim(basename($file, '.php')); |
|
| 85 | 85 | $this->provider = $provider; |
| 86 | - } |
|
| 86 | + } |
|
| 87 | 87 | |
| 88 | - /** |
|
| 89 | - * Get the provider. |
|
| 90 | - * |
|
| 91 | - * @return TaskProviderInterface |
|
| 92 | - */ |
|
| 93 | - public function getProvider(){ |
|
| 94 | - return $this->provider; |
|
| 95 | - } |
|
| 88 | + /** |
|
| 89 | + * Get the provider. |
|
| 90 | + * |
|
| 91 | + * @return TaskProviderInterface |
|
| 92 | + */ |
|
| 93 | + public function getProvider(){ |
|
| 94 | + return $this->provider; |
|
| 95 | + } |
|
| 96 | 96 | |
| 97 | - /** |
|
| 98 | - * Set the provider. |
|
| 99 | - * |
|
| 100 | - * @param TaskProviderInterface $provider |
|
| 101 | - * @return self Enable method-chaining |
|
| 102 | - */ |
|
| 103 | - public function setProvider(TaskProviderInterface $provider){ |
|
| 104 | - $this->provider = $provider; |
|
| 105 | - return $this; |
|
| 106 | - } |
|
| 97 | + /** |
|
| 98 | + * Set the provider. |
|
| 99 | + * |
|
| 100 | + * @param TaskProviderInterface $provider |
|
| 101 | + * @return self Enable method-chaining |
|
| 102 | + */ |
|
| 103 | + public function setProvider(TaskProviderInterface $provider){ |
|
| 104 | + $this->provider = $provider; |
|
| 105 | + return $this; |
|
| 106 | + } |
|
| 107 | 107 | |
| 108 | - /** |
|
| 109 | - * Set parameters of the Task |
|
| 110 | - * |
|
| 111 | - * @param bool $is_enabled Status of the task |
|
| 112 | - * @param \DateTime $lastupdated Time of the last task run |
|
| 113 | - * @param bool $last_result Result of the last run, true for success, false for failure |
|
| 114 | - * @param int $frequency Frequency of execution in minutes |
|
| 115 | - * @param int $nb_occur Number of remaining occurrences, 0 for tasks not limited |
|
| 116 | - * @param bool $is_running Indicates if the task is currently running |
|
| 117 | - */ |
|
| 118 | - public function setParameters($is_enabled, \DateTime $last_updated, $last_result, $frequency, $nb_occur, $is_running){ |
|
| 119 | - $this->is_enabled = $is_enabled; |
|
| 120 | - $this->last_updated = $last_updated; |
|
| 121 | - $this->last_result = $last_result; |
|
| 122 | - $this->frequency = $frequency; |
|
| 123 | - $this->nb_occurrences = $nb_occur; |
|
| 124 | - $this->is_running = $is_running; |
|
| 125 | - } |
|
| 108 | + /** |
|
| 109 | + * Set parameters of the Task |
|
| 110 | + * |
|
| 111 | + * @param bool $is_enabled Status of the task |
|
| 112 | + * @param \DateTime $lastupdated Time of the last task run |
|
| 113 | + * @param bool $last_result Result of the last run, true for success, false for failure |
|
| 114 | + * @param int $frequency Frequency of execution in minutes |
|
| 115 | + * @param int $nb_occur Number of remaining occurrences, 0 for tasks not limited |
|
| 116 | + * @param bool $is_running Indicates if the task is currently running |
|
| 117 | + */ |
|
| 118 | + public function setParameters($is_enabled, \DateTime $last_updated, $last_result, $frequency, $nb_occur, $is_running){ |
|
| 119 | + $this->is_enabled = $is_enabled; |
|
| 120 | + $this->last_updated = $last_updated; |
|
| 121 | + $this->last_result = $last_result; |
|
| 122 | + $this->frequency = $frequency; |
|
| 123 | + $this->nb_occurrences = $nb_occur; |
|
| 124 | + $this->is_running = $is_running; |
|
| 125 | + } |
|
| 126 | 126 | |
| 127 | - /** |
|
| 128 | - * Get the name of the task |
|
| 129 | - * |
|
| 130 | - * @return string |
|
| 131 | - */ |
|
| 132 | - public function getName(){ |
|
| 133 | - return $this->name; |
|
| 134 | - } |
|
| 127 | + /** |
|
| 128 | + * Get the name of the task |
|
| 129 | + * |
|
| 130 | + * @return string |
|
| 131 | + */ |
|
| 132 | + public function getName(){ |
|
| 133 | + return $this->name; |
|
| 134 | + } |
|
| 135 | 135 | |
| 136 | 136 | |
| 137 | - /** |
|
| 138 | - * Return the status of the task in a boolean way |
|
| 139 | - * |
|
| 140 | - * @return boolean True if enabled |
|
| 141 | - */ |
|
| 142 | - public function isEnabled(){ |
|
| 143 | - return $this->is_enabled; |
|
| 144 | - } |
|
| 137 | + /** |
|
| 138 | + * Return the status of the task in a boolean way |
|
| 139 | + * |
|
| 140 | + * @return boolean True if enabled |
|
| 141 | + */ |
|
| 142 | + public function isEnabled(){ |
|
| 143 | + return $this->is_enabled; |
|
| 144 | + } |
|
| 145 | 145 | |
| 146 | - /** |
|
| 147 | - * Get the last updated time. |
|
| 148 | - * |
|
| 149 | - * @return \DateTime |
|
| 150 | - */ |
|
| 151 | - public function getLastUpdated(){ |
|
| 152 | - return $this->last_updated; |
|
| 153 | - } |
|
| 146 | + /** |
|
| 147 | + * Get the last updated time. |
|
| 148 | + * |
|
| 149 | + * @return \DateTime |
|
| 150 | + */ |
|
| 151 | + public function getLastUpdated(){ |
|
| 152 | + return $this->last_updated; |
|
| 153 | + } |
|
| 154 | 154 | |
| 155 | - /** |
|
| 156 | - * Check if the last result has been successful. |
|
| 157 | - * |
|
| 158 | - * @return bool |
|
| 159 | - */ |
|
| 160 | - public function isLastRunSuccess(){ |
|
| 161 | - return $this->last_result; |
|
| 162 | - } |
|
| 155 | + /** |
|
| 156 | + * Check if the last result has been successful. |
|
| 157 | + * |
|
| 158 | + * @return bool |
|
| 159 | + */ |
|
| 160 | + public function isLastRunSuccess(){ |
|
| 161 | + return $this->last_result; |
|
| 162 | + } |
|
| 163 | 163 | |
| 164 | - /** |
|
| 165 | - * Get the task frequency. |
|
| 166 | - * |
|
| 167 | - * @return int |
|
| 168 | - */ |
|
| 169 | - public function getFrequency(){ |
|
| 170 | - return $this->frequency; |
|
| 171 | - } |
|
| 164 | + /** |
|
| 165 | + * Get the task frequency. |
|
| 166 | + * |
|
| 167 | + * @return int |
|
| 168 | + */ |
|
| 169 | + public function getFrequency(){ |
|
| 170 | + return $this->frequency; |
|
| 171 | + } |
|
| 172 | 172 | |
| 173 | 173 | /** |
| 174 | - * Set the task frequency. |
|
| 175 | - * |
|
| 174 | + * Set the task frequency. |
|
| 175 | + * |
|
| 176 | 176 | * @param int $frequency |
| 177 | - * @return self Enable method-chaining |
|
| 178 | - */ |
|
| 179 | - public function setFrequency($frequency){ |
|
| 180 | - $this->frequency = $frequency; |
|
| 177 | + * @return self Enable method-chaining |
|
| 178 | + */ |
|
| 179 | + public function setFrequency($frequency){ |
|
| 180 | + $this->frequency = $frequency; |
|
| 181 | 181 | return $this; |
| 182 | - } |
|
| 182 | + } |
|
| 183 | 183 | |
| 184 | - /** |
|
| 185 | - * Get the number of remaining occurrences. |
|
| 186 | - * |
|
| 187 | - * @return int |
|
| 188 | - */ |
|
| 189 | - public function getRemainingOccurrences(){ |
|
| 190 | - return $this->nb_occurrences; |
|
| 191 | - } |
|
| 184 | + /** |
|
| 185 | + * Get the number of remaining occurrences. |
|
| 186 | + * |
|
| 187 | + * @return int |
|
| 188 | + */ |
|
| 189 | + public function getRemainingOccurrences(){ |
|
| 190 | + return $this->nb_occurrences; |
|
| 191 | + } |
|
| 192 | 192 | |
| 193 | 193 | /** |
| 194 | - * Set the number of remaining occurrences. |
|
| 195 | - * |
|
| 194 | + * Set the number of remaining occurrences. |
|
| 195 | + * |
|
| 196 | 196 | * @param int $nb_occur |
| 197 | - * @return self Enable method-chaining |
|
| 198 | - */ |
|
| 199 | - public function setRemainingOccurrences($nb_occur){ |
|
| 200 | - $this->nb_occurrences = $nb_occur; |
|
| 197 | + * @return self Enable method-chaining |
|
| 198 | + */ |
|
| 199 | + public function setRemainingOccurrences($nb_occur){ |
|
| 200 | + $this->nb_occurrences = $nb_occur; |
|
| 201 | 201 | return $this; |
| 202 | - } |
|
| 202 | + } |
|
| 203 | 203 | |
| 204 | - /** |
|
| 205 | - * Check if the task if running. |
|
| 206 | - * |
|
| 207 | - * @return bool |
|
| 208 | - */ |
|
| 209 | - public function isRunning(){ |
|
| 210 | - return $this->is_running; |
|
| 211 | - } |
|
| 204 | + /** |
|
| 205 | + * Check if the task if running. |
|
| 206 | + * |
|
| 207 | + * @return bool |
|
| 208 | + */ |
|
| 209 | + public function isRunning(){ |
|
| 210 | + return $this->is_running; |
|
| 211 | + } |
|
| 212 | 212 | |
| 213 | 213 | |
| 214 | - /** |
|
| 215 | - * Return the name to display for the task |
|
| 216 | - * |
|
| 217 | - * @return string Title for the task |
|
| 218 | - */ |
|
| 219 | - abstract public function getTitle(); |
|
| 214 | + /** |
|
| 215 | + * Return the name to display for the task |
|
| 216 | + * |
|
| 217 | + * @return string Title for the task |
|
| 218 | + */ |
|
| 219 | + abstract public function getTitle(); |
|
| 220 | 220 | |
| 221 | - /** |
|
| 222 | - * Return the default frequency for the execution of the task |
|
| 223 | - * |
|
| 224 | - * @return int Frequency for the execution of the task |
|
| 225 | - */ |
|
| 226 | - abstract public function getDefaultFrequency(); |
|
| 221 | + /** |
|
| 222 | + * Return the default frequency for the execution of the task |
|
| 223 | + * |
|
| 224 | + * @return int Frequency for the execution of the task |
|
| 225 | + */ |
|
| 226 | + abstract public function getDefaultFrequency(); |
|
| 227 | 227 | |
| 228 | - /** |
|
| 229 | - * Execute the task's actions |
|
| 230 | - */ |
|
| 231 | - abstract protected function executeSteps(); |
|
| 228 | + /** |
|
| 229 | + * Execute the task's actions |
|
| 230 | + */ |
|
| 231 | + abstract protected function executeSteps(); |
|
| 232 | 232 | |
| 233 | 233 | /** |
| 234 | 234 | * Persist task state into database. |
| 235 | 235 | * @return bool |
| 236 | 236 | */ |
| 237 | 237 | public function save() { |
| 238 | - if(!$this->provider) throw new \Exception('The task has not been initialised with a provider.'); |
|
| 238 | + if(!$this->provider) throw new \Exception('The task has not been initialised with a provider.'); |
|
| 239 | 239 | return $this->provider->updateTask($this); |
| 240 | 240 | } |
| 241 | 241 | |
| 242 | - /** |
|
| 243 | - * Execute the task, default skeleton |
|
| 244 | - * |
|
| 245 | - */ |
|
| 246 | - public function execute(){ |
|
| 242 | + /** |
|
| 243 | + * Execute the task, default skeleton |
|
| 244 | + * |
|
| 245 | + */ |
|
| 246 | + public function execute(){ |
|
| 247 | 247 | |
| 248 | - if($this->last_updated->add(new \DateInterval('PT'.self::TASK_TIME_OUT.'S')) < new \DateTime()) |
|
| 249 | - $this->is_running = false; |
|
| 248 | + if($this->last_updated->add(new \DateInterval('PT'.self::TASK_TIME_OUT.'S')) < new \DateTime()) |
|
| 249 | + $this->is_running = false; |
|
| 250 | 250 | |
| 251 | - if(!$this->is_running){ |
|
| 252 | - $this->last_result = false; |
|
| 253 | - $this->is_running = true; |
|
| 254 | - $this->save(); |
|
| 251 | + if(!$this->is_running){ |
|
| 252 | + $this->last_result = false; |
|
| 253 | + $this->is_running = true; |
|
| 254 | + $this->save(); |
|
| 255 | 255 | |
| 256 | - Log::addDebugLog('Start execution of Admin task: '.$this->getTitle()); |
|
| 257 | - $this->last_result = $this->executeSteps(); |
|
| 258 | - if($this->last_result){ |
|
| 259 | - $this->last_updated = new \DateTime(); |
|
| 260 | - if($this->nb_occurrences > 0){ |
|
| 261 | - $this->nb_occurrences--; |
|
| 262 | - if($this->nb_occurrences == 0) $this->is_enabled = false; |
|
| 263 | - } |
|
| 264 | - } |
|
| 265 | - $this->is_running = false; |
|
| 266 | - $this->save(); |
|
| 267 | - Log::addDebugLog('Execution completed for Admin task: '.$this->getTitle().' - '.($this->last_result ? 'Success' : 'Failure')); |
|
| 268 | - } |
|
| 269 | - } |
|
| 256 | + Log::addDebugLog('Start execution of Admin task: '.$this->getTitle()); |
|
| 257 | + $this->last_result = $this->executeSteps(); |
|
| 258 | + if($this->last_result){ |
|
| 259 | + $this->last_updated = new \DateTime(); |
|
| 260 | + if($this->nb_occurrences > 0){ |
|
| 261 | + $this->nb_occurrences--; |
|
| 262 | + if($this->nb_occurrences == 0) $this->is_enabled = false; |
|
| 263 | + } |
|
| 264 | + } |
|
| 265 | + $this->is_running = false; |
|
| 266 | + $this->save(); |
|
| 267 | + Log::addDebugLog('Execution completed for Admin task: '.$this->getTitle().' - '.($this->last_result ? 'Success' : 'Failure')); |
|
| 268 | + } |
|
| 269 | + } |
|
| 270 | 270 | |
| 271 | 271 | |
| 272 | 272 | } |
@@ -80,7 +80,7 @@ discard block |
||
| 80 | 80 | * @param string $file Filename containing the task object |
| 81 | 81 | * @param TaskProviderInterface $provider Provider for tasks |
| 82 | 82 | */ |
| 83 | - public function __construct($file, TaskProviderInterface $provider = null){ |
|
| 83 | + public function __construct($file, TaskProviderInterface $provider = null) { |
|
| 84 | 84 | $this->name = trim(basename($file, '.php')); |
| 85 | 85 | $this->provider = $provider; |
| 86 | 86 | } |
@@ -90,7 +90,7 @@ discard block |
||
| 90 | 90 | * |
| 91 | 91 | * @return TaskProviderInterface |
| 92 | 92 | */ |
| 93 | - public function getProvider(){ |
|
| 93 | + public function getProvider() { |
|
| 94 | 94 | return $this->provider; |
| 95 | 95 | } |
| 96 | 96 | |
@@ -100,7 +100,7 @@ discard block |
||
| 100 | 100 | * @param TaskProviderInterface $provider |
| 101 | 101 | * @return self Enable method-chaining |
| 102 | 102 | */ |
| 103 | - public function setProvider(TaskProviderInterface $provider){ |
|
| 103 | + public function setProvider(TaskProviderInterface $provider) { |
|
| 104 | 104 | $this->provider = $provider; |
| 105 | 105 | return $this; |
| 106 | 106 | } |
@@ -115,7 +115,7 @@ discard block |
||
| 115 | 115 | * @param int $nb_occur Number of remaining occurrences, 0 for tasks not limited |
| 116 | 116 | * @param bool $is_running Indicates if the task is currently running |
| 117 | 117 | */ |
| 118 | - public function setParameters($is_enabled, \DateTime $last_updated, $last_result, $frequency, $nb_occur, $is_running){ |
|
| 118 | + public function setParameters($is_enabled, \DateTime $last_updated, $last_result, $frequency, $nb_occur, $is_running) { |
|
| 119 | 119 | $this->is_enabled = $is_enabled; |
| 120 | 120 | $this->last_updated = $last_updated; |
| 121 | 121 | $this->last_result = $last_result; |
@@ -129,7 +129,7 @@ discard block |
||
| 129 | 129 | * |
| 130 | 130 | * @return string |
| 131 | 131 | */ |
| 132 | - public function getName(){ |
|
| 132 | + public function getName() { |
|
| 133 | 133 | return $this->name; |
| 134 | 134 | } |
| 135 | 135 | |
@@ -139,7 +139,7 @@ discard block |
||
| 139 | 139 | * |
| 140 | 140 | * @return boolean True if enabled |
| 141 | 141 | */ |
| 142 | - public function isEnabled(){ |
|
| 142 | + public function isEnabled() { |
|
| 143 | 143 | return $this->is_enabled; |
| 144 | 144 | } |
| 145 | 145 | |
@@ -148,7 +148,7 @@ discard block |
||
| 148 | 148 | * |
| 149 | 149 | * @return \DateTime |
| 150 | 150 | */ |
| 151 | - public function getLastUpdated(){ |
|
| 151 | + public function getLastUpdated() { |
|
| 152 | 152 | return $this->last_updated; |
| 153 | 153 | } |
| 154 | 154 | |
@@ -157,7 +157,7 @@ discard block |
||
| 157 | 157 | * |
| 158 | 158 | * @return bool |
| 159 | 159 | */ |
| 160 | - public function isLastRunSuccess(){ |
|
| 160 | + public function isLastRunSuccess() { |
|
| 161 | 161 | return $this->last_result; |
| 162 | 162 | } |
| 163 | 163 | |
@@ -166,7 +166,7 @@ discard block |
||
| 166 | 166 | * |
| 167 | 167 | * @return int |
| 168 | 168 | */ |
| 169 | - public function getFrequency(){ |
|
| 169 | + public function getFrequency() { |
|
| 170 | 170 | return $this->frequency; |
| 171 | 171 | } |
| 172 | 172 | |
@@ -176,7 +176,7 @@ discard block |
||
| 176 | 176 | * @param int $frequency |
| 177 | 177 | * @return self Enable method-chaining |
| 178 | 178 | */ |
| 179 | - public function setFrequency($frequency){ |
|
| 179 | + public function setFrequency($frequency) { |
|
| 180 | 180 | $this->frequency = $frequency; |
| 181 | 181 | return $this; |
| 182 | 182 | } |
@@ -186,7 +186,7 @@ discard block |
||
| 186 | 186 | * |
| 187 | 187 | * @return int |
| 188 | 188 | */ |
| 189 | - public function getRemainingOccurrences(){ |
|
| 189 | + public function getRemainingOccurrences() { |
|
| 190 | 190 | return $this->nb_occurrences; |
| 191 | 191 | } |
| 192 | 192 | |
@@ -196,7 +196,7 @@ discard block |
||
| 196 | 196 | * @param int $nb_occur |
| 197 | 197 | * @return self Enable method-chaining |
| 198 | 198 | */ |
| 199 | - public function setRemainingOccurrences($nb_occur){ |
|
| 199 | + public function setRemainingOccurrences($nb_occur) { |
|
| 200 | 200 | $this->nb_occurrences = $nb_occur; |
| 201 | 201 | return $this; |
| 202 | 202 | } |
@@ -206,7 +206,7 @@ discard block |
||
| 206 | 206 | * |
| 207 | 207 | * @return bool |
| 208 | 208 | */ |
| 209 | - public function isRunning(){ |
|
| 209 | + public function isRunning() { |
|
| 210 | 210 | return $this->is_running; |
| 211 | 211 | } |
| 212 | 212 | |
@@ -235,7 +235,7 @@ discard block |
||
| 235 | 235 | * @return bool |
| 236 | 236 | */ |
| 237 | 237 | public function save() { |
| 238 | - if(!$this->provider) throw new \Exception('The task has not been initialised with a provider.'); |
|
| 238 | + if (!$this->provider) throw new \Exception('The task has not been initialised with a provider.'); |
|
| 239 | 239 | return $this->provider->updateTask($this); |
| 240 | 240 | } |
| 241 | 241 | |
@@ -243,23 +243,23 @@ discard block |
||
| 243 | 243 | * Execute the task, default skeleton |
| 244 | 244 | * |
| 245 | 245 | */ |
| 246 | - public function execute(){ |
|
| 246 | + public function execute() { |
|
| 247 | 247 | |
| 248 | - if($this->last_updated->add(new \DateInterval('PT'.self::TASK_TIME_OUT.'S')) < new \DateTime()) |
|
| 248 | + if ($this->last_updated->add(new \DateInterval('PT'.self::TASK_TIME_OUT.'S')) < new \DateTime()) |
|
| 249 | 249 | $this->is_running = false; |
| 250 | 250 | |
| 251 | - if(!$this->is_running){ |
|
| 251 | + if (!$this->is_running) { |
|
| 252 | 252 | $this->last_result = false; |
| 253 | 253 | $this->is_running = true; |
| 254 | 254 | $this->save(); |
| 255 | 255 | |
| 256 | 256 | Log::addDebugLog('Start execution of Admin task: '.$this->getTitle()); |
| 257 | 257 | $this->last_result = $this->executeSteps(); |
| 258 | - if($this->last_result){ |
|
| 258 | + if ($this->last_result) { |
|
| 259 | 259 | $this->last_updated = new \DateTime(); |
| 260 | - if($this->nb_occurrences > 0){ |
|
| 260 | + if ($this->nb_occurrences > 0) { |
|
| 261 | 261 | $this->nb_occurrences--; |
| 262 | - if($this->nb_occurrences == 0) $this->is_enabled = false; |
|
| 262 | + if ($this->nb_occurrences == 0) $this->is_enabled = false; |
|
| 263 | 263 | } |
| 264 | 264 | } |
| 265 | 265 | $this->is_running = false; |
@@ -235,7 +235,9 @@ discard block |
||
| 235 | 235 | * @return bool |
| 236 | 236 | */ |
| 237 | 237 | public function save() { |
| 238 | - if(!$this->provider) throw new \Exception('The task has not been initialised with a provider.'); |
|
| 238 | + if(!$this->provider) { |
|
| 239 | + throw new \Exception('The task has not been initialised with a provider.'); |
|
| 240 | + } |
|
| 239 | 241 | return $this->provider->updateTask($this); |
| 240 | 242 | } |
| 241 | 243 | |
@@ -245,8 +247,9 @@ discard block |
||
| 245 | 247 | */ |
| 246 | 248 | public function execute(){ |
| 247 | 249 | |
| 248 | - if($this->last_updated->add(new \DateInterval('PT'.self::TASK_TIME_OUT.'S')) < new \DateTime()) |
|
| 249 | - $this->is_running = false; |
|
| 250 | + if($this->last_updated->add(new \DateInterval('PT'.self::TASK_TIME_OUT.'S')) < new \DateTime()) { |
|
| 251 | + $this->is_running = false; |
|
| 252 | + } |
|
| 250 | 253 | |
| 251 | 254 | if(!$this->is_running){ |
| 252 | 255 | $this->last_result = false; |
@@ -259,7 +262,9 @@ discard block |
||
| 259 | 262 | $this->last_updated = new \DateTime(); |
| 260 | 263 | if($this->nb_occurrences > 0){ |
| 261 | 264 | $this->nb_occurrences--; |
| 262 | - if($this->nb_occurrences == 0) $this->is_enabled = false; |
|
| 265 | + if($this->nb_occurrences == 0) { |
|
| 266 | + $this->is_enabled = false; |
|
| 267 | + } |
|
| 263 | 268 | } |
| 264 | 269 | } |
| 265 | 270 | $this->is_running = false; |
@@ -32,8 +32,8 @@ discard block |
||
| 32 | 32 | * Set the status of a specific admin task. |
| 33 | 33 | * The status can be enabled (true), or disabled (false). |
| 34 | 34 | * |
| 35 | - * @param AbstractTask $ga |
|
| 36 | 35 | * @param bool $status |
| 36 | + * @return void |
|
| 37 | 37 | */ |
| 38 | 38 | public function setTaskStatus(AbstractTask $task, $status); |
| 39 | 39 | |
@@ -49,6 +49,7 @@ discard block |
||
| 49 | 49 | * Delete the task from the database, in a transactional manner. |
| 50 | 50 | * |
| 51 | 51 | * @param string $task_name Task to delete |
| 52 | + * @return boolean |
|
| 52 | 53 | */ |
| 53 | 54 | public function deleteTask($task_name); |
| 54 | 55 | |
@@ -75,7 +76,7 @@ discard block |
||
| 75 | 76 | * Returns the list of tasks that are currently meant to run. |
| 76 | 77 | * Tasks to run can be forced, or can be limited to only one. |
| 77 | 78 | * |
| 78 | - * @param string|null $force Force the enabled tasks to run. |
|
| 79 | + * @param boolean $force Force the enabled tasks to run. |
|
| 79 | 80 | * @param string|null $task_name Name of the specific task to run |
| 80 | 81 | */ |
| 81 | 82 | function getTasksToRun($force = false, $task_name = null); |
@@ -37,47 +37,47 @@ |
||
| 37 | 37 | */ |
| 38 | 38 | public function setTaskStatus(AbstractTask $task, $status); |
| 39 | 39 | |
| 40 | - /** |
|
| 41 | - * Update an Admin Task in the database. |
|
| 42 | - * |
|
| 43 | - * @param AbstractTask $task Task to update |
|
| 44 | - * @return bool |
|
| 45 | - */ |
|
| 46 | - function updateTask(AbstractTask $task); |
|
| 40 | + /** |
|
| 41 | + * Update an Admin Task in the database. |
|
| 42 | + * |
|
| 43 | + * @param AbstractTask $task Task to update |
|
| 44 | + * @return bool |
|
| 45 | + */ |
|
| 46 | + function updateTask(AbstractTask $task); |
|
| 47 | 47 | |
| 48 | - /** |
|
| 49 | - * Delete the task from the database, in a transactional manner. |
|
| 50 | - * |
|
| 51 | - * @param string $task_name Task to delete |
|
| 52 | - */ |
|
| 53 | - public function deleteTask($task_name); |
|
| 48 | + /** |
|
| 49 | + * Delete the task from the database, in a transactional manner. |
|
| 50 | + * |
|
| 51 | + * @param string $task_name Task to delete |
|
| 52 | + */ |
|
| 53 | + public function deleteTask($task_name); |
|
| 54 | 54 | |
| 55 | 55 | |
| 56 | - /** |
|
| 57 | - * Returns the number of Admin Tasks (active and inactive). |
|
| 58 | - * |
|
| 59 | - * @return int |
|
| 60 | - */ |
|
| 61 | - public function getTasksCount(); |
|
| 56 | + /** |
|
| 57 | + * Returns the number of Admin Tasks (active and inactive). |
|
| 58 | + * |
|
| 59 | + * @return int |
|
| 60 | + */ |
|
| 61 | + public function getTasksCount(); |
|
| 62 | 62 | |
| 63 | - /** |
|
| 64 | - * Return the list of Admin Tasks matching specified criterias. |
|
| 65 | - * |
|
| 66 | - * @param string $search Search criteria in analysis description |
|
| 67 | - * @param array $order_by Columns to order by |
|
| 68 | - * @param int $start Offset to start with (for pagination) |
|
| 69 | - * @param int|null $limit Max number of items to return (for pagination) |
|
| 70 | - * @return \MyArtJaub\Webtrees\Module\GeoDispersion\Model\GeoAnalysis[] |
|
| 71 | - */ |
|
| 72 | - function getFilteredTasksList($search = null, $order_by = null, $start = 0, $limit = null); |
|
| 63 | + /** |
|
| 64 | + * Return the list of Admin Tasks matching specified criterias. |
|
| 65 | + * |
|
| 66 | + * @param string $search Search criteria in analysis description |
|
| 67 | + * @param array $order_by Columns to order by |
|
| 68 | + * @param int $start Offset to start with (for pagination) |
|
| 69 | + * @param int|null $limit Max number of items to return (for pagination) |
|
| 70 | + * @return \MyArtJaub\Webtrees\Module\GeoDispersion\Model\GeoAnalysis[] |
|
| 71 | + */ |
|
| 72 | + function getFilteredTasksList($search = null, $order_by = null, $start = 0, $limit = null); |
|
| 73 | 73 | |
| 74 | - /** |
|
| 75 | - * Returns the list of tasks that are currently meant to run. |
|
| 76 | - * Tasks to run can be forced, or can be limited to only one. |
|
| 77 | - * |
|
| 78 | - * @param string|null $force Force the enabled tasks to run. |
|
| 79 | - * @param string|null $task_name Name of the specific task to run |
|
| 80 | - */ |
|
| 74 | + /** |
|
| 75 | + * Returns the list of tasks that are currently meant to run. |
|
| 76 | + * Tasks to run can be forced, or can be limited to only one. |
|
| 77 | + * |
|
| 78 | + * @param string|null $force Force the enabled tasks to run. |
|
| 79 | + * @param string|null $task_name Name of the specific task to run |
|
| 80 | + */ |
|
| 81 | 81 | function getTasksToRun($force = false, $task_name = null); |
| 82 | 82 | |
| 83 | 83 | /** |
@@ -109,6 +109,7 @@ discard block |
||
| 109 | 109 | /** |
| 110 | 110 | * {@inhericDoc} |
| 111 | 111 | * @see \Fisharebest\Webtrees\GedcomRecord::getInstance() |
| 112 | + * @param string $xref |
|
| 112 | 113 | */ |
| 113 | 114 | static public function getInstance($xref, Tree $tree, $gedcom = null, CertificateProviderInterface $provider = null) { |
| 114 | 115 | try{ |
@@ -150,7 +151,7 @@ discard block |
||
| 150 | 151 | /** |
| 151 | 152 | * Define a source associated with the certificate |
| 152 | 153 | * |
| 153 | - * @param string|Source $xref |
|
| 154 | + * @param string|null $xref |
|
| 154 | 155 | */ |
| 155 | 156 | public function setSource($xref){ |
| 156 | 157 | if($xref instanceof Source){ |
@@ -35,12 +35,12 @@ discard block |
||
| 35 | 35 | */ |
| 36 | 36 | class Certificate extends Media { |
| 37 | 37 | |
| 38 | - const URL_PREFIX = 'module.php?mod=myartjaub_certificates&mod_action=Certificate&cid='; |
|
| 38 | + const URL_PREFIX = 'module.php?mod=myartjaub_certificates&mod_action=Certificate&cid='; |
|
| 39 | 39 | |
| 40 | - /** @var string The "TITL" value from the GEDCOM |
|
| 41 | - * This is a tweak to overcome the private level from the parent object... |
|
| 42 | - */ |
|
| 43 | - protected $title = ''; |
|
| 40 | + /** @var string The "TITL" value from the GEDCOM |
|
| 41 | + * This is a tweak to overcome the private level from the parent object... |
|
| 42 | + */ |
|
| 43 | + protected $title = ''; |
|
| 44 | 44 | |
| 45 | 45 | /** |
| 46 | 46 | * Certificate provider |
@@ -80,7 +80,7 @@ discard block |
||
| 80 | 80 | * @param CertificateProviderInterface $provider |
| 81 | 81 | */ |
| 82 | 82 | public function __construct($data, Tree $tree, CertificateProviderInterface $provider) { |
| 83 | - $this->provider = $provider; |
|
| 83 | + $this->provider = $provider; |
|
| 84 | 84 | // Data is only the file name |
| 85 | 85 | $data = str_replace("\\", '/', $data); |
| 86 | 86 | $xref = Functions::encryptToSafeBase64($data); |
@@ -165,7 +165,7 @@ discard block |
||
| 165 | 165 | * @see \Fisharebest\Webtrees\Media::getTitle() |
| 166 | 166 | */ |
| 167 | 167 | public function getTitle() { |
| 168 | - return $this->title; |
|
| 168 | + return $this->title; |
|
| 169 | 169 | } |
| 170 | 170 | |
| 171 | 171 | /** |
@@ -241,26 +241,26 @@ discard block |
||
| 241 | 241 | $module = Module::getModuleByName(Constants::MODULE_MAJ_CERTIF_NAME); |
| 242 | 242 | |
| 243 | 243 | if($module) { |
| 244 | - $wmtext = $module->getSetting('MAJ_WM_DEFAULT', I18N::translate('This image is protected under copyright law.')); |
|
| 245 | - $sid= Filter::get('sid', WT_REGEX_XREF); |
|
| 244 | + $wmtext = $module->getSetting('MAJ_WM_DEFAULT', I18N::translate('This image is protected under copyright law.')); |
|
| 245 | + $sid= Filter::get('sid', WT_REGEX_XREF); |
|
| 246 | 246 | |
| 247 | - if($sid){ |
|
| 248 | - $this->source = Source::getInstance($sid, $this->tree); |
|
| 249 | - } |
|
| 250 | - else{ |
|
| 251 | - $this->fetchALinkedSource(); // the method already attach the source to the Certificate object; |
|
| 252 | - } |
|
| 247 | + if($sid){ |
|
| 248 | + $this->source = Source::getInstance($sid, $this->tree); |
|
| 249 | + } |
|
| 250 | + else{ |
|
| 251 | + $this->fetchALinkedSource(); // the method already attach the source to the Certificate object; |
|
| 252 | + } |
|
| 253 | 253 | |
| 254 | - if($this->source) { |
|
| 255 | - $wmtext = '©'; |
|
| 256 | - $repofact = $this->source->getFirstFact('REPO'); |
|
| 257 | - if($repofact) { |
|
| 258 | - $repo = $repofact->getTarget(); |
|
| 259 | - if($repo && $repo instanceof Repository) $wmtext .= ' '.$repo->getFullName().' - '; |
|
| 260 | - } |
|
| 261 | - $wmtext .= $this->source->getFullName(); |
|
| 262 | - } |
|
| 263 | - return $wmtext; |
|
| 254 | + if($this->source) { |
|
| 255 | + $wmtext = '©'; |
|
| 256 | + $repofact = $this->source->getFirstFact('REPO'); |
|
| 257 | + if($repofact) { |
|
| 258 | + $repo = $repofact->getTarget(); |
|
| 259 | + if($repo && $repo instanceof Repository) $wmtext .= ' '.$repo->getFullName().' - '; |
|
| 260 | + } |
|
| 261 | + $wmtext .= $this->source->getFullName(); |
|
| 262 | + } |
|
| 263 | + return $wmtext; |
|
| 264 | 264 | } |
| 265 | 265 | return ''; |
| 266 | 266 | } |
@@ -323,8 +323,8 @@ discard block |
||
| 323 | 323 | ' FROM `##individuals`'. |
| 324 | 324 | ' WHERE i_file= :gedcom_id AND i_gedcom LIKE :gedcom') |
| 325 | 325 | ->execute(array( |
| 326 | - 'gedcom_id' => $this->tree->getTreeId(), |
|
| 327 | - 'gedcom' => '%_ACT '.$this->getFilename().'%' |
|
| 326 | + 'gedcom_id' => $this->tree->getTreeId(), |
|
| 327 | + 'gedcom' => '%_ACT '.$this->getFilename().'%' |
|
| 328 | 328 | ))->fetchAll(); |
| 329 | 329 | |
| 330 | 330 | $list = array(); |
@@ -347,8 +347,8 @@ discard block |
||
| 347 | 347 | ' FROM `##families`'. |
| 348 | 348 | ' WHERE f_file= :gedcom_id AND f_gedcom LIKE :gedcom') |
| 349 | 349 | ->execute(array( |
| 350 | - 'gedcom_id' => $this->tree->getTreeId(), |
|
| 351 | - 'gedcom' => '%_ACT '.$this->getFilename().'%' |
|
| 350 | + 'gedcom_id' => $this->tree->getTreeId(), |
|
| 351 | + 'gedcom' => '%_ACT '.$this->getFilename().'%' |
|
| 352 | 352 | ))->fetchAll(); |
| 353 | 353 | |
| 354 | 354 | $list = array(); |
@@ -375,25 +375,25 @@ discard block |
||
| 375 | 375 | 'SELECT i_gedcom AS gedrec FROM `##individuals`'. |
| 376 | 376 | ' WHERE i_file=:gedcom_id AND i_gedcom LIKE :gedcom') |
| 377 | 377 | ->execute(array( |
| 378 | - 'gedcom_id' => $this->tree->getTreeId(), |
|
| 379 | - 'gedcom' => '%_ACT '.$this->getFilename().'%' |
|
| 378 | + 'gedcom_id' => $this->tree->getTreeId(), |
|
| 379 | + 'gedcom' => '%_ACT '.$this->getFilename().'%' |
|
| 380 | 380 | ))->fetchOne(); |
| 381 | 381 | if(!$ged){ |
| 382 | 382 | $ged = Database::prepare( |
| 383 | 383 | 'SELECT f_gedcom AS gedrec FROM `##families`'. |
| 384 | 384 | ' WHERE f_file=:gedcom_id AND f_gedcom LIKE :gedcom') |
| 385 | - ->execute(array( |
|
| 386 | - 'gedcom_id' => $this->tree->getTreeId(), |
|
| 387 | - 'gedcom' => '%_ACT '.$this->getFilename().'%' |
|
| 388 | - ))->fetchOne(); |
|
| 385 | + ->execute(array( |
|
| 386 | + 'gedcom_id' => $this->tree->getTreeId(), |
|
| 387 | + 'gedcom' => '%_ACT '.$this->getFilename().'%' |
|
| 388 | + ))->fetchOne(); |
|
| 389 | 389 | if(!$ged){ |
| 390 | 390 | $ged = Database::prepare( |
| 391 | - 'SELECT o_gedcom AS gedrec FROM `##other`'. |
|
| 392 | - ' WHERE o_file=:gedcom_id AND o_gedcom LIKE :gedcom') |
|
| 393 | - ->execute(array( |
|
| 394 | - 'gedcom_id' => $this->tree->getTreeId(), |
|
| 395 | - 'gedcom' => '%_ACT '.$this->getFilename().'%' |
|
| 396 | - ))->fetchOne(); |
|
| 391 | + 'SELECT o_gedcom AS gedrec FROM `##other`'. |
|
| 392 | + ' WHERE o_file=:gedcom_id AND o_gedcom LIKE :gedcom') |
|
| 393 | + ->execute(array( |
|
| 394 | + 'gedcom_id' => $this->tree->getTreeId(), |
|
| 395 | + 'gedcom' => '%_ACT '.$this->getFilename().'%' |
|
| 396 | + ))->fetchOne(); |
|
| 397 | 397 | } |
| 398 | 398 | } |
| 399 | 399 | //If a record has been found, parse it to find the source reference. |
@@ -118,8 +118,7 @@ discard block |
||
| 118 | 118 | if(Functions::isValidPath($certfile, true)) { |
| 119 | 119 | return new Certificate($certfile, $tree, $provider); |
| 120 | 120 | } |
| 121 | - } |
|
| 122 | - catch (\Exception $ex) { |
|
| 121 | + } catch (\Exception $ex) { |
|
| 123 | 122 | Log::addErrorLog('Certificate module error : > '.$ex->getMessage().' < with data > '.$xref.' <'); |
| 124 | 123 | } |
| 125 | 124 | |
@@ -202,7 +201,9 @@ discard block |
||
| 202 | 201 | */ |
| 203 | 202 | public function getCity(){ |
| 204 | 203 | $chunks = explode('/', $this->getFilename(), 2); |
| 205 | - if(count($chunks) > 1) return $chunks[0]; |
|
| 204 | + if(count($chunks) > 1) { |
|
| 205 | + return $chunks[0]; |
|
| 206 | + } |
|
| 206 | 207 | return null; |
| 207 | 208 | } |
| 208 | 209 | |
@@ -246,8 +247,7 @@ discard block |
||
| 246 | 247 | |
| 247 | 248 | if($sid){ |
| 248 | 249 | $this->source = Source::getInstance($sid, $this->tree); |
| 249 | - } |
|
| 250 | - else{ |
|
| 250 | + } else{ |
|
| 251 | 251 | $this->fetchALinkedSource(); // the method already attach the source to the Certificate object; |
| 252 | 252 | } |
| 253 | 253 | |
@@ -256,7 +256,9 @@ discard block |
||
| 256 | 256 | $repofact = $this->source->getFirstFact('REPO'); |
| 257 | 257 | if($repofact) { |
| 258 | 258 | $repo = $repofact->getTarget(); |
| 259 | - if($repo && $repo instanceof Repository) $wmtext .= ' '.$repo->getFullName().' - '; |
|
| 259 | + if($repo && $repo instanceof Repository) { |
|
| 260 | + $wmtext .= ' '.$repo->getFullName().' - '; |
|
| 261 | + } |
|
| 260 | 262 | } |
| 261 | 263 | $wmtext .= $this->source->getFullName(); |
| 262 | 264 | } |
@@ -426,7 +428,9 @@ discard block |
||
| 426 | 428 | } |
| 427 | 429 | } |
| 428 | 430 | |
| 429 | - if($sid) $this->source = Source::getInstance($sid, $this->tree); |
|
| 431 | + if($sid) { |
|
| 432 | + $this->source = Source::getInstance($sid, $this->tree); |
|
| 433 | + } |
|
| 430 | 434 | |
| 431 | 435 | return $this->source; |
| 432 | 436 | } |
@@ -35,7 +35,7 @@ discard block |
||
| 35 | 35 | */ |
| 36 | 36 | class Certificate extends Media { |
| 37 | 37 | |
| 38 | - const URL_PREFIX = 'module.php?mod=myartjaub_certificates&mod_action=Certificate&cid='; |
|
| 38 | + const URL_PREFIX = 'module.php?mod=myartjaub_certificates&mod_action=Certificate&cid='; |
|
| 39 | 39 | |
| 40 | 40 | /** @var string The "TITL" value from the GEDCOM |
| 41 | 41 | * This is a tweak to overcome the private level from the parent object... |
@@ -95,8 +95,8 @@ discard block |
||
| 95 | 95 | |
| 96 | 96 | $match = null; |
| 97 | 97 | $ct = preg_match("/(?<year>\d{1,4})(\.(?<month>\d{1,2}))?(\.(?<day>\d{1,2}))?( (?<type>[A-Z]{1,2}) )?(?<details>.*)/", $this->title, $match); |
| 98 | - if($ct > 0){ |
|
| 99 | - $monthId = (int) $match['month']; |
|
| 98 | + if ($ct > 0) { |
|
| 99 | + $monthId = (int)$match['month']; |
|
| 100 | 100 | $calendarShortMonths = Functions::getCalendarShortMonths(); |
| 101 | 101 | $monthShortName = array_key_exists($monthId, $calendarShortMonths) ? $calendarShortMonths[$monthId] : $monthId; |
| 102 | 102 | $this->certDate = new Date($match['day'].' '.strtoupper($monthShortName).' '.$match['year']); |
@@ -112,11 +112,11 @@ discard block |
||
| 112 | 112 | * @see \Fisharebest\Webtrees\GedcomRecord::getInstance() |
| 113 | 113 | */ |
| 114 | 114 | static public function getInstance($xref, Tree $tree, $gedcom = null, CertificateProviderInterface $provider = null) { |
| 115 | - try{ |
|
| 115 | + try { |
|
| 116 | 116 | $certfile = Functions::decryptFromSafeBase64($xref); |
| 117 | 117 | |
| 118 | 118 | //NEED TO CHECK THAT !!! |
| 119 | - if(Functions::isValidPath($certfile, true)) { |
|
| 119 | + if (Functions::isValidPath($certfile, true)) { |
|
| 120 | 120 | return new Certificate($certfile, $tree, $provider); |
| 121 | 121 | } |
| 122 | 122 | } |
@@ -153,8 +153,8 @@ discard block |
||
| 153 | 153 | * |
| 154 | 154 | * @param string|Source $xref |
| 155 | 155 | */ |
| 156 | - public function setSource($xref){ |
|
| 157 | - if($xref instanceof Source){ |
|
| 156 | + public function setSource($xref) { |
|
| 157 | + if ($xref instanceof Source) { |
|
| 158 | 158 | $this->source = $xref; |
| 159 | 159 | } else { |
| 160 | 160 | $this->source = Source::getInstance($xref, $this->tree); |
@@ -174,7 +174,7 @@ discard block |
||
| 174 | 174 | * |
| 175 | 175 | * @return Date Certificate date |
| 176 | 176 | */ |
| 177 | - public function getCertificateDate(){ |
|
| 177 | + public function getCertificateDate() { |
|
| 178 | 178 | return $this->certDate; |
| 179 | 179 | } |
| 180 | 180 | |
@@ -183,7 +183,7 @@ discard block |
||
| 183 | 183 | * |
| 184 | 184 | * @return string Certificate date |
| 185 | 185 | */ |
| 186 | - public function getCertificateType(){ |
|
| 186 | + public function getCertificateType() { |
|
| 187 | 187 | return $this->certType; |
| 188 | 188 | } |
| 189 | 189 | |
@@ -192,7 +192,7 @@ discard block |
||
| 192 | 192 | * |
| 193 | 193 | * @return string Certificate details |
| 194 | 194 | */ |
| 195 | - public function getCertificateDetails(){ |
|
| 195 | + public function getCertificateDetails() { |
|
| 196 | 196 | return $this->certDetails; |
| 197 | 197 | } |
| 198 | 198 | |
@@ -201,9 +201,9 @@ discard block |
||
| 201 | 201 | * |
| 202 | 202 | * @return string|NULL Certificate city |
| 203 | 203 | */ |
| 204 | - public function getCity(){ |
|
| 204 | + public function getCity() { |
|
| 205 | 205 | $chunks = explode('/', $this->getFilename(), 2); |
| 206 | - if(count($chunks) > 1) return $chunks[0]; |
|
| 206 | + if (count($chunks) > 1) return $chunks[0]; |
|
| 207 | 207 | return null; |
| 208 | 208 | } |
| 209 | 209 | |
@@ -211,8 +211,8 @@ discard block |
||
| 211 | 211 | * {@inhericDoc} |
| 212 | 212 | * @see \Fisharebest\Webtrees\Media::getServerFilename() |
| 213 | 213 | */ |
| 214 | - public function getServerFilename($which='main') { |
|
| 215 | - $filename = $this->provider->getRealCertificatesDirectory() . $this->getFilename(); |
|
| 214 | + public function getServerFilename($which = 'main') { |
|
| 215 | + $filename = $this->provider->getRealCertificatesDirectory().$this->getFilename(); |
|
| 216 | 216 | return Functions::encodeUtf8ToFileSystem($filename); |
| 217 | 217 | } |
| 218 | 218 | |
@@ -223,11 +223,11 @@ discard block |
||
| 223 | 223 | public function getHtmlUrlDirect($which = 'main', $download = false) { |
| 224 | 224 | $sidstr = ($this->source) ? '&sid='.$this->source->getXref() : ''; |
| 225 | 225 | return |
| 226 | - 'module.php?mod='. \MyArtJaub\Webtrees\Constants::MODULE_MAJ_CERTIF_NAME . |
|
| 227 | - '&mod_action=Certificate@image' . |
|
| 228 | - '&ged='. $this->tree->getNameUrl() . |
|
| 229 | - '&cid=' . $this->getXref() . $sidstr . |
|
| 230 | - '&cb=' . $this->getEtag($which); |
|
| 226 | + 'module.php?mod='.\MyArtJaub\Webtrees\Constants::MODULE_MAJ_CERTIF_NAME. |
|
| 227 | + '&mod_action=Certificate@image'. |
|
| 228 | + '&ged='.$this->tree->getNameUrl(). |
|
| 229 | + '&cid='.$this->getXref().$sidstr. |
|
| 230 | + '&cb='.$this->getEtag($which); |
|
| 231 | 231 | } |
| 232 | 232 | |
| 233 | 233 | /** |
@@ -238,26 +238,26 @@ discard block |
||
| 238 | 238 | * |
| 239 | 239 | * @return string Watermark text |
| 240 | 240 | */ |
| 241 | - public function getWatermarkText(){ |
|
| 241 | + public function getWatermarkText() { |
|
| 242 | 242 | $module = Module::getModuleByName(Constants::MODULE_MAJ_CERTIF_NAME); |
| 243 | 243 | |
| 244 | - if($module) { |
|
| 244 | + if ($module) { |
|
| 245 | 245 | $wmtext = $module->getSetting('MAJ_WM_DEFAULT', I18N::translate('This image is protected under copyright law.')); |
| 246 | - $sid= Filter::get('sid', WT_REGEX_XREF); |
|
| 246 | + $sid = Filter::get('sid', WT_REGEX_XREF); |
|
| 247 | 247 | |
| 248 | - if($sid){ |
|
| 248 | + if ($sid) { |
|
| 249 | 249 | $this->source = Source::getInstance($sid, $this->tree); |
| 250 | 250 | } |
| 251 | - else{ |
|
| 252 | - $this->fetchALinkedSource(); // the method already attach the source to the Certificate object; |
|
| 251 | + else { |
|
| 252 | + $this->fetchALinkedSource(); // the method already attach the source to the Certificate object; |
|
| 253 | 253 | } |
| 254 | 254 | |
| 255 | - if($this->source) { |
|
| 255 | + if ($this->source) { |
|
| 256 | 256 | $wmtext = '©'; |
| 257 | 257 | $repofact = $this->source->getFirstFact('REPO'); |
| 258 | - if($repofact) { |
|
| 258 | + if ($repofact) { |
|
| 259 | 259 | $repo = $repofact->getTarget(); |
| 260 | - if($repo && $repo instanceof Repository) $wmtext .= ' '.$repo->getFullName().' - '; |
|
| 260 | + if ($repo && $repo instanceof Repository) $wmtext .= ' '.$repo->getFullName().' - '; |
|
| 261 | 261 | } |
| 262 | 262 | $wmtext .= $this->source->getFullName(); |
| 263 | 263 | } |
@@ -279,45 +279,45 @@ discard block |
||
| 279 | 279 | |
| 280 | 280 | $script = ''; |
| 281 | 281 | $controller = Globals::getController(); |
| 282 | - if($controller && !($controller instanceof IndividualController)){ |
|
| 282 | + if ($controller && !($controller instanceof IndividualController)) { |
|
| 283 | 283 | $controller->addInlineJavascript('$(document).ready(function() { '.$js.' });'); |
| 284 | 284 | } else { |
| 285 | - $script = '<script>' . $js . '</script>'; |
|
| 285 | + $script = '<script>'.$js.'</script>'; |
|
| 286 | 286 | } |
| 287 | 287 | |
| 288 | 288 | if ($which == 'icon' || !file_exists($this->getServerFilename())) { |
| 289 | 289 | // Use an icon |
| 290 | 290 | $image = |
| 291 | - '<i dir="auto" class="icon-maj-certificate margin-h-2"' . |
|
| 292 | - ' title="' . strip_tags($this->getFullName()) . '"' . |
|
| 291 | + '<i dir="auto" class="icon-maj-certificate margin-h-2"'. |
|
| 292 | + ' title="'.strip_tags($this->getFullName()).'"'. |
|
| 293 | 293 | '></i>'; |
| 294 | 294 | } else { |
| 295 | 295 | $imgsize = getimagesize($this->getServerFilename()); |
| 296 | 296 | $image = |
| 297 | - '<img' . |
|
| 298 | - ' class ="'. 'certif_image' . '"' . |
|
| 299 | - ' dir="' . 'auto' . '"' . // For the tool-tip |
|
| 300 | - ' src="' . $this->getHtmlUrlDirect() . '"' . |
|
| 301 | - ' alt="' . strip_tags($this->getFullName()) . '"' . |
|
| 302 | - ' title="' . strip_tags($this->getFullName()) . '"' . |
|
| 303 | - $imgsize[3] . // height="yyy" width="xxx" |
|
| 297 | + '<img'. |
|
| 298 | + ' class ="'.'certif_image'.'"'. |
|
| 299 | + ' dir="'.'auto'.'"'.// For the tool-tip |
|
| 300 | + ' src="'.$this->getHtmlUrlDirect().'"'. |
|
| 301 | + ' alt="'.strip_tags($this->getFullName()).'"'. |
|
| 302 | + ' title="'.strip_tags($this->getFullName()).'"'. |
|
| 303 | + $imgsize[3].// height="yyy" width="xxx" |
|
| 304 | 304 | '>'; |
| 305 | 305 | } |
| 306 | 306 | return |
| 307 | - '<a' . |
|
| 308 | - ' class="' . 'certgallery' . '"' . |
|
| 309 | - ' href="' . $this->getHtmlUrlDirect() . '"' . |
|
| 310 | - ' type="' . $this->mimeType() . '"' . |
|
| 311 | - ' data-obje-url="' . $this->getHtmlUrl() . '"' . |
|
| 312 | - ' data-title="' . strip_tags($this->getFullName()) . '"' . |
|
| 313 | - '>' . $image . '</a>'.$script; |
|
| 307 | + '<a'. |
|
| 308 | + ' class="'.'certgallery'.'"'. |
|
| 309 | + ' href="'.$this->getHtmlUrlDirect().'"'. |
|
| 310 | + ' type="'.$this->mimeType().'"'. |
|
| 311 | + ' data-obje-url="'.$this->getHtmlUrl().'"'. |
|
| 312 | + ' data-title="'.strip_tags($this->getFullName()).'"'. |
|
| 313 | + '>'.$image.'</a>'.$script; |
|
| 314 | 314 | } |
| 315 | 315 | |
| 316 | 316 | /** |
| 317 | 317 | * {@inhericDoc} |
| 318 | 318 | * @see \Fisharebest\Webtrees\GedcomRecord::linkedIndividuals() |
| 319 | 319 | */ |
| 320 | - public function linkedIndividuals($link = '_ACT'){ |
|
| 320 | + public function linkedIndividuals($link = '_ACT') { |
|
| 321 | 321 | $rows = Database::prepare( |
| 322 | 322 | 'SELECT i_id AS xref, i_gedcom AS gedcom'. |
| 323 | 323 | ' FROM `##individuals`'. |
@@ -341,7 +341,7 @@ discard block |
||
| 341 | 341 | * {@inhericDoc} |
| 342 | 342 | * @see \Fisharebest\Webtrees\GedcomRecord::linkedFamilies() |
| 343 | 343 | */ |
| 344 | - public function linkedFamilies($link = '_ACT'){ |
|
| 344 | + public function linkedFamilies($link = '_ACT') { |
|
| 345 | 345 | $rows = Database::prepare( |
| 346 | 346 | 'SELECT f_id AS xref, f_gedcom AS gedcom'. |
| 347 | 347 | ' FROM `##families`'. |
@@ -366,7 +366,7 @@ discard block |
||
| 366 | 366 | * |
| 367 | 367 | * @return Source|NULL Linked source |
| 368 | 368 | */ |
| 369 | - public function fetchALinkedSource(){ |
|
| 369 | + public function fetchALinkedSource() { |
|
| 370 | 370 | $sid = null; |
| 371 | 371 | |
| 372 | 372 | // Try to find in individual, then families, then other types of records. We are interested in the first available value. |
@@ -378,7 +378,7 @@ discard block |
||
| 378 | 378 | 'gedcom_id' => $this->tree->getTreeId(), |
| 379 | 379 | 'gedcom' => '%_ACT '.$this->getFilename().'%' |
| 380 | 380 | ))->fetchOne(); |
| 381 | - if(!$ged){ |
|
| 381 | + if (!$ged) { |
|
| 382 | 382 | $ged = Database::prepare( |
| 383 | 383 | 'SELECT f_gedcom AS gedrec FROM `##families`'. |
| 384 | 384 | ' WHERE f_file=:gedcom_id AND f_gedcom LIKE :gedcom') |
@@ -386,7 +386,7 @@ discard block |
||
| 386 | 386 | 'gedcom_id' => $this->tree->getTreeId(), |
| 387 | 387 | 'gedcom' => '%_ACT '.$this->getFilename().'%' |
| 388 | 388 | ))->fetchOne(); |
| 389 | - if(!$ged){ |
|
| 389 | + if (!$ged) { |
|
| 390 | 390 | $ged = Database::prepare( |
| 391 | 391 | 'SELECT o_gedcom AS gedrec FROM `##other`'. |
| 392 | 392 | ' WHERE o_file=:gedcom_id AND o_gedcom LIKE :gedcom') |
@@ -397,19 +397,19 @@ discard block |
||
| 397 | 397 | } |
| 398 | 398 | } |
| 399 | 399 | //If a record has been found, parse it to find the source reference. |
| 400 | - if($ged){ |
|
| 400 | + if ($ged) { |
|
| 401 | 401 | $gedlines = explode("\n", $ged); |
| 402 | 402 | $level = 0; |
| 403 | 403 | $levelsource = -1; |
| 404 | - $sid_tmp=null; |
|
| 404 | + $sid_tmp = null; |
|
| 405 | 405 | $sourcefound = false; |
| 406 | - foreach($gedlines as $gedline){ |
|
| 406 | + foreach ($gedlines as $gedline) { |
|
| 407 | 407 | // Get the level |
| 408 | 408 | $match = null; |
| 409 | 409 | if (!$sourcefound && preg_match('~^('.WT_REGEX_INTEGER.') ~', $gedline, $match)) { |
| 410 | 410 | $level = $match[1]; |
| 411 | 411 | //If we are not any more within the context of a source, reset |
| 412 | - if($level <= $levelsource){ |
|
| 412 | + if ($level <= $levelsource) { |
|
| 413 | 413 | $levelsource = -1; |
| 414 | 414 | $sid_tmp = null; |
| 415 | 415 | } |
@@ -417,11 +417,11 @@ discard block |
||
| 417 | 417 | $match2 = null; |
| 418 | 418 | if (preg_match('~^'.$level.' SOUR @('.WT_REGEX_XREF.')@$~', $gedline, $match2)) { |
| 419 | 419 | $levelsource = $level; |
| 420 | - $sid_tmp=$match2[1]; |
|
| 420 | + $sid_tmp = $match2[1]; |
|
| 421 | 421 | } |
| 422 | 422 | // If the image has be found, get the source reference and exit. |
| 423 | 423 | $match3 = null; |
| 424 | - if($levelsource>=0 && $sid_tmp && preg_match('~^'.$level.' _ACT '.preg_quote($this->getFilename()).'~', $gedline, $match3)){ |
|
| 424 | + if ($levelsource >= 0 && $sid_tmp && preg_match('~^'.$level.' _ACT '.preg_quote($this->getFilename()).'~', $gedline, $match3)) { |
|
| 425 | 425 | $sid = $sid_tmp; |
| 426 | 426 | $sourcefound = true; |
| 427 | 427 | } |
@@ -429,7 +429,7 @@ discard block |
||
| 429 | 429 | } |
| 430 | 430 | } |
| 431 | 431 | |
| 432 | - if($sid) $this->source = Source::getInstance($sid, $this->tree); |
|
| 432 | + if ($sid) $this->source = Source::getInstance($sid, $this->tree); |
|
| 433 | 433 | |
| 434 | 434 | return $this->source; |
| 435 | 435 | } |
@@ -252,7 +252,7 @@ |
||
| 252 | 252 | /** |
| 253 | 253 | * Return the HTML code for custom simple tag _ACT |
| 254 | 254 | * |
| 255 | - * @param Certificate $certificatePath Certificate (as per the GEDCOM) |
|
| 255 | + * @param Certificate $certificate Certificate (as per the GEDCOM) |
|
| 256 | 256 | * @param string|null $sid Linked Source ID, if it exists |
| 257 | 257 | */ |
| 258 | 258 | protected function getDisplay_ACT(Certificate $certificate, $sid = null){ |
@@ -77,7 +77,7 @@ discard block |
||
| 77 | 77 | * @see \Fisharebest\Webtrees\Module\ModuleConfigInterface::getConfigLink() |
| 78 | 78 | */ |
| 79 | 79 | public function getConfigLink() { |
| 80 | - return 'module.php?mod=' . $this->getName() . '&mod_action=AdminConfig'; |
|
| 80 | + return 'module.php?mod='.$this->getName().'&mod_action=AdminConfig'; |
|
| 81 | 81 | } |
| 82 | 82 | |
| 83 | 83 | /** |
@@ -102,7 +102,7 @@ discard block |
||
| 102 | 102 | */ |
| 103 | 103 | public function getMenu(Tree $tree, $reference = null) { |
| 104 | 104 | $tree_url = $tree ? $tree->getNameUrl() : ''; |
| 105 | - return new Menu($this->getTitle(), 'module.php?mod=' . $this->getName() . '&mod_action=Certificate@listAll&ged=' . $tree_url, 'menu-maj-list-certificate', array('rel' => 'nofollow')); |
|
| 105 | + return new Menu($this->getTitle(), 'module.php?mod='.$this->getName().'&mod_action=Certificate@listAll&ged='.$tree_url, 'menu-maj-list-certificate', array('rel' => 'nofollow')); |
|
| 106 | 106 | } |
| 107 | 107 | |
| 108 | 108 | /** |
@@ -111,10 +111,10 @@ discard block |
||
| 111 | 111 | */ |
| 112 | 112 | public function hFactSourcePrepend($srec) { |
| 113 | 113 | $wt_tree = Globals::getTree(); |
| 114 | - $html=''; |
|
| 115 | - $sid=null; |
|
| 114 | + $html = ''; |
|
| 115 | + $sid = null; |
|
| 116 | 116 | |
| 117 | - if($this->getSetting('MAJ_SHOW_CERT', Auth::PRIV_HIDE) >= Auth::accessLevel($wt_tree)){ |
|
| 117 | + if ($this->getSetting('MAJ_SHOW_CERT', Auth::PRIV_HIDE) >= Auth::accessLevel($wt_tree)) { |
|
| 118 | 118 | if (!$srec || strlen($srec) == 0) return $html; |
| 119 | 119 | |
| 120 | 120 | $certificate = null; |
@@ -122,17 +122,17 @@ discard block |
||
| 122 | 122 | $levelSOUR = substr($subrecords[0], 0, 1); |
| 123 | 123 | $match = null; |
| 124 | 124 | if (preg_match('~^'.$levelSOUR.' SOUR @('.WT_REGEX_XREF.')@$~', $subrecords[0], $match)) { |
| 125 | - $sid=$match[1]; |
|
| 125 | + $sid = $match[1]; |
|
| 126 | 126 | }; |
| 127 | 127 | $nb_subrecords = count($subrecords); |
| 128 | - for ($i=0; $i < $nb_subrecords; $i++) { |
|
| 128 | + for ($i = 0; $i < $nb_subrecords; $i++) { |
|
| 129 | 129 | $subrecords[$i] = trim($subrecords[$i]); |
| 130 | 130 | $tag = substr($subrecords[$i], 2, 4); |
| 131 | 131 | $text = substr($subrecords[$i], 7); |
| 132 | - if($tag == '_ACT') $certificate= new Certificate($text, $wt_tree, $this->getProvider()); |
|
| 132 | + if ($tag == '_ACT') $certificate = new Certificate($text, $wt_tree, $this->getProvider()); |
|
| 133 | 133 | } |
| 134 | 134 | |
| 135 | - if($certificate && $certificate->canShow()) |
|
| 135 | + if ($certificate && $certificate->canShow()) |
|
| 136 | 136 | $html = $this->getDisplay_ACT($certificate, $sid); |
| 137 | 137 | |
| 138 | 138 | } |
@@ -159,9 +159,9 @@ discard block |
||
| 159 | 159 | */ |
| 160 | 160 | public function hHtmlSimpleTagDisplay($tag, $value, $context = null, $contextid = null) { |
| 161 | 161 | $html = ''; |
| 162 | - switch($tag){ |
|
| 162 | + switch ($tag) { |
|
| 163 | 163 | case '_ACT': |
| 164 | - if($context == 'SOUR') $html = $this->getDisplay_ACT($value, $contextid); |
|
| 164 | + if ($context == 'SOUR') $html = $this->getDisplay_ACT($value, $contextid); |
|
| 165 | 165 | break; |
| 166 | 166 | } |
| 167 | 167 | return $html; |
@@ -174,7 +174,7 @@ discard block |
||
| 174 | 174 | public function hHtmlSimpleTagEditor($tag, $value = null, $element_id = '', $element_name = '', $context = null, $contextid = null) { |
| 175 | 175 | $html = ''; |
| 176 | 176 | |
| 177 | - switch($tag){ |
|
| 177 | + switch ($tag) { |
|
| 178 | 178 | case '_ACT': |
| 179 | 179 | $element_id = Uuid::uuid4(); |
| 180 | 180 | Globals::getController() |
@@ -182,14 +182,14 @@ discard block |
||
| 182 | 182 | ->addExternalJavascript(WT_STATIC_URL.WT_MODULES_DIR.$this->getName().'/js/autocomplete.js') |
| 183 | 183 | ->addExternalJavascript(WT_STATIC_URL.WT_MODULES_DIR.$this->getName().'/js/updatecertificatevalues.js'); |
| 184 | 184 | $certificate = null; |
| 185 | - if($value){ |
|
| 185 | + if ($value) { |
|
| 186 | 186 | $certificate = new Certificate($value, Globals::getTree(), $this->getProvider()); |
| 187 | 187 | } |
| 188 | 188 | $tabCities = $this->getProvider()->getCitiesList(); |
| 189 | 189 | $html .= '<select id="certifCity'.$element_id.'" class="_CITY">'; |
| 190 | - foreach ($tabCities as $cities){ |
|
| 191 | - $selectedCity=''; |
|
| 192 | - if($certificate && $cities== $certificate->getCity()) $selectedCity='selected="true"'; |
|
| 190 | + foreach ($tabCities as $cities) { |
|
| 191 | + $selectedCity = ''; |
|
| 192 | + if ($certificate && $cities == $certificate->getCity()) $selectedCity = 'selected="true"'; |
|
| 193 | 193 | $html .= '<option value="'.$cities.'" '.$selectedCity.' />'.$cities.'</option>'; |
| 194 | 194 | } |
| 195 | 195 | $html .= '</select>'; |
@@ -207,7 +207,7 @@ discard block |
||
| 207 | 207 | * @see \MyArtJaub\Webtrees\Hook\HookInterfaces\CustomSimpleTagManagerInterface::hAddSimpleTag() |
| 208 | 208 | */ |
| 209 | 209 | public function hAddSimpleTag($context, $level) { |
| 210 | - switch($context){ |
|
| 210 | + switch ($context) { |
|
| 211 | 211 | case 'SOUR': |
| 212 | 212 | FunctionsEdit::addSimpleTag($level.' _ACT'); |
| 213 | 213 | break; |
@@ -219,7 +219,7 @@ discard block |
||
| 219 | 219 | * @see \MyArtJaub\Webtrees\Hook\HookInterfaces\CustomSimpleTagManagerInterface::hHasHelpTextTag() |
| 220 | 220 | */ |
| 221 | 221 | public function hHasHelpTextTag($tag) { |
| 222 | - switch($tag){ |
|
| 222 | + switch ($tag) { |
|
| 223 | 223 | case '_ACT': |
| 224 | 224 | return true; |
| 225 | 225 | } |
@@ -231,7 +231,7 @@ discard block |
||
| 231 | 231 | * @see \MyArtJaub\Webtrees\Hook\HookInterfaces\CustomSimpleTagManagerInterface::hGetHelpTextTag() |
| 232 | 232 | */ |
| 233 | 233 | public function hGetHelpTextTag($tag) { |
| 234 | - switch($tag){ |
|
| 234 | + switch ($tag) { |
|
| 235 | 235 | case '_ACT': |
| 236 | 236 | return array( |
| 237 | 237 | I18N::translate('Certificate'), |
@@ -247,7 +247,7 @@ discard block |
||
| 247 | 247 | * @return \MyArtJaub\Webtrees\Module\Certificates\Model\CertificateProviderInterface |
| 248 | 248 | */ |
| 249 | 249 | public function getProvider() { |
| 250 | - if(!$this->provider) { |
|
| 250 | + if (!$this->provider) { |
|
| 251 | 251 | $root_path = $this->getSetting('MAJ_CERT_ROOTDIR', 'certificates/'); |
| 252 | 252 | $this->provider = new CertificateFileProvider($root_path, Globals::getTree()); |
| 253 | 253 | } |
@@ -261,9 +261,9 @@ discard block |
||
| 261 | 261 | * @param Certificate $certificatePath Certificate (as per the GEDCOM) |
| 262 | 262 | * @param string|null $sid Linked Source ID, if it exists |
| 263 | 263 | */ |
| 264 | - protected function getDisplay_ACT(Certificate $certificate, $sid = null){ |
|
| 264 | + protected function getDisplay_ACT(Certificate $certificate, $sid = null) { |
|
| 265 | 265 | $html = ''; |
| 266 | - if($certificate){ |
|
| 266 | + if ($certificate) { |
|
| 267 | 267 | $certificate->setSource($sid); |
| 268 | 268 | $html = $certificate->displayImage('icon'); |
| 269 | 269 | } |
@@ -115,7 +115,9 @@ discard block |
||
| 115 | 115 | $sid=null; |
| 116 | 116 | |
| 117 | 117 | if($this->getSetting('MAJ_SHOW_CERT', Auth::PRIV_HIDE) >= Auth::accessLevel($wt_tree)){ |
| 118 | - if (!$srec || strlen($srec) == 0) return $html; |
|
| 118 | + if (!$srec || strlen($srec) == 0) { |
|
| 119 | + return $html; |
|
| 120 | + } |
|
| 119 | 121 | |
| 120 | 122 | $certificate = null; |
| 121 | 123 | $subrecords = explode("\n", $srec); |
@@ -129,11 +131,14 @@ discard block |
||
| 129 | 131 | $subrecords[$i] = trim($subrecords[$i]); |
| 130 | 132 | $tag = substr($subrecords[$i], 2, 4); |
| 131 | 133 | $text = substr($subrecords[$i], 7); |
| 132 | - if($tag == '_ACT') $certificate= new Certificate($text, $wt_tree, $this->getProvider()); |
|
| 134 | + if($tag == '_ACT') { |
|
| 135 | + $certificate= new Certificate($text, $wt_tree, $this->getProvider()); |
|
| 136 | + } |
|
| 133 | 137 | } |
| 134 | 138 | |
| 135 | - if($certificate && $certificate->canShow()) |
|
| 136 | - $html = $this->getDisplay_ACT($certificate, $sid); |
|
| 139 | + if($certificate && $certificate->canShow()) { |
|
| 140 | + $html = $this->getDisplay_ACT($certificate, $sid); |
|
| 141 | + } |
|
| 137 | 142 | |
| 138 | 143 | } |
| 139 | 144 | return $html; |
@@ -161,7 +166,9 @@ discard block |
||
| 161 | 166 | $html = ''; |
| 162 | 167 | switch($tag){ |
| 163 | 168 | case '_ACT': |
| 164 | - if($context == 'SOUR') $html = $this->getDisplay_ACT($value, $contextid); |
|
| 169 | + if($context == 'SOUR') { |
|
| 170 | + $html = $this->getDisplay_ACT($value, $contextid); |
|
| 171 | + } |
|
| 165 | 172 | break; |
| 166 | 173 | } |
| 167 | 174 | return $html; |
@@ -189,7 +196,9 @@ discard block |
||
| 189 | 196 | $html .= '<select id="certifCity'.$element_id.'" class="_CITY">'; |
| 190 | 197 | foreach ($tabCities as $cities){ |
| 191 | 198 | $selectedCity=''; |
| 192 | - if($certificate && $cities== $certificate->getCity()) $selectedCity='selected="true"'; |
|
| 199 | + if($certificate && $cities== $certificate->getCity()) { |
|
| 200 | + $selectedCity='selected="true"'; |
|
| 201 | + } |
|
| 193 | 202 | $html .= '<option value="'.$cities.'" '.$selectedCity.' />'.$cities.'</option>'; |
| 194 | 203 | } |
| 195 | 204 | $html .= '</select>'; |
@@ -17,7 +17,6 @@ |
||
| 17 | 17 | use Fisharebest\Webtrees\Module\AbstractModule; |
| 18 | 18 | use Fisharebest\Webtrees\Module\ModuleConfigInterface; |
| 19 | 19 | use Fisharebest\Webtrees\Tree; |
| 20 | -use MyArtJaub\Webtrees\Functions\Functions; |
|
| 21 | 20 | use MyArtJaub\Webtrees\Globals; |
| 22 | 21 | use MyArtJaub\Webtrees\Hook\HookInterfaces\CustomSimpleTagManagerInterface; |
| 23 | 22 | use MyArtJaub\Webtrees\Hook\HookInterfaces\FactSourceTextExtenderInterface; |
@@ -31,147 +31,147 @@ discard block |
||
| 31 | 31 | * Certificates Module. |
| 32 | 32 | */ |
| 33 | 33 | class CertificatesModule |
| 34 | - extends AbstractModule |
|
| 35 | - implements HookSubscriberInterface, ModuleConfigInterface, ModuleMenuItemInterface, FactSourceTextExtenderInterface, CustomSimpleTagManagerInterface, DependentInterface |
|
| 34 | + extends AbstractModule |
|
| 35 | + implements HookSubscriberInterface, ModuleConfigInterface, ModuleMenuItemInterface, FactSourceTextExtenderInterface, CustomSimpleTagManagerInterface, DependentInterface |
|
| 36 | 36 | { |
| 37 | - /** @var string For custom modules - link for support, upgrades, etc. */ |
|
| 38 | - const CUSTOM_WEBSITE = 'https://github.com/jon48/webtrees-lib'; |
|
| 37 | + /** @var string For custom modules - link for support, upgrades, etc. */ |
|
| 38 | + const CUSTOM_WEBSITE = 'https://github.com/jon48/webtrees-lib'; |
|
| 39 | 39 | |
| 40 | - /** |
|
| 41 | - * Provider for Certificates |
|
| 42 | - * @var CertificateProviderInterface $provider |
|
| 43 | - */ |
|
| 44 | - protected $provider; |
|
| 40 | + /** |
|
| 41 | + * Provider for Certificates |
|
| 42 | + * @var CertificateProviderInterface $provider |
|
| 43 | + */ |
|
| 44 | + protected $provider; |
|
| 45 | 45 | |
| 46 | - /** |
|
| 47 | - * {@inhericDoc} |
|
| 48 | - */ |
|
| 49 | - public function getTitle() { |
|
| 50 | - return /* I18N: Name of the “Certificates” module */ I18N::translate('Certificates'); |
|
| 51 | - } |
|
| 46 | + /** |
|
| 47 | + * {@inhericDoc} |
|
| 48 | + */ |
|
| 49 | + public function getTitle() { |
|
| 50 | + return /* I18N: Name of the “Certificates” module */ I18N::translate('Certificates'); |
|
| 51 | + } |
|
| 52 | 52 | |
| 53 | - /** |
|
| 54 | - * {@inhericDoc} |
|
| 55 | - */ |
|
| 56 | - public function getDescription() { |
|
| 57 | - return /* I18N: Description of the “Certificates” module */ I18N::translate('Display and edition of certificates linked to sources.'); |
|
| 58 | - } |
|
| 53 | + /** |
|
| 54 | + * {@inhericDoc} |
|
| 55 | + */ |
|
| 56 | + public function getDescription() { |
|
| 57 | + return /* I18N: Description of the “Certificates” module */ I18N::translate('Display and edition of certificates linked to sources.'); |
|
| 58 | + } |
|
| 59 | 59 | |
| 60 | - /** |
|
| 61 | - * {@inhericDoc} |
|
| 62 | - */ |
|
| 63 | - public function modAction($mod_action) { |
|
| 64 | - \MyArtJaub\Webtrees\Mvc\Dispatcher::getInstance()->handle($this, $mod_action); |
|
| 65 | - } |
|
| 60 | + /** |
|
| 61 | + * {@inhericDoc} |
|
| 62 | + */ |
|
| 63 | + public function modAction($mod_action) { |
|
| 64 | + \MyArtJaub\Webtrees\Mvc\Dispatcher::getInstance()->handle($this, $mod_action); |
|
| 65 | + } |
|
| 66 | 66 | |
| 67 | - /** |
|
| 68 | - * {@inheritDoc} |
|
| 69 | - * @see \MyArtJaub\Webtrees\Module\DependentInterface::validatePrerequisites() |
|
| 70 | - */ |
|
| 71 | - public function validatePrerequisites() { |
|
| 72 | - } |
|
| 67 | + /** |
|
| 68 | + * {@inheritDoc} |
|
| 69 | + * @see \MyArtJaub\Webtrees\Module\DependentInterface::validatePrerequisites() |
|
| 70 | + */ |
|
| 71 | + public function validatePrerequisites() { |
|
| 72 | + } |
|
| 73 | 73 | |
| 74 | - /** |
|
| 75 | - * {@inhericDoc} |
|
| 76 | - * @see \Fisharebest\Webtrees\Module\ModuleConfigInterface::getConfigLink() |
|
| 77 | - */ |
|
| 78 | - public function getConfigLink() { |
|
| 79 | - return 'module.php?mod=' . $this->getName() . '&mod_action=AdminConfig'; |
|
| 80 | - } |
|
| 74 | + /** |
|
| 75 | + * {@inhericDoc} |
|
| 76 | + * @see \Fisharebest\Webtrees\Module\ModuleConfigInterface::getConfigLink() |
|
| 77 | + */ |
|
| 78 | + public function getConfigLink() { |
|
| 79 | + return 'module.php?mod=' . $this->getName() . '&mod_action=AdminConfig'; |
|
| 80 | + } |
|
| 81 | 81 | |
| 82 | - /** |
|
| 83 | - * {@inhericDoc} |
|
| 84 | - * @see \MyArtJaub\Webtrees\Hook\HookSubscriberInterface::getSubscribedHooks() |
|
| 85 | - */ |
|
| 86 | - public function getSubscribedHooks() { |
|
| 87 | - return array( |
|
| 88 | - 'hFactSourcePrepend' => 50, |
|
| 89 | - 'hGetExpectedTags' => 50, |
|
| 90 | - 'hHtmlSimpleTagDisplay#_ACT' => 50, |
|
| 91 | - 'hHtmlSimpleTagEditor#_ACT' => 50, |
|
| 92 | - 'hAddSimpleTag#SOUR' => 50, |
|
| 93 | - 'hHasHelpTextTag#_ACT' => 50, |
|
| 94 | - 'hGetHelpTextTag#_ACT' => 50 |
|
| 95 | - ); |
|
| 96 | - } |
|
| 82 | + /** |
|
| 83 | + * {@inhericDoc} |
|
| 84 | + * @see \MyArtJaub\Webtrees\Hook\HookSubscriberInterface::getSubscribedHooks() |
|
| 85 | + */ |
|
| 86 | + public function getSubscribedHooks() { |
|
| 87 | + return array( |
|
| 88 | + 'hFactSourcePrepend' => 50, |
|
| 89 | + 'hGetExpectedTags' => 50, |
|
| 90 | + 'hHtmlSimpleTagDisplay#_ACT' => 50, |
|
| 91 | + 'hHtmlSimpleTagEditor#_ACT' => 50, |
|
| 92 | + 'hAddSimpleTag#SOUR' => 50, |
|
| 93 | + 'hHasHelpTextTag#_ACT' => 50, |
|
| 94 | + 'hGetHelpTextTag#_ACT' => 50 |
|
| 95 | + ); |
|
| 96 | + } |
|
| 97 | 97 | |
| 98 | - /** |
|
| 99 | - * {@inhericDoc} |
|
| 100 | - * @see \MyArtJaub\Webtrees\Module\ModuleMenuItemInterface::getMenu() |
|
| 101 | - */ |
|
| 102 | - public function getMenu(Tree $tree, $reference = null) { |
|
| 103 | - $tree_url = $tree ? $tree->getNameUrl() : ''; |
|
| 104 | - return new Menu($this->getTitle(), 'module.php?mod=' . $this->getName() . '&mod_action=Certificate@listAll&ged=' . $tree_url, 'menu-maj-list-certificate', array('rel' => 'nofollow')); |
|
| 105 | - } |
|
| 98 | + /** |
|
| 99 | + * {@inhericDoc} |
|
| 100 | + * @see \MyArtJaub\Webtrees\Module\ModuleMenuItemInterface::getMenu() |
|
| 101 | + */ |
|
| 102 | + public function getMenu(Tree $tree, $reference = null) { |
|
| 103 | + $tree_url = $tree ? $tree->getNameUrl() : ''; |
|
| 104 | + return new Menu($this->getTitle(), 'module.php?mod=' . $this->getName() . '&mod_action=Certificate@listAll&ged=' . $tree_url, 'menu-maj-list-certificate', array('rel' => 'nofollow')); |
|
| 105 | + } |
|
| 106 | 106 | |
| 107 | - /** |
|
| 108 | - * {@inhericDoc} |
|
| 109 | - * @see \MyArtJaub\Webtrees\Hook\HookInterfaces\FactSourceTextExtenderInterface::hFactSourcePrepend() |
|
| 110 | - */ |
|
| 111 | - public function hFactSourcePrepend($srec) { |
|
| 112 | - $wt_tree = Globals::getTree(); |
|
| 113 | - $html=''; |
|
| 114 | - $sid=null; |
|
| 107 | + /** |
|
| 108 | + * {@inhericDoc} |
|
| 109 | + * @see \MyArtJaub\Webtrees\Hook\HookInterfaces\FactSourceTextExtenderInterface::hFactSourcePrepend() |
|
| 110 | + */ |
|
| 111 | + public function hFactSourcePrepend($srec) { |
|
| 112 | + $wt_tree = Globals::getTree(); |
|
| 113 | + $html=''; |
|
| 114 | + $sid=null; |
|
| 115 | 115 | |
| 116 | - if($this->getSetting('MAJ_SHOW_CERT', Auth::PRIV_HIDE) >= Auth::accessLevel($wt_tree)){ |
|
| 117 | - if (!$srec || strlen($srec) == 0) return $html; |
|
| 116 | + if($this->getSetting('MAJ_SHOW_CERT', Auth::PRIV_HIDE) >= Auth::accessLevel($wt_tree)){ |
|
| 117 | + if (!$srec || strlen($srec) == 0) return $html; |
|
| 118 | 118 | |
| 119 | - $certificate = null; |
|
| 120 | - $subrecords = explode("\n", $srec); |
|
| 121 | - $levelSOUR = substr($subrecords[0], 0, 1); |
|
| 122 | - $match = null; |
|
| 123 | - if (preg_match('~^'.$levelSOUR.' SOUR @('.WT_REGEX_XREF.')@$~', $subrecords[0], $match)) { |
|
| 124 | - $sid=$match[1]; |
|
| 125 | - }; |
|
| 126 | - $nb_subrecords = count($subrecords); |
|
| 127 | - for ($i=0; $i < $nb_subrecords; $i++) { |
|
| 128 | - $subrecords[$i] = trim($subrecords[$i]); |
|
| 129 | - $tag = substr($subrecords[$i], 2, 4); |
|
| 130 | - $text = substr($subrecords[$i], 7); |
|
| 131 | - if($tag == '_ACT') $certificate= new Certificate($text, $wt_tree, $this->getProvider()); |
|
| 132 | - } |
|
| 119 | + $certificate = null; |
|
| 120 | + $subrecords = explode("\n", $srec); |
|
| 121 | + $levelSOUR = substr($subrecords[0], 0, 1); |
|
| 122 | + $match = null; |
|
| 123 | + if (preg_match('~^'.$levelSOUR.' SOUR @('.WT_REGEX_XREF.')@$~', $subrecords[0], $match)) { |
|
| 124 | + $sid=$match[1]; |
|
| 125 | + }; |
|
| 126 | + $nb_subrecords = count($subrecords); |
|
| 127 | + for ($i=0; $i < $nb_subrecords; $i++) { |
|
| 128 | + $subrecords[$i] = trim($subrecords[$i]); |
|
| 129 | + $tag = substr($subrecords[$i], 2, 4); |
|
| 130 | + $text = substr($subrecords[$i], 7); |
|
| 131 | + if($tag == '_ACT') $certificate= new Certificate($text, $wt_tree, $this->getProvider()); |
|
| 132 | + } |
|
| 133 | 133 | |
| 134 | - if($certificate && $certificate->canShow()) |
|
| 135 | - $html = $this->getDisplay_ACT($certificate, $sid); |
|
| 134 | + if($certificate && $certificate->canShow()) |
|
| 135 | + $html = $this->getDisplay_ACT($certificate, $sid); |
|
| 136 | 136 | |
| 137 | - } |
|
| 138 | - return $html; |
|
| 139 | - } |
|
| 137 | + } |
|
| 138 | + return $html; |
|
| 139 | + } |
|
| 140 | 140 | |
| 141 | - /** |
|
| 142 | - * {@inhericDoc} |
|
| 143 | - * @see \MyArtJaub\Webtrees\Hook\HookInterfaces\FactSourceTextExtenderInterface::hFactSourceAppend() |
|
| 144 | - */ |
|
| 145 | - public function hFactSourceAppend($srec) { } |
|
| 141 | + /** |
|
| 142 | + * {@inhericDoc} |
|
| 143 | + * @see \MyArtJaub\Webtrees\Hook\HookInterfaces\FactSourceTextExtenderInterface::hFactSourceAppend() |
|
| 144 | + */ |
|
| 145 | + public function hFactSourceAppend($srec) { } |
|
| 146 | 146 | |
| 147 | - /** |
|
| 148 | - * {@inhericDoc} |
|
| 149 | - * @see \MyArtJaub\Webtrees\Hook\HookInterfaces\CustomSimpleTagManagerInterface::hGetExpectedTags() |
|
| 150 | - */ |
|
| 151 | - public function hGetExpectedTags() { |
|
| 152 | - return array('SOUR' => '_ACT'); |
|
| 153 | - } |
|
| 147 | + /** |
|
| 148 | + * {@inhericDoc} |
|
| 149 | + * @see \MyArtJaub\Webtrees\Hook\HookInterfaces\CustomSimpleTagManagerInterface::hGetExpectedTags() |
|
| 150 | + */ |
|
| 151 | + public function hGetExpectedTags() { |
|
| 152 | + return array('SOUR' => '_ACT'); |
|
| 153 | + } |
|
| 154 | 154 | |
| 155 | - /** |
|
| 156 | - * {@inhericDoc} |
|
| 157 | - * @see \MyArtJaub\Webtrees\Hook\HookInterfaces\CustomSimpleTagManagerInterface::hHtmlSimpleTagDisplay() |
|
| 158 | - */ |
|
| 159 | - public function hHtmlSimpleTagDisplay($tag, $value, $context = null, $contextid = null) { |
|
| 160 | - $html = ''; |
|
| 161 | - switch($tag){ |
|
| 162 | - case '_ACT': |
|
| 163 | - if($context == 'SOUR') $html = $this->getDisplay_ACT($value, $contextid); |
|
| 164 | - break; |
|
| 165 | - } |
|
| 166 | - return $html; |
|
| 167 | - } |
|
| 155 | + /** |
|
| 156 | + * {@inhericDoc} |
|
| 157 | + * @see \MyArtJaub\Webtrees\Hook\HookInterfaces\CustomSimpleTagManagerInterface::hHtmlSimpleTagDisplay() |
|
| 158 | + */ |
|
| 159 | + public function hHtmlSimpleTagDisplay($tag, $value, $context = null, $contextid = null) { |
|
| 160 | + $html = ''; |
|
| 161 | + switch($tag){ |
|
| 162 | + case '_ACT': |
|
| 163 | + if($context == 'SOUR') $html = $this->getDisplay_ACT($value, $contextid); |
|
| 164 | + break; |
|
| 165 | + } |
|
| 166 | + return $html; |
|
| 167 | + } |
|
| 168 | 168 | |
| 169 | - /** |
|
| 170 | - * {@inhericDoc} |
|
| 171 | - * @see \MyArtJaub\Webtrees\Hook\HookInterfaces\CustomSimpleTagManagerInterface::hHtmlSimpleTagEditor() |
|
| 172 | - */ |
|
| 173 | - public function hHtmlSimpleTagEditor($tag, $value = null, $element_id = '', $element_name = '', $context = null, $contextid = null) { |
|
| 174 | - $html = ''; |
|
| 169 | + /** |
|
| 170 | + * {@inhericDoc} |
|
| 171 | + * @see \MyArtJaub\Webtrees\Hook\HookInterfaces\CustomSimpleTagManagerInterface::hHtmlSimpleTagEditor() |
|
| 172 | + */ |
|
| 173 | + public function hHtmlSimpleTagEditor($tag, $value = null, $element_id = '', $element_name = '', $context = null, $contextid = null) { |
|
| 174 | + $html = ''; |
|
| 175 | 175 | |
| 176 | 176 | switch($tag){ |
| 177 | 177 | case '_ACT': |
@@ -199,75 +199,75 @@ discard block |
||
| 199 | 199 | } |
| 200 | 200 | |
| 201 | 201 | return $html; |
| 202 | - } |
|
| 202 | + } |
|
| 203 | 203 | |
| 204 | - /** |
|
| 205 | - * {@inhericDoc} |
|
| 206 | - * @see \MyArtJaub\Webtrees\Hook\HookInterfaces\CustomSimpleTagManagerInterface::hAddSimpleTag() |
|
| 207 | - */ |
|
| 208 | - public function hAddSimpleTag($context, $level) { |
|
| 209 | - switch($context){ |
|
| 210 | - case 'SOUR': |
|
| 211 | - FunctionsEdit::addSimpleTag($level.' _ACT'); |
|
| 212 | - break; |
|
| 213 | - } |
|
| 214 | - } |
|
| 204 | + /** |
|
| 205 | + * {@inhericDoc} |
|
| 206 | + * @see \MyArtJaub\Webtrees\Hook\HookInterfaces\CustomSimpleTagManagerInterface::hAddSimpleTag() |
|
| 207 | + */ |
|
| 208 | + public function hAddSimpleTag($context, $level) { |
|
| 209 | + switch($context){ |
|
| 210 | + case 'SOUR': |
|
| 211 | + FunctionsEdit::addSimpleTag($level.' _ACT'); |
|
| 212 | + break; |
|
| 213 | + } |
|
| 214 | + } |
|
| 215 | 215 | |
| 216 | - /** |
|
| 217 | - * {@inhericDoc} |
|
| 218 | - * @see \MyArtJaub\Webtrees\Hook\HookInterfaces\CustomSimpleTagManagerInterface::hHasHelpTextTag() |
|
| 219 | - */ |
|
| 220 | - public function hHasHelpTextTag($tag) { |
|
| 221 | - switch($tag){ |
|
| 216 | + /** |
|
| 217 | + * {@inhericDoc} |
|
| 218 | + * @see \MyArtJaub\Webtrees\Hook\HookInterfaces\CustomSimpleTagManagerInterface::hHasHelpTextTag() |
|
| 219 | + */ |
|
| 220 | + public function hHasHelpTextTag($tag) { |
|
| 221 | + switch($tag){ |
|
| 222 | 222 | case '_ACT': |
| 223 | 223 | return true; |
| 224 | 224 | } |
| 225 | 225 | return false; |
| 226 | - } |
|
| 226 | + } |
|
| 227 | 227 | |
| 228 | - /** |
|
| 229 | - * {@inhericDoc} |
|
| 230 | - * @see \MyArtJaub\Webtrees\Hook\HookInterfaces\CustomSimpleTagManagerInterface::hGetHelpTextTag() |
|
| 231 | - */ |
|
| 232 | - public function hGetHelpTextTag($tag) { |
|
| 233 | - switch($tag){ |
|
| 234 | - case '_ACT': |
|
| 235 | - return array( |
|
| 236 | - I18N::translate('Certificate'), |
|
| 237 | - '<p>'.I18N::translate('Path to a certificate linked to a source reference.').'</p>'); |
|
| 238 | - default: |
|
| 239 | - return null; |
|
| 240 | - } |
|
| 241 | - } |
|
| 228 | + /** |
|
| 229 | + * {@inhericDoc} |
|
| 230 | + * @see \MyArtJaub\Webtrees\Hook\HookInterfaces\CustomSimpleTagManagerInterface::hGetHelpTextTag() |
|
| 231 | + */ |
|
| 232 | + public function hGetHelpTextTag($tag) { |
|
| 233 | + switch($tag){ |
|
| 234 | + case '_ACT': |
|
| 235 | + return array( |
|
| 236 | + I18N::translate('Certificate'), |
|
| 237 | + '<p>'.I18N::translate('Path to a certificate linked to a source reference.').'</p>'); |
|
| 238 | + default: |
|
| 239 | + return null; |
|
| 240 | + } |
|
| 241 | + } |
|
| 242 | 242 | |
| 243 | - /** |
|
| 244 | - * Returns the default Certificate File Provider, as configured in the module |
|
| 245 | - * |
|
| 246 | - * @return \MyArtJaub\Webtrees\Module\Certificates\Model\CertificateProviderInterface |
|
| 247 | - */ |
|
| 248 | - public function getProvider() { |
|
| 249 | - if(!$this->provider) { |
|
| 250 | - $root_path = $this->getSetting('MAJ_CERT_ROOTDIR', 'certificates/'); |
|
| 251 | - $this->provider = new CertificateFileProvider($root_path, Globals::getTree()); |
|
| 252 | - } |
|
| 253 | - return $this->provider; |
|
| 254 | - } |
|
| 243 | + /** |
|
| 244 | + * Returns the default Certificate File Provider, as configured in the module |
|
| 245 | + * |
|
| 246 | + * @return \MyArtJaub\Webtrees\Module\Certificates\Model\CertificateProviderInterface |
|
| 247 | + */ |
|
| 248 | + public function getProvider() { |
|
| 249 | + if(!$this->provider) { |
|
| 250 | + $root_path = $this->getSetting('MAJ_CERT_ROOTDIR', 'certificates/'); |
|
| 251 | + $this->provider = new CertificateFileProvider($root_path, Globals::getTree()); |
|
| 252 | + } |
|
| 253 | + return $this->provider; |
|
| 254 | + } |
|
| 255 | 255 | |
| 256 | 256 | |
| 257 | - /** |
|
| 258 | - * Return the HTML code for custom simple tag _ACT |
|
| 259 | - * |
|
| 260 | - * @param Certificate $certificatePath Certificate (as per the GEDCOM) |
|
| 261 | - * @param string|null $sid Linked Source ID, if it exists |
|
| 262 | - */ |
|
| 263 | - protected function getDisplay_ACT(Certificate $certificate, $sid = null){ |
|
| 264 | - $html = ''; |
|
| 265 | - if($certificate){ |
|
| 266 | - $certificate->setSource($sid); |
|
| 267 | - $html = $certificate->displayImage('icon'); |
|
| 268 | - } |
|
| 269 | - return $html; |
|
| 270 | - } |
|
| 257 | + /** |
|
| 258 | + * Return the HTML code for custom simple tag _ACT |
|
| 259 | + * |
|
| 260 | + * @param Certificate $certificatePath Certificate (as per the GEDCOM) |
|
| 261 | + * @param string|null $sid Linked Source ID, if it exists |
|
| 262 | + */ |
|
| 263 | + protected function getDisplay_ACT(Certificate $certificate, $sid = null){ |
|
| 264 | + $html = ''; |
|
| 265 | + if($certificate){ |
|
| 266 | + $certificate->setSource($sid); |
|
| 267 | + $html = $certificate->displayImage('icon'); |
|
| 268 | + } |
|
| 269 | + return $html; |
|
| 270 | + } |
|
| 271 | 271 | |
| 272 | 272 | |
| 273 | 273 | } |
@@ -42,7 +42,6 @@ |
||
| 42 | 42 | * Get all the data from the bag for a given key. |
| 43 | 43 | * |
| 44 | 44 | * @param string $key |
| 45 | - * @param string $format |
|
| 46 | 45 | * @return unknown |
| 47 | 46 | */ |
| 48 | 47 | public function get($key, $default = null) |
@@ -73,8 +73,8 @@ discard block |
||
| 73 | 73 | * @param bool $override |
| 74 | 74 | */ |
| 75 | 75 | public function set($key, $value, $override = true) { |
| 76 | - if(is_null($key)) return; |
|
| 77 | - if(!$override && array_key_exists($key, $this->data)) return; |
|
| 76 | + if (is_null($key)) return; |
|
| 77 | + if (!$override && array_key_exists($key, $this->data)) return; |
|
| 78 | 78 | $this->data[$key] = $value; |
| 79 | 79 | } |
| 80 | 80 | |
@@ -107,7 +107,7 @@ discard block |
||
| 107 | 107 | * @param string $key |
| 108 | 108 | */ |
| 109 | 109 | public function __unset($key) { |
| 110 | - unset($this->data[$key]);; |
|
| 110 | + unset($this->data[$key]); ; |
|
| 111 | 111 | } |
| 112 | 112 | |
| 113 | 113 | } |
@@ -73,8 +73,12 @@ |
||
| 73 | 73 | * @param bool $override |
| 74 | 74 | */ |
| 75 | 75 | public function set($key, $value, $override = true) { |
| 76 | - if(is_null($key)) return; |
|
| 77 | - if(!$override && array_key_exists($key, $this->data)) return; |
|
| 76 | + if(is_null($key)) { |
|
| 77 | + return; |
|
| 78 | + } |
|
| 79 | + if(!$override && array_key_exists($key, $this->data)) { |
|
| 80 | + return; |
|
| 81 | + } |
|
| 78 | 82 | $this->data[$key] = $value; |
| 79 | 83 | } |
| 80 | 84 | |
@@ -18,97 +18,97 @@ |
||
| 18 | 18 | /** |
| 19 | 19 | * @var array $data Container for data |
| 20 | 20 | */ |
| 21 | - protected $data = array(); |
|
| 21 | + protected $data = array(); |
|
| 22 | 22 | |
| 23 | - /** |
|
| 24 | - * Constructor for ViewBag |
|
| 25 | - * @param array $data_in |
|
| 26 | - */ |
|
| 27 | - public function __construct(array $data_in = array()) { |
|
| 28 | - $this->data = $data_in; |
|
| 29 | - } |
|
| 23 | + /** |
|
| 24 | + * Constructor for ViewBag |
|
| 25 | + * @param array $data_in |
|
| 26 | + */ |
|
| 27 | + public function __construct(array $data_in = array()) { |
|
| 28 | + $this->data = $data_in; |
|
| 29 | + } |
|
| 30 | 30 | |
| 31 | - /** |
|
| 32 | - * Get the keys present in the view bag. |
|
| 33 | - * |
|
| 34 | - * @return array |
|
| 35 | - */ |
|
| 36 | - public function keys() |
|
| 37 | - { |
|
| 38 | - return array_keys($this->data); |
|
| 39 | - } |
|
| 31 | + /** |
|
| 32 | + * Get the keys present in the view bag. |
|
| 33 | + * |
|
| 34 | + * @return array |
|
| 35 | + */ |
|
| 36 | + public function keys() |
|
| 37 | + { |
|
| 38 | + return array_keys($this->data); |
|
| 39 | + } |
|
| 40 | 40 | |
| 41 | - /** |
|
| 42 | - * Get all the data from the bag for a given key. |
|
| 43 | - * |
|
| 44 | - * @param string $key |
|
| 45 | - * @param string $format |
|
| 46 | - * @return unknown |
|
| 47 | - */ |
|
| 48 | - public function get($key, $default = null) |
|
| 49 | - { |
|
| 50 | - if (array_key_exists($key, $this->data)) { |
|
| 51 | - return $this->data[$key]; |
|
| 52 | - } |
|
| 53 | - return $default; |
|
| 54 | - } |
|
| 41 | + /** |
|
| 42 | + * Get all the data from the bag for a given key. |
|
| 43 | + * |
|
| 44 | + * @param string $key |
|
| 45 | + * @param string $format |
|
| 46 | + * @return unknown |
|
| 47 | + */ |
|
| 48 | + public function get($key, $default = null) |
|
| 49 | + { |
|
| 50 | + if (array_key_exists($key, $this->data)) { |
|
| 51 | + return $this->data[$key]; |
|
| 52 | + } |
|
| 53 | + return $default; |
|
| 54 | + } |
|
| 55 | 55 | |
| 56 | - /** |
|
| 57 | - * Magic getter. |
|
| 58 | - * Returns the value associated with the key. |
|
| 59 | - * |
|
| 60 | - * @param string $key |
|
| 61 | - * @return unknown |
|
| 62 | - */ |
|
| 63 | - public function __get($key) { |
|
| 64 | - return $this->get($key, null); |
|
| 65 | - } |
|
| 56 | + /** |
|
| 57 | + * Magic getter. |
|
| 58 | + * Returns the value associated with the key. |
|
| 59 | + * |
|
| 60 | + * @param string $key |
|
| 61 | + * @return unknown |
|
| 62 | + */ |
|
| 63 | + public function __get($key) { |
|
| 64 | + return $this->get($key, null); |
|
| 65 | + } |
|
| 66 | 66 | |
| 67 | - /** |
|
| 68 | - * Set the value for the specified key. |
|
| 69 | - * Can define whether to override an existing value; |
|
| 70 | - * |
|
| 71 | - * @param string $key |
|
| 72 | - * @param mixed $value |
|
| 73 | - * @param bool $override |
|
| 74 | - */ |
|
| 75 | - public function set($key, $value, $override = true) { |
|
| 76 | - if(is_null($key)) return; |
|
| 77 | - if(!$override && array_key_exists($key, $this->data)) return; |
|
| 78 | - $this->data[$key] = $value; |
|
| 79 | - } |
|
| 67 | + /** |
|
| 68 | + * Set the value for the specified key. |
|
| 69 | + * Can define whether to override an existing value; |
|
| 70 | + * |
|
| 71 | + * @param string $key |
|
| 72 | + * @param mixed $value |
|
| 73 | + * @param bool $override |
|
| 74 | + */ |
|
| 75 | + public function set($key, $value, $override = true) { |
|
| 76 | + if(is_null($key)) return; |
|
| 77 | + if(!$override && array_key_exists($key, $this->data)) return; |
|
| 78 | + $this->data[$key] = $value; |
|
| 79 | + } |
|
| 80 | 80 | |
| 81 | - /** |
|
| 82 | - * Magic setter. |
|
| 83 | - * Set the value for the specified key. |
|
| 84 | - * |
|
| 85 | - * @param string $key |
|
| 86 | - * @param mixed $value |
|
| 87 | - */ |
|
| 88 | - public function __set($key, $value) { |
|
| 89 | - $this->set($key, $value); |
|
| 90 | - } |
|
| 81 | + /** |
|
| 82 | + * Magic setter. |
|
| 83 | + * Set the value for the specified key. |
|
| 84 | + * |
|
| 85 | + * @param string $key |
|
| 86 | + * @param mixed $value |
|
| 87 | + */ |
|
| 88 | + public function __set($key, $value) { |
|
| 89 | + $this->set($key, $value); |
|
| 90 | + } |
|
| 91 | 91 | |
| 92 | - /** |
|
| 93 | - * Magic isset |
|
| 94 | - * Checks whether the ViewBag contains the specified key |
|
| 95 | - * |
|
| 96 | - * @param string $key |
|
| 97 | - * @return bool |
|
| 98 | - */ |
|
| 99 | - public function __isset($key) { |
|
| 100 | - return isset($this->data[$key]); |
|
| 101 | - } |
|
| 92 | + /** |
|
| 93 | + * Magic isset |
|
| 94 | + * Checks whether the ViewBag contains the specified key |
|
| 95 | + * |
|
| 96 | + * @param string $key |
|
| 97 | + * @return bool |
|
| 98 | + */ |
|
| 99 | + public function __isset($key) { |
|
| 100 | + return isset($this->data[$key]); |
|
| 101 | + } |
|
| 102 | 102 | |
| 103 | - /** |
|
| 104 | - * Magic unset |
|
| 105 | - * Unset the specified key from the ViewBag |
|
| 106 | - * |
|
| 107 | - * @param string $key |
|
| 108 | - */ |
|
| 109 | - public function __unset($key) { |
|
| 110 | - unset($this->data[$key]);; |
|
| 111 | - } |
|
| 103 | + /** |
|
| 104 | + * Magic unset |
|
| 105 | + * Unset the specified key from the ViewBag |
|
| 106 | + * |
|
| 107 | + * @param string $key |
|
| 108 | + */ |
|
| 109 | + public function __unset($key) { |
|
| 110 | + unset($this->data[$key]);; |
|
| 111 | + } |
|
| 112 | 112 | |
| 113 | 113 | } |
| 114 | 114 | |
| 115 | 115 | \ No newline at end of file |
@@ -14,17 +14,17 @@ discard block |
||
| 14 | 14 | */ |
| 15 | 15 | class Constants { |
| 16 | 16 | |
| 17 | - const LIB_NAMESPACE = __NAMESPACE__; |
|
| 17 | + const LIB_NAMESPACE = __NAMESPACE__; |
|
| 18 | 18 | |
| 19 | - /** Internal name of the Certificates Module |
|
| 20 | - * @var string |
|
| 21 | - */ |
|
| 22 | - const MODULE_MAJ_CERTIF_NAME = 'myartjaub_certificates'; |
|
| 19 | + /** Internal name of the Certificates Module |
|
| 20 | + * @var string |
|
| 21 | + */ |
|
| 22 | + const MODULE_MAJ_CERTIF_NAME = 'myartjaub_certificates'; |
|
| 23 | 23 | |
| 24 | - /** Internal name of the GeoDispersion Module |
|
| 25 | - * @var string |
|
| 26 | - */ |
|
| 27 | - const MODULE_MAJ_GEODISP_NAME = 'myartjaub_geodispersion'; |
|
| 24 | + /** Internal name of the GeoDispersion Module |
|
| 25 | + * @var string |
|
| 26 | + */ |
|
| 27 | + const MODULE_MAJ_GEODISP_NAME = 'myartjaub_geodispersion'; |
|
| 28 | 28 | |
| 29 | 29 | /** Internal name of the Hooks Module |
| 30 | 30 | * @var string |
@@ -61,7 +61,7 @@ discard block |
||
| 61 | 61 | * @return string $WT_RAPHAEL_JS_URL |
| 62 | 62 | */ |
| 63 | 63 | public static function WT_RAPHAEL_JS_URL() { |
| 64 | - return WT_STATIC_URL . 'packages/raphael-2.1.4/raphael-min.js'; |
|
| 64 | + return WT_STATIC_URL . 'packages/raphael-2.1.4/raphael-min.js'; |
|
| 65 | 65 | } |
| 66 | 66 | |
| 67 | 67 | } |
| 68 | 68 | \ No newline at end of file |
@@ -61,7 +61,7 @@ |
||
| 61 | 61 | * @return string $WT_RAPHAEL_JS_URL |
| 62 | 62 | */ |
| 63 | 63 | public static function WT_RAPHAEL_JS_URL() { |
| 64 | - return WT_STATIC_URL . 'packages/raphael-2.1.4/raphael-min.js'; |
|
| 64 | + return WT_STATIC_URL.'packages/raphael-2.1.4/raphael-min.js'; |
|
| 65 | 65 | } |
| 66 | 66 | |
| 67 | 67 | } |
| 68 | 68 | \ No newline at end of file |