diff options
| author | Scrutinizer Auto-Fixer <auto-fixer@scrutinizer-ci.com> | 2015-01-18 17:21:35 +0000 |
|---|---|---|
| committer | Scrutinizer Auto-Fixer <auto-fixer@scrutinizer-ci.com> | 2015-01-18 17:21:35 +0000 |
| commit | 8ed2bd8c2c1c5d062b821a251d158e6340ba3d96 (patch) | |
| tree | 753f4785046a31b1dcc812e86756b60f95d6bcec | |
| parent | a4131d0034f4473a6d4a8b6eeed0094eb1726fb6 (diff) | |
| download | webtrees-8ed2bd8c2c1c5d062b821a251d158e6340ba3d96.tar.gz webtrees-8ed2bd8c2c1c5d062b821a251d158e6340ba3d96.tar.bz2 webtrees-8ed2bd8c2c1c5d062b821a251d158e6340ba3d96.zip | |
Scrutinizer Auto-Fixes
This commit consists of patches automatically generated for this project on https://scrutinizer-ci.com
| -rw-r--r-- | site-unavailable.php | 8 | ||||
| -rw-r--r-- | source.php | 14 | ||||
| -rw-r--r-- | sourcelist.php | 2 | ||||
| -rw-r--r-- | statisticsplot.php | 40 | ||||
| -rw-r--r-- | themes/_custom/theme.php | 2 | ||||
| -rw-r--r-- | timeline.php | 12 |
6 files changed, 39 insertions, 39 deletions
diff --git a/site-unavailable.php b/site-unavailable.php index 186b39ba7b..096b45df6b 100644 --- a/site-unavailable.php +++ b/site-unavailable.php @@ -30,7 +30,7 @@ define('WT_SERVER_NAME', ''); define('WT_SCRIPT_PATH', ''); define('WT_ROOT', ''); define('WT_GED_ID', 0); -define('WT_DATA_DIR', realpath('data').DIRECTORY_SEPARATOR); +define('WT_DATA_DIR', realpath('data') . DIRECTORY_SEPARATOR); $WT_SESSION = new stdClass; $WT_SESSION->locale = ''; @@ -40,7 +40,7 @@ require 'includes/functions/functions.php'; define('WT_LOCALE', WT_I18N::init()); header('Content-Type: text/html; charset=UTF-8'); -header($_SERVER["SERVER_PROTOCOL"].' 503 Service Temporarily Unavailable'); +header($_SERVER["SERVER_PROTOCOL"] . ' 503 Service Temporarily Unavailable'); echo '<!DOCTYPE html>', @@ -64,10 +64,10 @@ echo '<div class="content">', '<p>', WT_I18N::translate('Oops! The webserver is unable to connect to the database server. It could be busy, undergoing maintenance, or simply broken. You should <a href="index.php">try again</a> in a few minutes or contact the website administrator.'), '</p>'; -$config_ini_php=parse_ini_file('data/config.ini.php'); +$config_ini_php = parse_ini_file('data/config.ini.php'); if (is_array($config_ini_php) && array_key_exists('dbhost', $config_ini_php) && array_key_exists('dbport', $config_ini_php) && array_key_exists('dbuser', $config_ini_php) && array_key_exists('dbpass', $config_ini_php) && array_key_exists('dbname', $config_ini_php)) { try { - $dbh=new PDO('mysql:host='.$config_ini_php['dbhost'].';port='.$config_ini_php['dbport'].';dbname='.$config_ini_php['dbname'], $config_ini_php['dbuser'], $config_ini_php['dbpass'], array(PDO::ATTR_ERRMODE=>PDO::ERRMODE_EXCEPTION, PDO::ATTR_DEFAULT_FETCH_MODE=>PDO::FETCH_OBJ, PDO::ATTR_CASE=>PDO::CASE_LOWER, PDO::ATTR_AUTOCOMMIT=>true)); + $dbh = new PDO('mysql:host=' . $config_ini_php['dbhost'] . ';port=' . $config_ini_php['dbport'] . ';dbname=' . $config_ini_php['dbname'], $config_ini_php['dbuser'], $config_ini_php['dbpass'], array(PDO::ATTR_ERRMODE=>PDO::ERRMODE_EXCEPTION, PDO::ATTR_DEFAULT_FETCH_MODE=>PDO::FETCH_OBJ, PDO::ATTR_CASE=>PDO::CASE_LOWER, PDO::ATTR_AUTOCOMMIT=>true)); } catch (PDOException $ex) { echo '<p>', WT_I18N::translate('The database reported the following error message:'), '</p>'; echo '<blockquote>', $ex->getMessage(), '</blockquote>'; diff --git a/source.php b/source.php index 6c39d4d935..8aeeddcdda 100644 --- a/source.php +++ b/source.php @@ -24,7 +24,7 @@ define('WT_SCRIPT_NAME', 'source.php'); require './includes/session.php'; -require_once WT_ROOT.'includes/functions/functions_print_lists.php'; +require_once WT_ROOT . 'includes/functions/functions_print_lists.php'; $controller = new WT_Controller_Source; @@ -36,8 +36,8 @@ if ($controller->record && $controller->record->canShow()) { '<p class="ui-state-highlight">', /* I18N: %1$s is “accept”, %2$s is “reject”. These are links. */ WT_I18N::translate( 'This source has been deleted. You should review the deletion and then %1$s or %2$s it.', - '<a href="#" onclick="accept_changes(\''.$controller->record->getXref().'\');">' . WT_I18N::translate_c('You should review the deletion and then accept or reject it.', 'accept') . '</a>', - '<a href="#" onclick="reject_changes(\''.$controller->record->getXref().'\');">' . WT_I18N::translate_c('You should review the deletion and then accept or reject it.', 'reject') . '</a>' + '<a href="#" onclick="accept_changes(\'' . $controller->record->getXref() . '\');">' . WT_I18N::translate_c('You should review the deletion and then accept or reject it.', 'accept') . '</a>', + '<a href="#" onclick="reject_changes(\'' . $controller->record->getXref() . '\');">' . WT_I18N::translate_c('You should review the deletion and then accept or reject it.', 'reject') . '</a>' ), ' ', help_link('pending_changes'), '</p>'; @@ -54,8 +54,8 @@ if ($controller->record && $controller->record->canShow()) { '<p class="ui-state-highlight">', /* I18N: %1$s is “accept”, %2$s is “reject”. These are links. */ WT_I18N::translate( 'This source has been edited. You should review the changes and then %1$s or %2$s them.', - '<a href="#" onclick="accept_changes(\''.$controller->record->getXref().'\');">' . WT_I18N::translate_c('You should review the changes and then accept or reject them.', 'accept') . '</a>', - '<a href="#" onclick="reject_changes(\''.$controller->record->getXref().'\');">' . WT_I18N::translate_c('You should review the changes and then accept or reject them.', 'reject') . '</a>' + '<a href="#" onclick="accept_changes(\'' . $controller->record->getXref() . '\');">' . WT_I18N::translate_c('You should review the changes and then accept or reject them.', 'accept') . '</a>', + '<a href="#" onclick="reject_changes(\'' . $controller->record->getXref() . '\');">' . WT_I18N::translate_c('You should review the changes and then accept or reject them.', 'reject') . '</a>' ), ' ', help_link('pending_changes'), '</p>'; @@ -68,7 +68,7 @@ if ($controller->record && $controller->record->canShow()) { } } } else { - header($_SERVER['SERVER_PROTOCOL'].' 404 Not Found'); + header($_SERVER['SERVER_PROTOCOL'] . ' 404 Not Found'); $controller->pageHeader(); echo '<p class="ui-state-error">', WT_I18N::translate('This source does not exist or you do not have permission to view it.'), '</p>'; exit; @@ -111,7 +111,7 @@ echo '<div id="source-tabs"> echo '<table class="facts_table">'; // Fetch the facts - $facts=$controller->record->getFacts(); + $facts = $controller->record->getFacts(); // Sort the facts usort( diff --git a/sourcelist.php b/sourcelist.php index e75d52669e..c44c70de99 100644 --- a/sourcelist.php +++ b/sourcelist.php @@ -23,7 +23,7 @@ define('WT_SCRIPT_NAME', 'sourcelist.php'); require './includes/session.php'; -require_once WT_ROOT.'includes/functions/functions_print_lists.php'; +require_once WT_ROOT . 'includes/functions/functions_print_lists.php'; $controller = new WT_Controller_Page; $controller->setPageTitle(WT_I18N::translate('Sources')); diff --git a/statisticsplot.php b/statisticsplot.php index 6f8f63ef74..1763877261 100644 --- a/statisticsplot.php +++ b/statisticsplot.php @@ -257,7 +257,7 @@ function lifespan_by_birth_year() { $num = $stats->statsAgeQuery(false, 'BIRT'); foreach ($num as $values) { foreach ($values as $age_value) { - fill_y_data(0, (int)($age_value / 365.25), 1); + fill_y_data(0, (int) ($age_value / 365.25), 1); $n1++; } } @@ -265,14 +265,14 @@ function lifespan_by_birth_year() { $num = $stats->statsAgeQuery(false, 'BIRT', 'M'); foreach ($num as $values) { foreach ($values as $age_value) { - fill_y_data(0, (int)($age_value / 365.25), 1); + fill_y_data(0, (int) ($age_value / 365.25), 1); $n1++; } } $num = $stats->statsAgeQuery(false, 'BIRT', 'F'); foreach ($num as $values) { foreach ($values as $age_value) { - fill_y_data(1, (int)($age_value / 365.25), 1); + fill_y_data(1, (int) ($age_value / 365.25), 1); $n1++; } } @@ -282,7 +282,7 @@ function lifespan_by_birth_year() { $num = $stats->statsAgeQuery(false, 'BIRT', 'BOTH', $zstart, $boundary); foreach ($num as $values) { foreach ($values as $age_value) { - fill_y_data($boundary, (int)($age_value / 365.25), 1); + fill_y_data($boundary, (int) ($age_value / 365.25), 1); $n1++; } } @@ -299,7 +299,7 @@ function lifespan_by_death_year() { $num = $stats->statsAgeQuery(false, 'DEAT'); foreach ($num as $values) { foreach ($values as $age_value) { - fill_y_data(0, (int)($age_value / 365.25), 1); + fill_y_data(0, (int) ($age_value / 365.25), 1); $n1++; } } @@ -307,14 +307,14 @@ function lifespan_by_death_year() { $num = $stats->statsAgeQuery(false, 'DEAT', 'M'); foreach ($num as $values) { foreach ($values as $age_value) { - fill_y_data(0, (int)($age_value / 365.25), 1); + fill_y_data(0, (int) ($age_value / 365.25), 1); $n1++; } } $num = $stats->statsAgeQuery(false, 'DEAT', 'F'); foreach ($num as $values) { foreach ($values as $age_value) { - fill_y_data(1, (int)($age_value / 365.25), 1); + fill_y_data(1, (int) ($age_value / 365.25), 1); $n1++; } } @@ -324,7 +324,7 @@ function lifespan_by_death_year() { $num = $stats->statsAgeQuery(false, 'DEAT', 'BOTH', $zstart, $boundary); foreach ($num as $values) { foreach ($values as $age_value) { - fill_y_data($boundary, (int)($age_value / 365.25), 1); + fill_y_data($boundary, (int) ($age_value / 365.25), 1); $n1++; } } @@ -340,23 +340,23 @@ function age_at_marriage() { if ($z_axis == 300) { $num = $stats->statsMarrAgeQuery(false, 'M'); foreach ($num as $values) { - fill_y_data(0, (int)($values['age'] / 365.25), 1); + fill_y_data(0, (int) ($values['age'] / 365.25), 1); $n1++; } $num = $stats->statsMarrAgeQuery(false, 'F'); foreach ($num as $values) { - fill_y_data(0, (int)($values['age'] / 365.25), 1); + fill_y_data(0, (int) ($values['age'] / 365.25), 1); $n1++; } } else if ($z_axis == 301) { $num = $stats->statsMarrAgeQuery(false, 'M'); foreach ($num as $values) { - fill_y_data(0, (int)($values['age'] / 365.25), 1); + fill_y_data(0, (int) ($values['age'] / 365.25), 1); $n1++; } $num = $stats->statsMarrAgeQuery(false, 'F'); foreach ($num as $values) { - fill_y_data(1, (int)($values['age'] / 365.25), 1); + fill_y_data(1, (int) ($values['age'] / 365.25), 1); $n1++; } } else { @@ -364,12 +364,12 @@ function age_at_marriage() { foreach ($z_boundaries as $boundary) { $num = $stats->statsMarrAgeQuery(false, 'M', $zstart, $boundary); foreach ($num as $values) { - fill_y_data($boundary, (int)($values['age'] / 365.25), 1); + fill_y_data($boundary, (int) ($values['age'] / 365.25), 1); $n1++; } $num = $stats->statsMarrAgeQuery(false, 'F', $zstart, $boundary); foreach ($num as $values) { - fill_y_data($boundary, (int)($values['age'] / 365.25), 1); + fill_y_data($boundary, (int) ($values['age'] / 365.25), 1); $n1++; } $zstart = $boundary + 1; @@ -386,7 +386,7 @@ function age_at_first_marriage() { $indi = array(); foreach ($num as $values) { if (!in_array($values['d_gid'], $indi)) { - fill_y_data(0, (int)($values['age'] / 365.25), 1); + fill_y_data(0, (int) ($values['age'] / 365.25), 1); $n1++; $indi[] = $values['d_gid']; } @@ -395,7 +395,7 @@ function age_at_first_marriage() { $indi = array(); foreach ($num as $values) { if (!in_array($values['d_gid'], $indi)) { - fill_y_data(0, (int)($values['age'] / 365.25), 1); + fill_y_data(0, (int) ($values['age'] / 365.25), 1); $n1++; $indi[] = $values['d_gid']; } @@ -405,7 +405,7 @@ function age_at_first_marriage() { $indi = array(); foreach ($num as $values) { if (!in_array($values['d_gid'], $indi)) { - fill_y_data(0, (int)($values['age'] / 365.25), 1); + fill_y_data(0, (int) ($values['age'] / 365.25), 1); $n1++; $indi[] = $values['d_gid']; } @@ -414,7 +414,7 @@ function age_at_first_marriage() { $indi = array(); foreach ($num as $values) { if (!in_array($values['d_gid'], $indi)) { - fill_y_data(1, (int)($values['age'] / 365.25), 1); + fill_y_data(1, (int) ($values['age'] / 365.25), 1); $n1++; $indi[] = $values['d_gid']; } @@ -426,7 +426,7 @@ function age_at_first_marriage() { $num = $stats->statsMarrAgeQuery(false, 'M', $zstart, $boundary); foreach ($num as $values) { if (!in_array($values['d_gid'], $indi)) { - fill_y_data($boundary, (int)($values['age'] / 365.25), 1); + fill_y_data($boundary, (int) ($values['age'] / 365.25), 1); $n1++; $indi[] = $values['d_gid']; } @@ -434,7 +434,7 @@ function age_at_first_marriage() { $num = $stats->statsMarrAgeQuery(false, 'F', $zstart, $boundary); foreach ($num as $values) { if (!in_array($values['d_gid'], $indi)) { - fill_y_data($boundary, (int)($values['age'] / 365.25), 1); + fill_y_data($boundary, (int) ($values['age'] / 365.25), 1); $n1++; $indi[] = $values['d_gid']; } diff --git a/themes/_custom/theme.php b/themes/_custom/theme.php index d037fb14e8..a95963f3c4 100644 --- a/themes/_custom/theme.php +++ b/themes/_custom/theme.php @@ -86,7 +86,7 @@ class CustomTheme extends WT\Theme\Webtrees { // Start with the default "Lists" menu. $menu = parent::menuLists(); // Remove the "notes" sub-menu. - $submenus = array_filter($menu->getSubmenus(), function (WT_Menu $menu) { + $submenus = array_filter($menu->getSubmenus(), function(WT_Menu $menu) { return $menu->getId() !== 'menu-list-note'; }); // Replace the sub-menus diff --git a/timeline.php b/timeline.php index be1b55ba53..cda5ba7653 100644 --- a/timeline.php +++ b/timeline.php @@ -322,11 +322,11 @@ if (count($controller->people) > 0) { ?> <div id="timeline_chart"> <!-- print the timeline line image --> - <div id="line" style="position:absolute; <?php echo $TEXT_DIRECTION =="ltr"?"left: ".($basexoffset + 22):"right: ".($basexoffset + 22); ?>px; top: <?php echo $baseyoffset; ?>px;"> - <img src="<?php echo Theme::theme()->parameter('image-vline'); ?>" width="3" height="<?php echo ($baseyoffset + (($controller->topyear-$controller->baseyear)*$controller->scale)); ?>" alt=""> + <div id="line" style="position:absolute; <?php echo $TEXT_DIRECTION == "ltr" ? "left: " . ($basexoffset + 22) : "right: " . ($basexoffset + 22); ?>px; top: <?php echo $baseyoffset; ?>px;"> + <img src="<?php echo Theme::theme()->parameter('image-vline'); ?>" width="3" height="<?php echo ($baseyoffset + (($controller->topyear - $controller->baseyear) * $controller->scale)); ?>" alt=""> </div> <!-- print divs for the grid --> - <div id="scale<?php echo $controller->baseyear; ?>" style="position:absolute; <?php echo ($TEXT_DIRECTION =="ltr"?"left: $basexoffset":"right: $basexoffset"); ?>px; top: <?php echo ($baseyoffset-5); ?>px; font-size: 7pt; text-align: <?php echo ($TEXT_DIRECTION =="ltr"?"left":"right"); ?>;"> + <div id="scale<?php echo $controller->baseyear; ?>" style="position:absolute; <?php echo ($TEXT_DIRECTION == "ltr" ? "left: $basexoffset" : "right: $basexoffset"); ?>px; top: <?php echo ($baseyoffset - 5); ?>px; font-size: 7pt; text-align: <?php echo ($TEXT_DIRECTION == "ltr" ? "left" : "right"); ?>;"> <?php echo $controller->baseyear . '—'; ?> </div> <?php @@ -358,7 +358,7 @@ if (count($controller->people) > 0) { $ageyoffset = $baseyoffset + ($controller->bheight * $p); $col = $p % 6; ?> - <div id="agebox<?php echo $p; ?>" style="cursor:move; position:absolute; <?php echo ($TEXT_DIRECTION =="ltr"?"left: ".($basexoffset+20):"right: ".($basexoffset+20)); ?>px; top:<?php echo $ageyoffset; ?>px; height:<?php echo $controller->bheight; ?>px; display:none;" onmousedown="ageCursorMouseDown(this, <?php echo $p; ?>);"> + <div id="agebox<?php echo $p; ?>" style="cursor:move; position:absolute; <?php echo ($TEXT_DIRECTION == "ltr" ? "left: " . ($basexoffset + 20) : "right: " . ($basexoffset + 20)); ?>px; top:<?php echo $ageyoffset; ?>px; height:<?php echo $controller->bheight; ?>px; display:none;" onmousedown="ageCursorMouseDown(this, <?php echo $p; ?>);"> <table cellspacing="0" cellpadding="0"> <tr> <td> @@ -391,9 +391,9 @@ if (count($controller->people) > 0) { <br><br><br><br> <?php } ?> <script> - var bottomy = <?php echo ($baseyoffset+(($controller->topyear-$controller->baseyear)*$controller->scale)); ?>-5; + var bottomy = <?php echo ($baseyoffset + (($controller->topyear - $controller->baseyear) * $controller->scale)); ?>-5; var topy = <?php echo $baseyoffset; ?>; - var baseyear = <?php echo $controller->baseyear-(25/$controller->scale); ?>; + var baseyear = <?php echo $controller->baseyear - (25 / $controller->scale); ?>; var birthyears = []; var birthmonths = []; var birthdays = []; |
