summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--addmedia.php8
-rw-r--r--admin_media_upload.php14
-rw-r--r--admin_site_merge.php2
-rw-r--r--admin_trees_download.php8
-rw-r--r--admin_users.php2
-rw-r--r--app/ColorGenerator.php2
-rw-r--r--app/Controller/AdvancedSearchController.php8
-rw-r--r--app/Controller/BranchesController.php2
-rw-r--r--app/Controller/CompactController.php4
-rw-r--r--app/Controller/DescendancyController.php18
-rw-r--r--app/Controller/HourglassController.php18
-rw-r--r--app/Controller/IndividualController.php8
-rw-r--r--app/Controller/LifespanController.php6
-rw-r--r--app/Controller/PedigreeController.php4
-rw-r--r--app/Controller/SearchController.php38
-rw-r--r--app/Controller/TimelineController.php2
-rw-r--r--app/Database.php4
-rw-r--r--app/Fact.php4
-rw-r--r--app/Functions/FunctionsCharts.php42
-rw-r--r--app/Functions/FunctionsDb.php6
-rw-r--r--app/Functions/FunctionsEdit.php2
-rw-r--r--app/Functions/FunctionsExport.php10
-rw-r--r--app/Functions/FunctionsImport.php20
-rw-r--r--app/Functions/FunctionsPrint.php60
-rw-r--r--app/Functions/FunctionsPrintFacts.php32
-rw-r--r--app/Functions/FunctionsPrintLists.php80
-rw-r--r--app/Functions/FunctionsRtl.php2
-rw-r--r--app/Module/AlbumModule.php10
-rw-r--r--app/Module/CensusAssistantModule.php16
-rw-r--r--app/Module/ClippingsCart/ClippingsCartController.php30
-rw-r--r--app/Module/FamiliesSidebarModule.php2
-rw-r--r--app/Module/FamilyNavigatorModule.php2
-rw-r--r--app/Module/FamilyTreeFavoritesModule.php4
-rw-r--r--app/Module/FamilyTreeNewsModule.php2
-rw-r--r--app/Module/FamilyTreeStatisticsModule.php2
-rw-r--r--app/Module/GoogleMapsModule.php40
-rw-r--r--app/Module/IndividualSidebarModule.php2
-rw-r--r--app/Module/RelativesTabModule.php4
-rw-r--r--app/Module/ReviewChangesModule.php6
-rw-r--r--app/Module/SlideShowModule.php4
-rw-r--r--app/Module/TopGivenNamesModule.php6
-rw-r--r--app/Module/TopPageViewsModule.php6
-rw-r--r--app/Module/WelcomeBlockModule.php4
-rw-r--r--app/Module/YahrzeitModule.php6
-rw-r--r--app/Report/ReportBaseCell.php6
-rw-r--r--app/Report/ReportBaseElement.php2
-rw-r--r--app/Report/ReportBaseFootnote.php12
-rw-r--r--app/Report/ReportBaseHtml.php8
-rw-r--r--app/Report/ReportBaseImage.php4
-rw-r--r--app/Report/ReportBaseLine.php8
-rw-r--r--app/Report/ReportHtml.php42
-rw-r--r--app/Report/ReportHtmlCell.php74
-rw-r--r--app/Report/ReportHtmlFootnote.php26
-rw-r--r--app/Report/ReportHtmlHtml.php10
-rw-r--r--app/Report/ReportHtmlImage.php26
-rw-r--r--app/Report/ReportHtmlLine.php4
-rw-r--r--app/Report/ReportHtmlText.php20
-rw-r--r--app/Report/ReportHtmlTextbox.php28
-rw-r--r--app/Report/ReportParserGenerate.php464
-rw-r--r--app/Report/ReportParserSetup.php4
-rw-r--r--app/Report/ReportPdf.php14
-rw-r--r--app/Report/ReportPdfCell.php14
-rw-r--r--app/Report/ReportPdfFootnote.php20
-rw-r--r--app/Report/ReportPdfHtml.php4
-rw-r--r--app/Report/ReportPdfImage.php14
-rw-r--r--app/Report/ReportPdfLine.php8
-rw-r--r--app/Report/ReportPdfText.php20
-rw-r--r--app/Report/ReportPdfTextbox.php18
-rw-r--r--app/Report/ReportTcpdf.php16
-rw-r--r--app/Stats.php160
-rw-r--r--app/Theme/AbstractTheme.php2
-rw-r--r--calendar.php2
-rw-r--r--edit_changes.php4
-rw-r--r--edit_interface.php10
-rw-r--r--find.php36
-rw-r--r--inverselink.php32
-rw-r--r--login.php12
-rw-r--r--message.php4
-rw-r--r--modules_v3/GEDFact_assistant/_MEDIA/media_0_inverselink.php16
-rw-r--r--pedigree.php4
-rw-r--r--reportengine.php2
-rw-r--r--search.php2
-rw-r--r--search_advanced.php16
-rw-r--r--timeline.php8
84 files changed, 865 insertions, 863 deletions
diff --git a/addmedia.php b/addmedia.php
index adcb12a889..cff2cc8d2f 100644
--- a/addmedia.php
+++ b/addmedia.php
@@ -208,7 +208,7 @@ case 'create': // Save the information from the “showcreateform” action
$controller->pageHeader();
// Build the gedcom record
- $newged = "0 @new@ OBJE";
+ $newged = '0 @new@ OBJE';
if ($tag[0] == 'FILE') {
// The admin has an edit field to change the filename
$text[0] = $folderName . $fileName;
@@ -322,7 +322,7 @@ case 'update': // Save the information from the “editmedia” action
$oldServerFile = $media->getServerFilename('main');
$oldServerThumb = $media->getServerFilename('thumb');
- $newmedia = new Media("xxx", "0 @xxx@ OBJE\n1 FILE " . $newFilename, null, $WT_TREE);
+ $newmedia = new Media('xxx', "0 @xxx@ OBJE\n1 FILE " . $newFilename, null, $WT_TREE);
$newServerFile = $newmedia->getServerFilename('main');
$newServerThumb = $newmedia->getServerFilename('thumb');
@@ -521,14 +521,14 @@ if (!$isExternal) {
}
echo ' value=""> ', I18N::translate('Choose: '), ' </option>';
if (Auth::isAdmin()) {
- echo '<option value="other" disabled>', I18N::translate('Other folder… please type in'), "</option>";
+ echo '<option value="other" disabled>', I18N::translate('Other folder… please type in'), '</option>';
}
foreach ($mediaFolders as $f) {
echo '<option value="', $f, '" ';
if ($folder == $f) {
echo 'selected';
}
- echo '>', $f, "</option>";
+ echo '>', $f, '</option>';
}
echo '</select>';
} else {
diff --git a/admin_media_upload.php b/admin_media_upload.php
index 689f1a3b5a..eb4b725cbf 100644
--- a/admin_media_upload.php
+++ b/admin_media_upload.php
@@ -38,9 +38,9 @@ $controller
$action = Filter::post('action');
-if ($action == "upload") {
+if ($action == 'upload') {
for ($i = 1; $i < 6; $i++) {
- if (!empty($_FILES['mediafile' . $i]["name"]) || !empty($_FILES['thumbnail' . $i]["name"])) {
+ if (!empty($_FILES['mediafile' . $i]['name']) || !empty($_FILES['thumbnail' . $i]['name'])) {
$folder = Filter::post('folder' . $i);
// Validate the media folder
@@ -172,7 +172,7 @@ $mediaFolders = QueryMedia::folderListAll();
// Determine file size limit
$filesize = ini_get('upload_max_filesize');
if (empty($filesize)) {
- $filesize = "2M";
+ $filesize = '2M';
}
?>
@@ -221,7 +221,7 @@ for ($i = 1; $i < 6; $i++) {
echo '<td>';
echo '<input name="filename', $i, '" type="text" size="40">';
if ($i == 1) {
- echo '<p class="small text-muted">', I18N::translate('Do not change to keep original filename.'), "</p>";
+ echo '<p class="small text-muted">', I18N::translate('Do not change to keep original filename.'), '</p>';
echo '<p class="small text-muted">', I18N::translate('The media file you are uploading can be, and probably should be, named differently on the server than it is on your local computer. This is so because often the local filename has meaning to you but is much less meaningful to others visiting this website. Consider also the possibility that you and someone else both try to upload different files called “granny.jpg“.<br><br>In this field, you specify the new name of the file you are uploading. The name you enter here will also be used to name the thumbnail, which can be uploaded separately or generated automatically. You do not need to enter the filename extension (jpg, gif, pdf, doc, etc.)<br><br>Leave this field blank to keep the original name of the file you have uploaded from your local computer.'), '</p>';
}
echo '</td></tr>';
@@ -239,12 +239,12 @@ for ($i = 1; $i < 6; $i++) {
echo '<option';
echo ' value="/"> ', I18N::translate('&lt;select&gt;'), ' </option>';
if (Auth::isAdmin()) {
- echo '<option value="other" disabled>', I18N::translate('Other folder… please type in'), "</option>";
+ echo '<option value="other" disabled>', I18N::translate('Other folder… please type in'), '</option>';
}
foreach ($mediaFolders as $f) {
- echo '<option value="', Filter::escapeHtml($f), '">', Filter::escapeHtml($f), "</option>";
+ echo '<option value="', Filter::escapeHtml($f), '">', Filter::escapeHtml($f), '</option>';
}
- echo "</select>";
+ echo '</select>';
if (Auth::isAdmin()) {
echo '<br><input name="folder', $i, '" type="text" size="40" value="">';
} else {
diff --git a/admin_site_merge.php b/admin_site_merge.php
index 1d06facfd3..ada884af75 100644
--- a/admin_site_merge.php
+++ b/admin_site_merge.php
@@ -149,7 +149,7 @@ if ($rec1 && $rec2 && $rec1->getXref() !== $rec2->getXref() && $rec1::RECORD_TYP
" WHERE gedcom_id=? AND page_parameter=?"
)->execute([$WT_TREE->getTreeId(), $gid2]);
- $gedcom = "0 @" . $rec1->getXref() . "@ " . $rec1::RECORD_TYPE;
+ $gedcom = '0 @' . $rec1->getXref() . '@ ' . $rec1::RECORD_TYPE;
foreach ($facts as $fact_id => $fact) {
$gedcom .= "\n" . $fact->getGedcom();
}
diff --git a/admin_trees_download.php b/admin_trees_download.php
index 04c9b4f9fb..c0cfba0345 100644
--- a/admin_trees_download.php
+++ b/admin_trees_download.php
@@ -59,22 +59,22 @@ if ($action === 'download') {
$zip_file = $download_filename . '.zip';
if (!File::mkdir($temp_dir)) {
- echo "Error : Could not create temporary path!";
+ echo 'Error : Could not create temporary path!';
return;
}
// Create the unzipped GEDCOM on disk, so we can ZIP it.
- $stream = fopen($temp_dir . $download_filename, "w");
+ $stream = fopen($temp_dir . $download_filename, 'w');
FunctionsExport::exportGedcom($WT_TREE, $stream, $exportOptions);
fclose($stream);
// Create a ZIP file containing the GEDCOM file.
- $comment = "Created by " . WT_WEBTREES . " " . WT_VERSION . " on " . date("r") . ".";
+ $comment = 'Created by ' . WT_WEBTREES . ' ' . WT_VERSION . ' on ' . date('r') . '.';
$archive = new PclZip($temp_dir . $zip_file);
$v_list = $archive->add($temp_dir . $download_filename, \PCLZIP_OPT_COMMENT, $comment, \PCLZIP_OPT_REMOVE_PATH, $temp_dir);
if ($v_list == 0) {
- echo "Error : " . $archive->errorInfo(true);
+ echo 'Error : ' . $archive->errorInfo(true);
} else {
header('Content-Type: application/zip');
header('Content-Disposition: attachment; filename="' . $zip_file . '"');
diff --git a/admin_users.php b/admin_users.php
index 604e6e0865..9816425fe3 100644
--- a/admin_users.php
+++ b/admin_users.php
@@ -229,7 +229,7 @@ case 'load_json':
}
// $datum[6] is the sortable registration timestamp
$datum[7] = $datum[6] ? FunctionsDate::formatTimestamp($datum[6] + WT_TIMESTAMP_OFFSET) : '';
- if (date("U") - $datum[6] > 604800 && !$datum[10]) {
+ if (date('U') - $datum[6] > 604800 && !$datum[10]) {
$datum[7] = '<span class="red">' . $datum[7] . '</span>';
}
// $datum[8] is the sortable last-login timestamp
diff --git a/app/ColorGenerator.php b/app/ColorGenerator.php
index 3ad1e965c3..5b9a46c402 100644
--- a/app/ColorGenerator.php
+++ b/app/ColorGenerator.php
@@ -85,7 +85,7 @@ class ColorGenerator {
}
$this->lightness = $lightness;
- return sprintf("hsla(%s, %s%%, %s%%, %s)",
+ return sprintf('hsla(%s, %s%%, %s%%, %s)',
$this->hue,
$this->saturation,
$this->lightness,
diff --git a/app/Controller/AdvancedSearchController.php b/app/Controller/AdvancedSearchController.php
index 3d67f43ab0..17f5195be4 100644
--- a/app/Controller/AdvancedSearchController.php
+++ b/app/Controller/AdvancedSearchController.php
@@ -45,9 +45,9 @@ class AdvancedSearchController extends SearchController {
$this->setPageTitle(I18N::translate('Advanced search'));
if (empty($_REQUEST['action'])) {
- $this->action = "advanced";
+ $this->action = 'advanced';
}
- if ($this->action == "advanced") {
+ if ($this->action == 'advanced') {
if (isset($_REQUEST['fields'])) {
$this->fields = $_REQUEST['fields'];
ksort($this->fields);
@@ -235,7 +235,7 @@ class AdvancedSearchController extends SearchController {
$newplus = [];
$rels = [];
foreach ($this->fields as $j => $field) {
- if (strpos($this->fields[$j], "FAMC:HUSB:NAME") === 0 || strpos($this->fields[$j], "FAMC:WIFE:NAME") === 0) {
+ if (strpos($this->fields[$j], 'FAMC:HUSB:NAME') === 0 || strpos($this->fields[$j], 'FAMC:WIFE:NAME') === 0) {
$rels[$this->fields[$j]] = $this->values[$j];
continue;
}
@@ -373,7 +373,7 @@ class AdvancedSearchController extends SearchController {
if ($value === '') {
continue;
}
- $parts = preg_split("/:/", $field . '::::');
+ $parts = preg_split('/:/', $field . '::::');
if ($parts[0] == 'NAME') {
// NAME:*
switch ($parts[1]) {
diff --git a/app/Controller/BranchesController.php b/app/Controller/BranchesController.php
index 3b7744ad57..73a82a3e49 100644
--- a/app/Controller/BranchesController.php
+++ b/app/Controller/BranchesController.php
@@ -189,7 +189,7 @@ class BranchesController extends PageController {
// A person has many names. Select the one that matches the searched surname
$person_name = '';
foreach ($individual->getAllNames() as $name) {
- list($surn1) = explode(",", $name['sort']);
+ list($surn1) = explode(',', $name['sort']);
if (// one name is a substring of the other
stripos($surn1, $this->surname) !== false ||
stripos($this->surname, $surn1) !== false ||
diff --git a/app/Controller/CompactController.php b/app/Controller/CompactController.php
index 602cf5d306..6fd87aa3f9 100644
--- a/app/Controller/CompactController.php
+++ b/app/Controller/CompactController.php
@@ -125,9 +125,9 @@ class CompactController extends ChartController {
$title = I18N::translate('Compact tree of %s', $indi->getFullName());
$text = '<a class="icon-' . $arrow_dir . 'arrow" title="' . strip_tags($title) . '" href="?rootid=' . $indi->getXref();
if ($this->show_thumbs) {
- $text .= "&amp;show_thumbs=" . $this->show_thumbs;
+ $text .= '&amp;show_thumbs=' . $this->show_thumbs;
}
- $text .= "\"></a>";
+ $text .= '"></a>';
} else {
$text = '<i class="icon-' . $arrow_dir . 'arrow"></i>';
}
diff --git a/app/Controller/DescendancyController.php b/app/Controller/DescendancyController.php
index ff20b049b2..42c5ad79e0 100644
--- a/app/Controller/DescendancyController.php
+++ b/app/Controller/DescendancyController.php
@@ -95,10 +95,10 @@ class DescendancyController extends ChartController {
* @param int $depth the descendancy depth to show
*/
public function printChildDescendancy(Individual $person, $depth) {
- echo "<li>";
- echo "<table><tr><td>";
+ echo '<li>';
+ echo '<table><tr><td>';
if ($depth == $this->generations) {
- echo '<img src="' . Theme::theme()->parameter('image-spacer') . '" height="3" width="', Theme::theme()->parameter('chart-descendancy-indent'), "\" alt=\"\"></td><td>";
+ echo '<img src="' . Theme::theme()->parameter('image-spacer') . '" height="3" width="', Theme::theme()->parameter('chart-descendancy-indent'), '" alt=""></td><td>';
} else {
echo '<img src="' . Theme::theme()->parameter('image-spacer') . '" height="3" width="3">';
echo '<img src="' . Theme::theme()->parameter('image-hline') . '" height="3" width="', Theme::theme()->parameter('chart-descendancy-indent') - 3, '"></td><td>';
@@ -137,15 +137,15 @@ class DescendancyController extends ChartController {
if ($isf === 'U') {
$isf = 'NN';
}
- echo "<span class=\"person_box" . $isf . "\">&nbsp;" . $this->dabo_num[$i] . "&nbsp;</span>";
+ echo '<span class="person_box' . $isf . '">&nbsp;' . $this->dabo_num[$i] . '&nbsp;</span>';
if ($i < $level) {
echo '.';
}
}
- echo "</span>";
- echo "</td></tr>";
- echo "</table>";
- echo "</li>";
+ echo '</span>';
+ echo '</td></tr>';
+ echo '</table>';
+ echo '</li>';
// loop for each spouse
foreach ($person->getSpouseFamilies() as $family) {
@@ -166,7 +166,7 @@ class DescendancyController extends ChartController {
echo '<li>';
echo '<img src="', Theme::theme()->parameter('image-spacer'), '" height="2" width="', Theme::theme()->parameter('chart-descendancy-indent') + 4, '">';
echo '<span class="details1">';
- echo "<a href=\"#\" onclick=\"expand_layer('" . $uid . "'); return false;\" class=\"top\"><i id=\"" . $uid . "_img\" class=\"icon-minus\" title=\"" . I18N::translate('View this family') . "\"></i></a>";
+ echo "<a href=\"#\" onclick=\"expand_layer('" . $uid . "'); return false;\" class=\"top\"><i id=\"" . $uid . '_img" class="icon-minus" title="' . I18N::translate('View this family') . '"></i></a>';
if ($family->canShow()) {
foreach ($family->getFacts(WT_EVENTS_MARR) as $fact) {
echo ' <a href="', $family->getHtmlUrl(), '" class="details1">', $fact->summary(), '</a>';
diff --git a/app/Controller/HourglassController.php b/app/Controller/HourglassController.php
index fc9544e741..eae4b02bcf 100644
--- a/app/Controller/HourglassController.php
+++ b/app/Controller/HourglassController.php
@@ -125,10 +125,10 @@ class HourglassController extends ChartController {
echo '<td>';
//-- print the father box
FunctionsPrint::printPedigreePerson($family->getHusband(), $this->showFull());
- echo "</td>";
+ echo '</td>';
if ($family->getHusband()) {
$ARID = $family->getHusband()->getXref();
- echo "<td id=\"td_" . $ARID . "\">";
+ echo '<td id="td_' . $ARID . '">';
//-- print an Ajax arrow on the last generation of the adult male
if ($count == $this->generations - 1 && $family->getHusband()->getChildFamilies()) {
@@ -136,7 +136,7 @@ class HourglassController extends ChartController {
}
//-- recursively get the father’s family
$this->printPersonPedigree($family->getHusband(), $count + 1);
- echo "</td>";
+ echo '</td>';
} else {
echo '<td>';
if ($count < $genoffset - 1) {
@@ -297,14 +297,14 @@ class HourglassController extends ChartController {
echo "</td></tr><tr><td style='text-align:$otablealign'>";
FunctionsPrint::printPedigreePerson($family->getSpouse($person), $this->showFull());
$numkids++;
- echo "</td><td></td>";
+ echo '</td><td></td>';
}
//-- add offset divs to make things line up better
if ($count == $this->dgenerations) {
- echo "<tr><td colspan '2'><div style='height:", ($this->bhalfheight / 2), "px; width:", $this->getBoxDimensions()->width, "px;'><br></div>";
+ echo "<tr><td colspan '2'><div style='height:", ($this->bhalfheight / 2), 'px; width:', $this->getBoxDimensions()->width, "px;'><br></div>";
}
}
- echo "</td></tr></table>";
+ echo '</td></tr></table>';
// For the root person, print a down arrow that allows changing the root of tree
if ($showNav && $count == 1) {
@@ -324,7 +324,7 @@ class HourglassController extends ChartController {
echo '<table class="person_box"><tr><td>';
foreach ($famids as $family) {
- echo "<span class='name1'>" . I18N::translate('Family') . "</span>";
+ echo "<span class='name1'>" . I18N::translate('Family') . '</span>';
$spouse = $family->getSpouse($person);
if ($spouse) {
printf(self::SWITCH_LINK, $spouse->getXref(), $this->show_spouse, $this->showFull(), $this->generations, $spouse->getFullName());
@@ -337,7 +337,7 @@ class HourglassController extends ChartController {
//-- print the siblings
foreach ($cfamids as $family) {
if ($family->getHusband() || $family->getWife()) {
- echo "<span class='name1'>" . I18N::translate('Parents') . "</span>";
+ echo "<span class='name1'>" . I18N::translate('Parents') . '</span>';
$husb = $family->getHusband();
if ($husb) {
printf(self::SWITCH_LINK, $husb->getXref(), $this->show_spouse, $this->showFull(), $this->generations, $husb->getFullName());
@@ -356,7 +356,7 @@ class HourglassController extends ChartController {
if ($num) {
echo "<span class='name1'>";
echo $num > 1 ? I18N::translate('Siblings') : I18N::translate('Sibling');
- echo "</span>";
+ echo '</span>';
foreach ($siblings as $child) {
printf(self::SWITCH_LINK, $child->getXref(), $this->show_spouse, $this->showFull(), $this->generations, $child->getFullName());
}
diff --git a/app/Controller/IndividualController.php b/app/Controller/IndividualController.php
index 251bd51f93..3a64978884 100644
--- a/app/Controller/IndividualController.php
+++ b/app/Controller/IndividualController.php
@@ -112,8 +112,8 @@ class IndividualController extends GedcomRecordController {
exit;
}
- header("Content-Type: text/html; charset=UTF-8"); // AJAX calls do not have the meta tag headers and need this set
- header("X-Robots-Tag: noindex,follow"); // AJAX pages should not show up in search results, any links can be followed though
+ header('Content-Type: text/html; charset=UTF-8'); // AJAX calls do not have the meta tag headers and need this set
+ header('X-Robots-Tag: noindex,follow'); // AJAX pages should not show up in search results, any links can be followed though
echo $mod->getTabContent();
@@ -164,8 +164,8 @@ class IndividualController extends GedcomRecordController {
}
}
if ($this->record->canEdit() && !$event->isPendingDeletion()) {
- echo "<div class=\"deletelink noprint\"><a class=\"deleteicon\" href=\"#\" onclick=\"return delete_fact('" . I18N::translate('Are you sure you want to delete this fact?') . "', '" . $this->record->getXref() . "', '" . $event->getFactId() . "');\" title=\"" . I18N::translate('Delete this name') . "\"><span class=\"link_text\">" . I18N::translate('Delete this name') . "</span></a></div>";
- echo "<div class=\"editlink noprint\"><a href=\"#\" class=\"editicon\" onclick=\"edit_name('" . $this->record->getXref() . "', '" . $event->getFactId() . "'); return false;\" title=\"" . I18N::translate('Edit the name') . "\"><span class=\"link_text\">" . I18N::translate('Edit the name') . "</span></a></div>";
+ echo "<div class=\"deletelink noprint\"><a class=\"deleteicon\" href=\"#\" onclick=\"return delete_fact('" . I18N::translate('Are you sure you want to delete this fact?') . "', '" . $this->record->getXref() . "', '" . $event->getFactId() . "');\" title=\"" . I18N::translate('Delete this name') . '"><span class="link_text">' . I18N::translate('Delete this name') . '</span></a></div>';
+ echo "<div class=\"editlink noprint\"><a href=\"#\" class=\"editicon\" onclick=\"edit_name('" . $this->record->getXref() . "', '" . $event->getFactId() . "'); return false;\" title=\"" . I18N::translate('Edit the name') . '"><span class="link_text">' . I18N::translate('Edit the name') . '</span></a></div>';
}
echo '</dd>';
echo '</dl>';
diff --git a/app/Controller/LifespanController.php b/app/Controller/LifespanController.php
index aea01158ce..a847153f36 100644
--- a/app/Controller/LifespanController.php
+++ b/app/Controller/LifespanController.php
@@ -397,7 +397,7 @@ class LifespanController extends PageController {
foreach ($acceptedFacts as $fact) {
$tag = $fact->getTag();
//-- if the fact is a generic EVENt then get the qualifying TYPE
- if ($tag == "EVEN") {
+ if ($tag == 'EVEN') {
$tag = $fact->getAttribute('TYPE');
}
$eventList[] = [
@@ -410,7 +410,7 @@ class LifespanController extends PageController {
$lifespan = ' ' . $person->getLifeSpan(); // put the space here so its included in the length calcs
$sex = $person->getSex();
$popupClass = strtr($sex, ['M' => '', 'U' => 'NN']);
- $color = $sex === 'U' ? '' : sprintf("background-color: %s", $this->colors[$sex]->getNextColor());
+ $color = $sex === 'U' ? '' : sprintf('background-color: %s', $this->colors[$sex]->getNextColor());
// following lines are a nasty method of approximating
// the width of a string in pixels from the character count
@@ -448,7 +448,7 @@ class LifespanController extends PageController {
// Add events to popup
foreach ($eventList as $event) {
- printf("<div>%s: %s %s</div>", $event['label'], $event['date'], $event['place']);
+ printf('<div>%s: %s %s</div>', $event['label'], $event['date'], $event['place']);
}
echo
'</div>' . // class="popup"
diff --git a/app/Controller/PedigreeController.php b/app/Controller/PedigreeController.php
index 606609e35d..b5717c4a66 100644
--- a/app/Controller/PedigreeController.php
+++ b/app/Controller/PedigreeController.php
@@ -218,8 +218,8 @@ class PedigreeController extends ChartController {
}
break;
}
- $this->nodes[$i]["x"] = (int) $xoffset;
- $this->nodes[$i]["y"] = (int) $yoffset;
+ $this->nodes[$i]['x'] = (int) $xoffset;
+ $this->nodes[$i]['y'] = (int) $yoffset;
}
// find the minimum x & y offsets and deduct that number from
diff --git a/app/Controller/SearchController.php b/app/Controller/SearchController.php
index 64b1a0ed70..0f25c8b532 100644
--- a/app/Controller/SearchController.php
+++ b/app/Controller/SearchController.php
@@ -309,7 +309,7 @@ class SearchController extends PageController {
return;
}
- Log::addEditLog("Search And Replace old:" . $this->query . " new:" . $this->replace);
+ Log::addEditLog('Search And Replace old:' . $this->query . ' new:' . $this->replace);
$query = preg_quote($this->query, '/');
@@ -321,18 +321,18 @@ class SearchController extends PageController {
$old_record = $record->getGedcom();
$new_record = $old_record;
if ($this->replaceAll) {
- $new_record = preg_replace("/" . $query . "/i", $this->replace, $new_record);
+ $new_record = preg_replace('/' . $query . '/i', $this->replace, $new_record);
} else {
if ($this->replaceNames) {
foreach ($name_tags as $tag) {
- $new_record = preg_replace("/(\d) " . $tag . " (.*)" . $query . "(.*)/i", "$1 " . $tag . " $2" . $this->replace . "$3", $new_record);
+ $new_record = preg_replace("/(\d) " . $tag . ' (.*)' . $query . '(.*)/i', '$1 ' . $tag . ' $2' . $this->replace . '$3', $new_record);
}
}
if ($this->replacePlaces) {
if ($this->replacePlacesWord) {
- $new_record = preg_replace('/(\d) PLAC (.*)([,\W\s])' . $query . '([,\W\s])/i', "$1 PLAC $2$3" . $this->replace . "$4", $new_record);
+ $new_record = preg_replace('/(\d) PLAC (.*)([,\W\s])' . $query . '([,\W\s])/i', '$1 PLAC $2$3' . $this->replace . '$4', $new_record);
} else {
- $new_record = preg_replace("/(\d) PLAC (.*)" . $query . "(.*)/i", "$1 PLAC $2" . $this->replace . "$3", $new_record);
+ $new_record = preg_replace("/(\d) PLAC (.*)" . $query . '(.*)/i', '$1 PLAC $2' . $this->replace . '$3', $new_record);
}
}
}
@@ -355,13 +355,13 @@ class SearchController extends PageController {
$new_record = $old_record;
if ($this->replaceAll) {
- $new_record = preg_replace("/" . $query . "/i", $this->replace, $new_record);
+ $new_record = preg_replace('/' . $query . '/i', $this->replace, $new_record);
} else {
if ($this->replacePlaces) {
if ($this->replacePlacesWord) {
- $new_record = preg_replace('/(\d) PLAC (.*)([,\W\s])' . $query . '([,\W\s])/i', "$1 PLAC $2$3" . $this->replace . "$4", $new_record);
+ $new_record = preg_replace('/(\d) PLAC (.*)([,\W\s])' . $query . '([,\W\s])/i', '$1 PLAC $2$3' . $this->replace . '$4', $new_record);
} else {
- $new_record = preg_replace("/(\d) PLAC (.*)" . $query . "(.*)/i", "$1 PLAC $2" . $this->replace . "$3", $new_record);
+ $new_record = preg_replace("/(\d) PLAC (.*)" . $query . '(.*)/i', '$1 PLAC $2' . $this->replace . '$3', $new_record);
}
}
}
@@ -384,17 +384,17 @@ class SearchController extends PageController {
$new_record = $old_record;
if ($this->replaceAll) {
- $new_record = preg_replace("/" . $query . "/i", $this->replace, $new_record);
+ $new_record = preg_replace('/' . $query . '/i', $this->replace, $new_record);
} else {
if ($this->replaceNames) {
- $new_record = preg_replace("/(\d) TITL (.*)" . $query . "(.*)/i", "$1 TITL $2" . $this->replace . "$3", $new_record);
- $new_record = preg_replace("/(\d) ABBR (.*)" . $query . "(.*)/i", "$1 ABBR $2" . $this->replace . "$3", $new_record);
+ $new_record = preg_replace("/(\d) TITL (.*)" . $query . '(.*)/i', '$1 TITL $2' . $this->replace . '$3', $new_record);
+ $new_record = preg_replace("/(\d) ABBR (.*)" . $query . '(.*)/i', '$1 ABBR $2' . $this->replace . '$3', $new_record);
}
if ($this->replacePlaces) {
if ($this->replacePlacesWord) {
- $new_record = preg_replace('/(\d) PLAC (.*)([,\W\s])' . $query . '([,\W\s])/i', "$1 PLAC $2$3" . $this->replace . "$4", $new_record);
+ $new_record = preg_replace('/(\d) PLAC (.*)([,\W\s])' . $query . '([,\W\s])/i', '$1 PLAC $2$3' . $this->replace . '$4', $new_record);
} else {
- $new_record = preg_replace("/(\d) PLAC (.*)" . $query . "(.*)/i", "$1 PLAC $2" . $this->replace . "$3", $new_record);
+ $new_record = preg_replace("/(\d) PLAC (.*)" . $query . '(.*)/i', '$1 PLAC $2' . $this->replace . '$3', $new_record);
}
}
}
@@ -417,7 +417,7 @@ class SearchController extends PageController {
$new_record = $old_record;
if ($this->replaceAll) {
- $new_record = preg_replace("/" . $query . "/i", $this->replace, $new_record);
+ $new_record = preg_replace('/' . $query . '/i', $this->replace, $new_record);
}
//-- if the record changed replace the record otherwise remove it from the search results
if ($new_record != $old_record) {
@@ -453,16 +453,16 @@ class SearchController extends PageController {
if (((!empty($this->lastname)) || (!empty($this->firstname)) || (!empty($this->place))) && $this->search_trees) {
$logstring = "Type: Soundex\n";
if (!empty($this->lastname)) {
- $logstring .= "Last name: " . $this->lastname . "\n";
+ $logstring .= 'Last name: ' . $this->lastname . "\n";
}
if (!empty($this->firstname)) {
- $logstring .= "First name: " . $this->firstname . "\n";
+ $logstring .= 'First name: ' . $this->firstname . "\n";
}
if (!empty($this->place)) {
- $logstring .= "Place: " . $this->place . "\n";
+ $logstring .= 'Place: ' . $this->place . "\n";
}
if (!empty($this->year)) {
- $logstring .= "Year: " . $this->year . "\n";
+ $logstring .= 'Year: ' . $this->year . "\n";
}
Log::addSearchLog($logstring, $this->search_trees);
@@ -494,7 +494,7 @@ class SearchController extends PageController {
}
//-- if only 1 item is returned, automatically forward to that item
- if (count($this->myindilist) == 1 && $this->action != "replace") {
+ if (count($this->myindilist) == 1 && $this->action != 'replace') {
$indi = reset($this->myindilist);
header('Location: ' . WT_BASE_URL . $indi->getRawUrl());
exit;
diff --git a/app/Controller/TimelineController.php b/app/Controller/TimelineController.php
index 49cdd4a518..63ae92099e 100644
--- a/app/Controller/TimelineController.php
+++ b/app/Controller/TimelineController.php
@@ -183,7 +183,7 @@ class TimelineController extends PageController {
$xoffset += abs($tyoffset);
$placements[$place] = $yoffset;
- echo "<div id=\"fact$factcount\" style=\"position:absolute; " . (I18N::direction() === 'ltr' ? 'left: ' . ($xoffset) : 'right: ' . ($xoffset)) . 'px; top:' . ($yoffset) . "px; font-size: 8pt; height: " . ($this->bheight) . "px;\" onmousedown=\"factMouseDown(this, '" . $factcount . "', " . ($yoffset - $tyoffset) . ");\">";
+ echo "<div id=\"fact$factcount\" style=\"position:absolute; " . (I18N::direction() === 'ltr' ? 'left: ' . ($xoffset) : 'right: ' . ($xoffset)) . 'px; top:' . ($yoffset) . 'px; font-size: 8pt; height: ' . ($this->bheight) . "px;\" onmousedown=\"factMouseDown(this, '" . $factcount . "', " . ($yoffset - $tyoffset) . ');">';
echo '<table cellspacing="0" cellpadding="0" border="0" style="cursor: hand;"><tr><td>';
echo '<img src="' . Theme::theme()->parameter('image-hline') . '" name="boxline' . $factcount . '" id="boxline' . $factcount . '" height="3" width="10" style="padding-';
if (I18N::direction() === 'ltr') {
diff --git a/app/Database.php b/app/Database.php
index dff29afba7..b36bbc2f06 100644
--- a/app/Database.php
+++ b/app/Database.php
@@ -148,7 +148,7 @@ class Database {
unset($trace[$n]);
}
}
- $stack = '<abbr title="' . Filter::escapeHtml(implode(" / ", $trace)) . '">' . (count(self::$log) + 1) . '</abbr>';
+ $stack = '<abbr title="' . Filter::escapeHtml(implode(' / ', $trace)) . '">' . (count(self::$log) + 1) . '</abbr>';
// Bind variables
foreach ($bind_variables as $key => $value) {
if (is_null($value)) {
@@ -257,7 +257,7 @@ class Database {
*/
public static function prepare($sql) {
if (!self::$pdo instanceof PDO) {
- throw new \Exception("No Connection Established");
+ throw new \Exception('No Connection Established');
}
$sql = str_replace('##', WT_TBLPREFIX, $sql);
diff --git a/app/Fact.php b/app/Fact.php
index 4ef04ad3cd..e6991fd291 100644
--- a/app/Fact.php
+++ b/app/Fact.php
@@ -533,7 +533,7 @@ class Fact {
if (preg_match('/^(_(BIRT|MARR|DEAT|BURI)_)/', $atag, $match)) {
$atag = $match[1];
} else {
- $atag = "_????_";
+ $atag = '_????_';
}
}
@@ -541,7 +541,7 @@ class Fact {
if (preg_match('/^(_(BIRT|MARR|DEAT|BURI)_)/', $btag, $match)) {
$btag = $match[1];
} else {
- $btag = "_????_";
+ $btag = '_????_';
}
}
diff --git a/app/Functions/FunctionsCharts.php b/app/Functions/FunctionsCharts.php
index eecfc1459a..b37c8a0c48 100644
--- a/app/Functions/FunctionsCharts.php
+++ b/app/Functions/FunctionsCharts.php
@@ -32,25 +32,25 @@ class FunctionsCharts {
* @param string $pid optional pid
* @param string $arrowDirection direction of link arrow
*/
- public static function printSosaNumber($sosa, $pid = "", $arrowDirection = "up") {
- if (substr($sosa, -1, 1) == ".") {
+ public static function printSosaNumber($sosa, $pid = '', $arrowDirection = 'up') {
+ if (substr($sosa, -1, 1) == '.') {
$personLabel = substr($sosa, 0, -1);
} else {
$personLabel = $sosa;
}
- if ($arrowDirection == "blank") {
- $visibility = "hidden";
+ if ($arrowDirection == 'blank') {
+ $visibility = 'hidden';
} else {
- $visibility = "normal";
+ $visibility = 'normal';
}
- echo "<td class=\"subheaders center\" style=\"vertical-align: middle; text-indent: 0px; margin-top: 0px; white-space: nowrap; visibility: ", $visibility, ";\">";
+ echo '<td class="subheaders center" style="vertical-align: middle; text-indent: 0px; margin-top: 0px; white-space: nowrap; visibility: ', $visibility, ';">';
echo $personLabel;
- if ($sosa != "1" && $pid != "") {
- if ($arrowDirection == "left") {
+ if ($sosa != '1' && $pid != '') {
+ if ($arrowDirection == 'left') {
$dir = 0;
- } elseif ($arrowDirection == "right") {
+ } elseif ($arrowDirection == 'right') {
$dir = 1;
- } elseif ($arrowDirection == "down") {
+ } elseif ($arrowDirection == 'down') {
$dir = 3;
} else {
$dir = 2; // either 'blank' or 'up'
@@ -307,7 +307,7 @@ class FunctionsCharts {
if ($sosa == 0 && Auth::isEditor($family->getTree())) {
echo '<br>';
- echo "<a href=\"#\" onclick=\"return add_child_to_family('", $family->getXref(), "', 'U');\">" . I18N::translate('Add a child to this family') . "</a>";
+ echo "<a href=\"#\" onclick=\"return add_child_to_family('", $family->getXref(), "', 'U');\">" . I18N::translate('Add a child to this family') . '</a>';
echo ' <a class="icon-sex_m_15x15" href="#" onclick="return add_child_to_family(\'', $family->getXref(), '\', \'M\');" title="', I18N::translate('son'), '"></a>';
echo ' <a class="icon-sex_f_15x15" href="#" onclick="return add_child_to_family(\'', $family->getXref(), '\', \'F\');" title="', I18N::translate('daughter'), '"></a>';
echo '<br><br>';
@@ -326,9 +326,9 @@ class FunctionsCharts {
if ($child->getXref() == $childid) {
self::printSosaNumber($sosa, $childid);
} elseif (empty($label)) {
- self::printSosaNumber("");
+ self::printSosaNumber('');
} else {
- self::printSosaNumber($label . ($nchi++) . ".");
+ self::printSosaNumber($label . ($nchi++) . '.');
}
}
if ($child->isPendingAddtion()) {
@@ -384,24 +384,24 @@ class FunctionsCharts {
echo '–', $div->getDate()->minimumDate()->format('%Y');
}
}
- echo "<br><img width=\"100%\" class=\"line5\" height=\"3\" src=\"" . Theme::theme()->parameter('image-hline') . "\" alt=\"\">";
- echo "</td>";
+ echo '<br><img width="100%" class="line5" height="3" src="' . Theme::theme()->parameter('image-hline') . '" alt="">';
+ echo '</td>';
// spouse information
- echo "<td style=\"vertical-align: center;";
+ echo '<td style="vertical-align: center;';
if (!empty($divrec)) {
- echo " filter:alpha(opacity=40);opacity:0.4;\">";
+ echo ' filter:alpha(opacity=40);opacity:0.4;">';
} else {
- echo "\">";
+ echo '">';
}
FunctionsPrint::printPedigreePerson($spouse, $show_full);
- echo "</td>";
+ echo '</td>';
// cousins
if ($show_cousins) {
self::printCousins($famid_child, $show_full);
}
}
}
- echo "</tr>";
+ echo '</tr>';
}
} elseif ($sosa < 1) {
// message 'no children' except for sosa
@@ -409,7 +409,7 @@ class FunctionsCharts {
echo '<tr><td><i class="icon-childless"></i> ' . I18N::translate('This family remained childless') . '</td></tr>';
}
}
- echo "</table><br>";
+ echo '</table><br>';
}
/**
diff --git a/app/Functions/FunctionsDb.php b/app/Functions/FunctionsDb.php
index 4759ff3042..c868093d89 100644
--- a/app/Functions/FunctionsDb.php
+++ b/app/Functions/FunctionsDb.php
@@ -374,8 +374,8 @@ class FunctionsDb {
$sql .= " AND f_file IN (";
foreach ($trees as $n => $tree) {
- $sql .= $n ? ", " : "";
- $sql .= ":tree_id_" . $n;
+ $sql .= $n ? ', ' : '';
+ $sql .= ':tree_id_' . $n;
$args['tree_id_' . $n] = $tree->getTreeId();
}
$sql .= ")";
@@ -892,7 +892,7 @@ class FunctionsDb {
*/
public static function getCalendarEvents($jd1, $jd2, $facts, Tree $tree) {
// If no facts specified, get all except these
- $skipfacts = "CHAN,BAPL,SLGC,SLGS,ENDL,CENS,RESI,NOTE,ADDR,OBJE,SOUR,PAGE,DATA,TEXT";
+ $skipfacts = 'CHAN,BAPL,SLGC,SLGS,ENDL,CENS,RESI,NOTE,ADDR,OBJE,SOUR,PAGE,DATA,TEXT';
$found_facts = [];
diff --git a/app/Functions/FunctionsEdit.php b/app/Functions/FunctionsEdit.php
index ec655a7010..f0445445d8 100644
--- a/app/Functions/FunctionsEdit.php
+++ b/app/Functions/FunctionsEdit.php
@@ -1634,7 +1634,7 @@ class FunctionsEdit {
$text .= $fields[$j];
}
$text = rtrim($text);
- while (($i + 1 < count($gedlines)) && (preg_match("/" . ($level + 1) . ' CONT ?(.*)/', $gedlines[$i + 1], $cmatch) > 0)) {
+ while (($i + 1 < count($gedlines)) && (preg_match('/' . ($level + 1) . ' CONT ?(.*)/', $gedlines[$i + 1], $cmatch) > 0)) {
$text .= "\n" . $cmatch[1];
$i++;
}
diff --git a/app/Functions/FunctionsExport.php b/app/Functions/FunctionsExport.php
index 9db86256aa..0fe86c1f31 100644
--- a/app/Functions/FunctionsExport.php
+++ b/app/Functions/FunctionsExport.php
@@ -94,17 +94,17 @@ class FunctionsExport {
*/
public static function gedcomHeader(Tree $tree) {
// Default values for a new header
- $HEAD = "0 HEAD";
+ $HEAD = '0 HEAD';
$SOUR = "\n1 SOUR " . WT_WEBTREES . "\n2 NAME " . WT_WEBTREES . "\n2 VERS " . WT_VERSION;
$DEST = "\n1 DEST DISKETTE";
- $DATE = "\n1 DATE " . strtoupper(date("d M Y")) . "\n2 TIME " . date("H:i:s");
+ $DATE = "\n1 DATE " . strtoupper(date('d M Y')) . "\n2 TIME " . date('H:i:s');
$GEDC = "\n1 GEDC\n2 VERS 5.5.1\n2 FORM Lineage-Linked";
$CHAR = "\n1 CHAR UTF-8";
$FILE = "\n1 FILE " . $tree->getName();
- $LANG = "";
+ $LANG = '';
$PLAC = "\n1 PLAC\n2 FORM City, County, State/Province, Country";
- $COPR = "";
- $SUBN = "";
+ $COPR = '';
+ $SUBN = '';
$SUBM = "\n1 SUBM @SUBM@\n0 @SUBM@ SUBM\n1 NAME " . Auth::user()->getUserName(); // The SUBM record is mandatory
// Preserve some values from the original header
diff --git a/app/Functions/FunctionsImport.php b/app/Functions/FunctionsImport.php
index 83fcb875b9..5584d577db 100644
--- a/app/Functions/FunctionsImport.php
+++ b/app/Functions/FunctionsImport.php
@@ -413,8 +413,8 @@ class FunctionsImport {
$data =
$match[1] . "\n" .
($level + 1) . " MAP\n" .
- ($level + 2) . " LATI " . ($match[5] . (round($match[2] + ($match[3] / 60) + ($match[4] / 3600), 4))) . "\n" .
- ($level + 2) . " LONG " . ($match[9] . (round($match[6] + ($match[7] / 60) + ($match[8] / 3600), 4)));
+ ($level + 2) . ' LATI ' . ($match[5] . (round($match[2] + ($match[3] / 60) + ($match[4] / 3600), 4))) . "\n" .
+ ($level + 2) . ' LONG ' . ($match[9] . (round($match[6] + ($match[7] / 60) + ($match[8] / 3600), 4)));
}
break;
case 'POSTAL_CODE':
@@ -556,13 +556,13 @@ class FunctionsImport {
while (strpos($data, ' ')) {
$data = str_replace(' ', ' ', $data);
}
- $newrec .= ($newrec ? "\n" : '') . $level . ' ' . ($level == '0' && $xref ? $xref . ' ' : '') . $tag . ($data === '' && $tag != "NOTE" ? '' : ' ' . $data);
+ $newrec .= ($newrec ? "\n" : '') . $level . ' ' . ($level == '0' && $xref ? $xref . ' ' : '') . $tag . ($data === '' && $tag != 'NOTE' ? '' : ' ' . $data);
break;
case 'NOTE':
case 'TEXT':
case 'DATA':
case 'CONT':
- $newrec .= ($newrec ? "\n" : '') . $level . ' ' . ($level == '0' && $xref ? $xref . ' ' : '') . $tag . ($data === '' && $tag != "NOTE" ? '' : ' ' . $data);
+ $newrec .= ($newrec ? "\n" : '') . $level . ' ' . ($level == '0' && $xref ? $xref . ' ' : '') . $tag . ($data === '' && $tag != 'NOTE' ? '' : ' ' . $data);
break;
case 'FILE':
// Strip off the user-defined path prefix
@@ -571,9 +571,9 @@ class FunctionsImport {
$data = substr($data, strlen($GEDCOM_MEDIA_PATH));
}
// convert backslashes in filenames to forward slashes
- $data = preg_replace("/\\\/", "/", $data);
+ $data = preg_replace("/\\\/", '/', $data);
- $newrec .= ($newrec ? "\n" : '') . $level . ' ' . ($level == '0' && $xref ? $xref . ' ' : '') . $tag . ($data === '' && $tag != "NOTE" ? '' : ' ' . $data);
+ $newrec .= ($newrec ? "\n" : '') . $level . ' ' . ($level == '0' && $xref ? $xref . ' ' : '') . $tag . ($data === '' && $tag != 'NOTE' ? '' : ' ' . $data);
break;
case 'CONC':
// Merge CONC lines, to simplify access later on.
@@ -630,7 +630,7 @@ class FunctionsImport {
->execute([$xref, $tree_id])
->fetchOneColumn();
foreach ($old_linked_media as $media_id) {
- $gedrec .= "\n1 OBJE @" . $media_id . "@";
+ $gedrec .= "\n1 OBJE @" . $media_id . '@';
}
}
@@ -771,7 +771,7 @@ class FunctionsImport {
$personplace = [];
// import all place locations, but not control info such as
// 0 HEAD/1 PLAC or 0 _EVDEF/1 PLAC
- $pt = preg_match_all("/^[2-9] PLAC (.+)/m", $gedrec, $match, PREG_SET_ORDER);
+ $pt = preg_match_all('/^[2-9] PLAC (.+)/m', $gedrec, $match, PREG_SET_ORDER);
for ($i = 0; $i < $pt; $i++) {
$place = trim($match[$i][1]);
$lowplace = I18N::strtolower($place);
@@ -788,7 +788,7 @@ class FunctionsImport {
foreach ($secalp as $place) {
$place = trim($place);
- $key = strtolower(mb_substr($place, 0, 150) . "_" . $parent_id);
+ $key = strtolower(mb_substr($place, 0, 150) . '_' . $parent_id);
//-- if this place has already been added then we don't need to add it again
if (isset($placecache[$key])) {
$parent_id = $placecache[$key];
@@ -1101,7 +1101,7 @@ class FunctionsImport {
$gid = $match[1];
$type = $match[1];
} else {
- echo "ERROR: Invalid gedcom record.";
+ echo 'ERROR: Invalid gedcom record.';
return;
}
diff --git a/app/Functions/FunctionsPrint.php b/app/Functions/FunctionsPrint.php
index a33e465167..d31d5e3e6a 100644
--- a/app/Functions/FunctionsPrint.php
+++ b/app/Functions/FunctionsPrint.php
@@ -162,7 +162,7 @@ class FunctionsPrint {
if ($note->canShow()) {
$noterec = $note->getGedcom();
$nt = preg_match("/0 @$nmatch[1]@ NOTE (.*)/", $noterec, $n1match);
- $data .= self::printNoteRecord(($nt > 0) ? $n1match[1] : "", 1, $noterec, $textOnly);
+ $data .= self::printNoteRecord(($nt > 0) ? $n1match[1] : '', 1, $noterec, $textOnly);
if (!$textOnly) {
if (strpos($noterec, '1 SOUR') !== false) {
$data .= FunctionsPrintFacts::printFactSources($noterec, 1);
@@ -175,9 +175,9 @@ class FunctionsPrint {
}
if (!$textOnly) {
if (strpos($factrec, "$nlevel SOUR") !== false) {
- $data .= "<div class=\"indent\">";
+ $data .= '<div class="indent">';
$data .= FunctionsPrintFacts::printFactSources($nrec, $nlevel);
- $data .= "</div>";
+ $data .= '</div>';
}
}
}
@@ -358,7 +358,7 @@ class FunctionsPrint {
$husb_age != '' && $record->getSex() == 'M' && $husb_age != $age ||
$wife_age != '' && $record->getSex() == 'F' && $wife_age != $age
) {
- if ($age != "0d") {
+ if ($age != '0d') {
$ageText = '(' . I18N::translate('Age') . ' ' . FunctionsDate::getAgeAtEvent($age) . ')';
}
}
@@ -368,7 +368,7 @@ class FunctionsPrint {
// After death, print time since death
$age = FunctionsDate::getAgeAtEvent(Date::getAgeGedcom($death_date, $date));
if ($age != '') {
- if (Date::getAgeGedcom($death_date, $date) == "0d") {
+ if (Date::getAgeGedcom($death_date, $date) == '0d') {
$ageText = '(' . I18N::translate('on the date of death') . ')';
} else {
$ageText = '(' . $age . ' ' . I18N::translate('after death') . ')';
@@ -450,7 +450,7 @@ class FunctionsPrint {
$html .= ' - ' . $wt_place->getFullName();
}
}
- $map_lati = "";
+ $map_lati = '';
$cts = preg_match('/\d LATI (.*)/', $placerec, $match);
if ($cts > 0) {
$map_lati = $match[1];
@@ -463,8 +463,8 @@ class FunctionsPrint {
$html .= ' <span class="label">' . GedcomTag::getLabel('LONG') . ': </span>' . $map_long;
}
if ($map_lati && $map_long) {
- $map_lati = trim(strtr($map_lati, "NSEW,�", " - -. ")); // S5,6789 ==> -5.6789
- $map_long = trim(strtr($map_long, "NSEW,�", " - -. ")); // E3.456� ==> 3.456
+ $map_lati = trim(strtr($map_lati, 'NSEW,�', ' - -. ')); // S5,6789 ==> -5.6789
+ $map_long = trim(strtr($map_long, 'NSEW,�', ' - -. ')); // E3.456� ==> 3.456
$html .= ' <a rel="nofollow" href="https://maps.google.com/maps?q=' . $map_lati . ',' . $map_long . '" class="icon-googlemaps" title="' . I18N::translate('Google Maps™') . '"></a>';
$html .= ' <a rel="nofollow" href="https://www.bing.com/maps/?lvl=15&cp=' . $map_lati . '~' . $map_long . '" class="icon-bing" title="' . I18N::translate('Bing Maps™') . '"></a>';
$html .= ' <a rel="nofollow" href="https://www.openstreetmap.org/#map=15/' . $map_lati . '/' . $map_long . '" class="icon-osm" title="' . I18N::translate('OpenStreetMap™') . '"></a>';
@@ -543,7 +543,7 @@ class FunctionsPrint {
if (is_array(Session::get('clipboard'))) {
$newRow = true;
foreach (array_reverse(Session::get('clipboard'), true) as $fact_id => $fact) {
- if ($fact["type"] == $type || $fact["type"] == 'all') {
+ if ($fact['type'] == $type || $fact['type'] == 'all') {
if ($newRow) {
$newRow = false;
echo '<tr class="noprint"><td class="descriptionbox">';
@@ -572,30 +572,30 @@ class FunctionsPrint {
// -- Add from pick list
switch ($type) {
- case "INDI":
- $addfacts = preg_split("/[, ;:]+/", $WT_TREE->getPreference('INDI_FACTS_ADD'), -1, PREG_SPLIT_NO_EMPTY);
- $uniquefacts = preg_split("/[, ;:]+/", $WT_TREE->getPreference('INDI_FACTS_UNIQUE'), -1, PREG_SPLIT_NO_EMPTY);
- $quickfacts = preg_split("/[, ;:]+/", $WT_TREE->getPreference('INDI_FACTS_QUICK'), -1, PREG_SPLIT_NO_EMPTY);
+ case 'INDI':
+ $addfacts = preg_split('/[, ;:]+/', $WT_TREE->getPreference('INDI_FACTS_ADD'), -1, PREG_SPLIT_NO_EMPTY);
+ $uniquefacts = preg_split('/[, ;:]+/', $WT_TREE->getPreference('INDI_FACTS_UNIQUE'), -1, PREG_SPLIT_NO_EMPTY);
+ $quickfacts = preg_split('/[, ;:]+/', $WT_TREE->getPreference('INDI_FACTS_QUICK'), -1, PREG_SPLIT_NO_EMPTY);
break;
- case "FAM":
- $addfacts = preg_split("/[, ;:]+/", $WT_TREE->getPreference('FAM_FACTS_ADD'), -1, PREG_SPLIT_NO_EMPTY);
- $uniquefacts = preg_split("/[, ;:]+/", $WT_TREE->getPreference('FAM_FACTS_UNIQUE'), -1, PREG_SPLIT_NO_EMPTY);
- $quickfacts = preg_split("/[, ;:]+/", $WT_TREE->getPreference('FAM_FACTS_QUICK'), -1, PREG_SPLIT_NO_EMPTY);
+ case 'FAM':
+ $addfacts = preg_split('/[, ;:]+/', $WT_TREE->getPreference('FAM_FACTS_ADD'), -1, PREG_SPLIT_NO_EMPTY);
+ $uniquefacts = preg_split('/[, ;:]+/', $WT_TREE->getPreference('FAM_FACTS_UNIQUE'), -1, PREG_SPLIT_NO_EMPTY);
+ $quickfacts = preg_split('/[, ;:]+/', $WT_TREE->getPreference('FAM_FACTS_QUICK'), -1, PREG_SPLIT_NO_EMPTY);
break;
- case "SOUR":
- $addfacts = preg_split("/[, ;:]+/", $WT_TREE->getPreference('SOUR_FACTS_ADD'), -1, PREG_SPLIT_NO_EMPTY);
- $uniquefacts = preg_split("/[, ;:]+/", $WT_TREE->getPreference('SOUR_FACTS_UNIQUE'), -1, PREG_SPLIT_NO_EMPTY);
- $quickfacts = preg_split("/[, ;:]+/", $WT_TREE->getPreference('SOUR_FACTS_QUICK'), -1, PREG_SPLIT_NO_EMPTY);
+ case 'SOUR':
+ $addfacts = preg_split('/[, ;:]+/', $WT_TREE->getPreference('SOUR_FACTS_ADD'), -1, PREG_SPLIT_NO_EMPTY);
+ $uniquefacts = preg_split('/[, ;:]+/', $WT_TREE->getPreference('SOUR_FACTS_UNIQUE'), -1, PREG_SPLIT_NO_EMPTY);
+ $quickfacts = preg_split('/[, ;:]+/', $WT_TREE->getPreference('SOUR_FACTS_QUICK'), -1, PREG_SPLIT_NO_EMPTY);
break;
- case "NOTE":
- $addfacts = preg_split("/[, ;:]+/", $WT_TREE->getPreference('NOTE_FACTS_ADD'), -1, PREG_SPLIT_NO_EMPTY);
- $uniquefacts = preg_split("/[, ;:]+/", $WT_TREE->getPreference('NOTE_FACTS_UNIQUE'), -1, PREG_SPLIT_NO_EMPTY);
- $quickfacts = preg_split("/[, ;:]+/", $WT_TREE->getPreference('NOTE_FACTS_QUICK'), -1, PREG_SPLIT_NO_EMPTY);
+ case 'NOTE':
+ $addfacts = preg_split('/[, ;:]+/', $WT_TREE->getPreference('NOTE_FACTS_ADD'), -1, PREG_SPLIT_NO_EMPTY);
+ $uniquefacts = preg_split('/[, ;:]+/', $WT_TREE->getPreference('NOTE_FACTS_UNIQUE'), -1, PREG_SPLIT_NO_EMPTY);
+ $quickfacts = preg_split('/[, ;:]+/', $WT_TREE->getPreference('NOTE_FACTS_QUICK'), -1, PREG_SPLIT_NO_EMPTY);
break;
- case "REPO":
- $addfacts = preg_split("/[, ;:]+/", $WT_TREE->getPreference('REPO_FACTS_ADD'), -1, PREG_SPLIT_NO_EMPTY);
- $uniquefacts = preg_split("/[, ;:]+/", $WT_TREE->getPreference('REPO_FACTS_UNIQUE'), -1, PREG_SPLIT_NO_EMPTY);
- $quickfacts = preg_split("/[, ;:]+/", $WT_TREE->getPreference('REPO_FACTS_QUICK'), -1, PREG_SPLIT_NO_EMPTY);
+ case 'REPO':
+ $addfacts = preg_split('/[, ;:]+/', $WT_TREE->getPreference('REPO_FACTS_ADD'), -1, PREG_SPLIT_NO_EMPTY);
+ $uniquefacts = preg_split('/[, ;:]+/', $WT_TREE->getPreference('REPO_FACTS_UNIQUE'), -1, PREG_SPLIT_NO_EMPTY);
+ $quickfacts = preg_split('/[, ;:]+/', $WT_TREE->getPreference('REPO_FACTS_QUICK'), -1, PREG_SPLIT_NO_EMPTY);
break;
default:
return;
@@ -730,7 +730,7 @@ class FunctionsPrint {
foreach ($choices as $choice) {
echo '<span onclick="document.getElementById(\'', $element_id, '\').value=';
echo '\'', $choice, '\';';
- echo " return false;\">", $choice, '</span> ';
+ echo ' return false;">', $choice, '</span> ';
}
echo '</small>';
}
diff --git a/app/Functions/FunctionsPrintFacts.php b/app/Functions/FunctionsPrintFacts.php
index 5fba701c9c..fb092eab34 100644
--- a/app/Functions/FunctionsPrintFacts.php
+++ b/app/Functions/FunctionsPrintFacts.php
@@ -608,7 +608,7 @@ class FunctionsPrintFacts {
$source = Source::getInstance($sid, $WT_TREE);
if ($source) {
if ($source->canShow()) {
- $spos1 = strpos($factrec, "$level SOUR @" . $sid . "@", $spos2);
+ $spos1 = strpos($factrec, "$level SOUR @" . $sid . '@', $spos2);
$spos2 = strpos($factrec, "\n$level", $spos1);
if (!$spos2) {
$spos2 = strlen($factrec);
@@ -690,14 +690,14 @@ class FunctionsPrintFacts {
// NOTE: echo the notes of the media
echo '<p>';
echo FunctionsPrint::printFactNotes($media->getGedcom(), 1);
- $ttype = preg_match("/" . ($nlevel + 1) . " TYPE (.*)/", $media->getGedcom(), $match);
+ $ttype = preg_match('/' . ($nlevel + 1) . ' TYPE (.*)/', $media->getGedcom(), $match);
if ($ttype > 0) {
$mediaType = GedcomTag::getFileFormTypeValue($match[1]);
echo '<p class="label">', I18N::translate('Type'), ': </span> <span class="field">', $mediaType, '</p>';
}
echo '</p>';
//-- print spouse name for marriage events
- $ct = preg_match("/WT_SPOUSE: (.*)/", $factrec, $match);
+ $ct = preg_match('/WT_SPOUSE: (.*)/', $factrec, $match);
if ($ct > 0) {
$spouse = Individual::getInstance($match[1], $media->getTree());
if ($spouse) {
@@ -705,13 +705,13 @@ class FunctionsPrintFacts {
echo $spouse->getFullName();
echo '</a>';
}
- $ct = preg_match("/WT_FAMILY_ID: (.*)/", $factrec, $match);
+ $ct = preg_match('/WT_FAMILY_ID: (.*)/', $factrec, $match);
if ($ct > 0) {
$famid = trim($match[1]);
$family = Family::getInstance($famid, $spouse->getTree());
if ($family) {
if ($spouse) {
- echo " - ";
+ echo ' - ';
}
echo '<a href="', $family->getHtmlUrl(), '">', I18N::translate('View this family'), '</a>';
}
@@ -778,11 +778,11 @@ class FunctionsPrintFacts {
}
echo ' ', $styleadd, ' width20">';
$factlines = explode("\n", $factrec); // 1 BIRT Y\n2 SOUR ...
- $factwords = explode(" ", $factlines[0]); // 1 BIRT Y
+ $factwords = explode(' ', $factlines[0]); // 1 BIRT Y
$factname = $factwords[1]; // BIRT
if ($factname == 'EVEN' || $factname == 'FACT') {
// Add ' EVEN' to provide sensible output for an event with an empty TYPE record
- $ct = preg_match("/2 TYPE (.*)/", $factrec, $ematch);
+ $ct = preg_match('/2 TYPE (.*)/', $factrec, $ematch);
if ($ct > 0) {
$factname = trim($ematch[1]);
echo $factname;
@@ -802,10 +802,10 @@ class FunctionsPrintFacts {
// Inline sources can't be edited. Attempting to save one will convert it
// into a link, and delete it.
// e.g. "1 SOUR my source" becomes "1 SOUR @my source@" which does not exist.
- echo "<div class=\"editlink\"><a class=\"editicon\" onclick=\"return edit_record('$pid', '$fact_id');\" href=\"#\" title=\"" . I18N::translate('Edit') . "\"><span class=\"link_text\">" . I18N::translate('Edit') . "</span></a></div>";
+ echo "<div class=\"editlink\"><a class=\"editicon\" onclick=\"return edit_record('$pid', '$fact_id');\" href=\"#\" title=\"" . I18N::translate('Edit') . '"><span class="link_text">' . I18N::translate('Edit') . '</span></a></div>';
echo '<div class="copylink"><a class="copyicon" href="#" onclick="return copy_fact(\'', $pid, '\', \'', $fact_id, '\');" title="' . I18N::translate('Copy') . '"><span class="link_text">' . I18N::translate('Copy') . '</span></a></div>';
}
- echo "<div class=\"deletelink\"><a class=\"deleteicon\" onclick=\"return delete_fact('" . I18N::translate('Are you sure you want to delete this fact?') . "', '$pid', '$fact_id');\" href=\"#\" title=\"" . I18N::translate('Delete') . "\"><span class=\"link_text\">" . I18N::translate('Delete') . "</span></a></div>";
+ echo "<div class=\"deletelink\"><a class=\"deleteicon\" onclick=\"return delete_fact('" . I18N::translate('Are you sure you want to delete this fact?') . "', '$pid', '$fact_id');\" href=\"#\" title=\"" . I18N::translate('Delete') . '"><span class="link_text">' . I18N::translate('Delete') . '</span></a></div>';
echo '</div>';
} else {
echo GedcomTag::getLabel($factname, $parent);
@@ -848,7 +848,7 @@ class FunctionsPrintFacts {
$cs = preg_match("/$nlevel EVEN (.*)/", $srec, $cmatch);
if ($cs > 0) {
echo '<br><span class="label">', GedcomTag::getLabel('EVEN'), ' </span><span class="field">', $cmatch[1], '</span>';
- $cs = preg_match("/" . ($nlevel + 1) . " ROLE (.*)/", $srec, $cmatch);
+ $cs = preg_match('/' . ($nlevel + 1) . ' ROLE (.*)/', $srec, $cmatch);
if ($cs > 0) {
echo '<br>&nbsp;&nbsp;&nbsp;&nbsp;<span class="label">', GedcomTag::getLabel('ROLE'), ' </span><span class="field">', $cmatch[1], '</span>';
}
@@ -1021,9 +1021,9 @@ class FunctionsPrintFacts {
}
echo '</a>';
echo '<div class="editfacts">';
- echo "<div class=\"editlink\"><a class=\"editicon\" onclick=\"return edit_record('$pid', '$fact_id');\" href=\"#\" title=\"" . I18N::translate('Edit') . "\"><span class=\"link_text\">" . I18N::translate('Edit') . "</span></a></div>";
+ echo "<div class=\"editlink\"><a class=\"editicon\" onclick=\"return edit_record('$pid', '$fact_id');\" href=\"#\" title=\"" . I18N::translate('Edit') . '"><span class="link_text">' . I18N::translate('Edit') . '</span></a></div>';
echo '<div class="copylink"><a class="copyicon" href="#" onclick="return copy_fact(\'', $pid, '\', \'', $fact_id, '\');" title="' . I18N::translate('Copy') . '"><span class="link_text">' . I18N::translate('Copy') . '</span></a></div>';
- echo "<div class=\"deletelink\"><a class=\"deleteicon\" onclick=\"return delete_fact('" . I18N::translate('Are you sure you want to delete this fact?') . "', '$pid', '$fact_id');\" href=\"#\" title=\"" . I18N::translate('Delete') . "\"><span class=\"link_text\">" . I18N::translate('Delete') . "</span></a></div>";
+ echo "<div class=\"deletelink\"><a class=\"deleteicon\" onclick=\"return delete_fact('" . I18N::translate('Are you sure you want to delete this fact?') . "', '$pid', '$fact_id');\" href=\"#\" title=\"" . I18N::translate('Delete') . '"><span class="link_text">' . I18N::translate('Delete') . '</span></a></div>';
if ($note) {
echo '<a class="icon-note" href="', $note->getHtmlUrl(), '" title="' . I18N::translate('View') . '"><span class="link_text">' . I18N::translate('View') . '</span></a>';
}
@@ -1041,12 +1041,12 @@ class FunctionsPrintFacts {
}
}
$factlines = explode("\n", $factrec); // 1 BIRT Y\n2 NOTE ...
- $factwords = explode(" ", $factlines[0]); // 1 BIRT Y
+ $factwords = explode(' ', $factlines[0]); // 1 BIRT Y
$factname = $factwords[1]; // BIRT
$parent = GedcomRecord::getInstance($pid, $fact->getParent()->getTree());
if ($factname == 'EVEN' || $factname == 'FACT') {
// Add ' EVEN' to provide sensible output for an event with an empty TYPE record
- $ct = preg_match("/2 TYPE (.*)/", $factrec, $ematch);
+ $ct = preg_match('/2 TYPE (.*)/', $factrec, $ematch);
if ($ct > 0) {
$factname = trim($ematch[1]);
echo $factname;
@@ -1154,11 +1154,11 @@ class FunctionsPrintFacts {
echo ' ', $styleadd, ' width20">';
preg_match("/^\d (\w*)/", $factrec, $factname);
$factlines = explode("\n", $factrec); // 1 BIRT Y\n2 SOUR ...
- $factwords = explode(" ", $factlines[0]); // 1 BIRT Y
+ $factwords = explode(' ', $factlines[0]); // 1 BIRT Y
$factname = $factwords[1]; // BIRT
if ($factname == 'EVEN' || $factname == 'FACT') {
// Add ' EVEN' to provide sensible output for an event with an empty TYPE record
- $ct = preg_match("/2 TYPE (.*)/", $factrec, $ematch);
+ $ct = preg_match('/2 TYPE (.*)/', $factrec, $ematch);
if ($ct > 0) {
$factname = $ematch[1];
echo $factname;
diff --git a/app/Functions/FunctionsPrintLists.php b/app/Functions/FunctionsPrintLists.php
index 57e79da189..66bf260e4d 100644
--- a/app/Functions/FunctionsPrintLists.php
+++ b/app/Functions/FunctionsPrintLists.php
@@ -1872,21 +1872,21 @@ class FunctionsPrintLists {
return '';
}
$avg = round($avg / $count);
- $chart_url = "https://chart.googleapis.com/chart?cht=bvs"; // chart type
- $chart_url .= "&amp;chs=725x150"; // size
- $chart_url .= "&amp;chbh=3,2,2"; // bvg : 4,1,2
- $chart_url .= "&amp;chf=bg,s,FFFFFF99"; //background color
- $chart_url .= "&amp;chco=0000FF,FFA0CB,FF0000"; // bar color
- $chart_url .= "&amp;chdl=" . rawurlencode(I18N::translate('Males')) . "|" . rawurlencode(I18N::translate('Females')) . "|" . rawurlencode(I18N::translate('Average age') . ": " . $avg); // legend & average age
- $chart_url .= "&amp;chtt=" . rawurlencode($title); // title
- $chart_url .= "&amp;chxt=x,y,r"; // axis labels specification
- $chart_url .= "&amp;chm=V,FF0000,0," . ($avg - 0.3) . ",1"; // average age line marker
- $chart_url .= "&amp;chxl=0:|"; // label
+ $chart_url = 'https://chart.googleapis.com/chart?cht=bvs'; // chart type
+ $chart_url .= '&amp;chs=725x150'; // size
+ $chart_url .= '&amp;chbh=3,2,2'; // bvg : 4,1,2
+ $chart_url .= '&amp;chf=bg,s,FFFFFF99'; //background color
+ $chart_url .= '&amp;chco=0000FF,FFA0CB,FF0000'; // bar color
+ $chart_url .= '&amp;chdl=' . rawurlencode(I18N::translate('Males')) . '|' . rawurlencode(I18N::translate('Females')) . '|' . rawurlencode(I18N::translate('Average age') . ': ' . $avg); // legend & average age
+ $chart_url .= '&amp;chtt=' . rawurlencode($title); // title
+ $chart_url .= '&amp;chxt=x,y,r'; // axis labels specification
+ $chart_url .= '&amp;chm=V,FF0000,0,' . ($avg - 0.3) . ',1'; // average age line marker
+ $chart_url .= '&amp;chxl=0:|'; // label
for ($age = 0; $age <= $agemax; $age += 5) {
- $chart_url .= $age . "|||||"; // x axis
+ $chart_url .= $age . '|||||'; // x axis
}
- $chart_url .= "|1:||" . rawurlencode(I18N::percentage($vmax / $count)); // y axis
- $chart_url .= "|2:||";
+ $chart_url .= '|1:||' . rawurlencode(I18N::percentage($vmax / $count)); // y axis
+ $chart_url .= '|2:||';
$step = $vmax;
for ($d = $vmax; $d > 0; $d--) {
if ($vmax < ($d * 10 + 1) && ($vmax % $d) == 0) {
@@ -1901,18 +1901,18 @@ class FunctionsPrintLists {
}
}
for ($n = $step; $n < $vmax; $n += $step) {
- $chart_url .= $n . "|";
+ $chart_url .= $n . '|';
}
- $chart_url .= rawurlencode($vmax . " / " . $count); // r axis
- $chart_url .= "&amp;chg=100," . round(100 * $step / $vmax, 1) . ",1,5"; // grid
- $chart_url .= "&amp;chd=s:"; // data : simple encoding from A=0 to 9=61
- $CHART_ENCODING61 = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
+ $chart_url .= rawurlencode($vmax . ' / ' . $count); // r axis
+ $chart_url .= '&amp;chg=100,' . round(100 * $step / $vmax, 1) . ',1,5'; // grid
+ $chart_url .= '&amp;chd=s:'; // data : simple encoding from A=0 to 9=61
+ $CHART_ENCODING61 = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';
for ($age = 0; $age <= $agemax; $age++) {
- $chart_url .= $CHART_ENCODING61[(int) (substr_count($data[$age], "M") * 61 / $vmax)];
+ $chart_url .= $CHART_ENCODING61[(int) (substr_count($data[$age], 'M') * 61 / $vmax)];
}
- $chart_url .= ",";
+ $chart_url .= ',';
for ($age = 0; $age <= $agemax; $age++) {
- $chart_url .= $CHART_ENCODING61[(int) (substr_count($data[$age], "F") * 61 / $vmax)];
+ $chart_url .= $CHART_ENCODING61[(int) (substr_count($data[$age], 'F') * 61 / $vmax)];
}
$html = '<img src="' . $chart_url . '" alt="' . $title . '" title="' . $title . '" class="gchart">';
@@ -1938,19 +1938,19 @@ class FunctionsPrintLists {
if ($count < 1) {
return '';
}
- $chart_url = "https://chart.googleapis.com/chart?cht=bvs"; // chart type
- $chart_url .= "&amp;chs=360x150"; // size
- $chart_url .= "&amp;chbh=3,3"; // bvg : 4,1,2
- $chart_url .= "&amp;chf=bg,s,FFFFFF99"; //background color
- $chart_url .= "&amp;chco=0000FF,FFA0CB"; // bar color
- $chart_url .= "&amp;chtt=" . rawurlencode($title); // title
- $chart_url .= "&amp;chxt=x,y,r"; // axis labels specification
- $chart_url .= "&amp;chxl=0:|&lt;|||"; // <1570
+ $chart_url = 'https://chart.googleapis.com/chart?cht=bvs'; // chart type
+ $chart_url .= '&amp;chs=360x150'; // size
+ $chart_url .= '&amp;chbh=3,3'; // bvg : 4,1,2
+ $chart_url .= '&amp;chf=bg,s,FFFFFF99'; //background color
+ $chart_url .= '&amp;chco=0000FF,FFA0CB'; // bar color
+ $chart_url .= '&amp;chtt=' . rawurlencode($title); // title
+ $chart_url .= '&amp;chxt=x,y,r'; // axis labels specification
+ $chart_url .= '&amp;chxl=0:|&lt;|||'; // <1570
for ($y = 1600; $y < 2030; $y += 50) {
- $chart_url .= $y . "|||||"; // x axis
+ $chart_url .= $y . '|||||'; // x axis
}
- $chart_url .= "|1:||" . rawurlencode(I18N::percentage($vmax / $count)); // y axis
- $chart_url .= "|2:||";
+ $chart_url .= '|1:||' . rawurlencode(I18N::percentage($vmax / $count)); // y axis
+ $chart_url .= '|2:||';
$step = $vmax;
for ($d = $vmax; $d > 0; $d--) {
if ($vmax < ($d * 10 + 1) && ($vmax % $d) == 0) {
@@ -1965,18 +1965,18 @@ class FunctionsPrintLists {
}
}
for ($n = $step; $n < $vmax; $n += $step) {
- $chart_url .= $n . "|";
+ $chart_url .= $n . '|';
}
- $chart_url .= rawurlencode($vmax . " / " . $count); // r axis
- $chart_url .= "&amp;chg=100," . round(100 * $step / $vmax, 1) . ",1,5"; // grid
- $chart_url .= "&amp;chd=s:"; // data : simple encoding from A=0 to 9=61
- $CHART_ENCODING61 = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
+ $chart_url .= rawurlencode($vmax . ' / ' . $count); // r axis
+ $chart_url .= '&amp;chg=100,' . round(100 * $step / $vmax, 1) . ',1,5'; // grid
+ $chart_url .= '&amp;chd=s:'; // data : simple encoding from A=0 to 9=61
+ $CHART_ENCODING61 = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';
for ($y = 1570; $y < 2030; $y += 10) {
- $chart_url .= $CHART_ENCODING61[(int) (substr_count($data[$y], "M") * 61 / $vmax)];
+ $chart_url .= $CHART_ENCODING61[(int) (substr_count($data[$y], 'M') * 61 / $vmax)];
}
- $chart_url .= ",";
+ $chart_url .= ',';
for ($y = 1570; $y < 2030; $y += 10) {
- $chart_url .= $CHART_ENCODING61[(int) (substr_count($data[$y], "F") * 61 / $vmax)];
+ $chart_url .= $CHART_ENCODING61[(int) (substr_count($data[$y], 'F') * 61 / $vmax)];
}
$html = '<img src="' . $chart_url . '" alt="' . $title . '" title="' . $title . '" class="gchart">';
diff --git a/app/Functions/FunctionsRtl.php b/app/Functions/FunctionsRtl.php
index c882df3c08..add13bf98a 100644
--- a/app/Functions/FunctionsRtl.php
+++ b/app/Functions/FunctionsRtl.php
@@ -73,7 +73,7 @@ class FunctionsRtl {
* @return string The input string, with &lrm; and &rlm; stripped
*/
public static function stripLrmRlm($inputText) {
- return str_replace([WT_UTF8_LRM, WT_UTF8_RLM, WT_UTF8_LRO, WT_UTF8_RLO, WT_UTF8_LRE, WT_UTF8_RLE, WT_UTF8_PDF, "&lrm;", "&rlm;", "&LRM;", "&RLM;"], "", $inputText);
+ return str_replace([WT_UTF8_LRM, WT_UTF8_RLM, WT_UTF8_LRO, WT_UTF8_RLO, WT_UTF8_LRE, WT_UTF8_RLE, WT_UTF8_PDF, '&lrm;', '&rlm;', '&LRM;', '&RLM;'], '', $inputText);
}
/**
diff --git a/app/Module/AlbumModule.php b/app/Module/AlbumModule.php
index 86a35ceb4a..b7b11f96a2 100644
--- a/app/Module/AlbumModule.php
+++ b/app/Module/AlbumModule.php
@@ -136,12 +136,12 @@ class AlbumModule extends AbstractModule implements ModuleTabInterface {
$submenu = new Menu(I18N::translate('View the notes'), '#', '', [
'onclick' => 'modalNotes("' . Filter::escapeJs($notes) . '","' . I18N::translate('View the notes') . '"); return false;',
]);
- $submenu->addClass("submenuitem");
+ $submenu->addClass('submenuitem');
$menu->addSubmenu($submenu);
}
//View Details
$submenu = new Menu(I18N::translate('View the details'), $media->getHtmlUrl());
- $submenu->addClass("submenuitem");
+ $submenu->addClass('submenuitem');
$menu->addSubmenu($submenu);
//View Sources
@@ -159,14 +159,14 @@ class AlbumModule extends AbstractModule implements ModuleTabInterface {
$submenu = new Menu(I18N::translate('Edit the media object'), '#', '', [
'onclick' => 'return window.open("addmedia.php?action=editmedia&pid=' . $media->getXref() . '", "_blank", edit_window_specs);',
]);
- $submenu->addClass("submenuitem");
+ $submenu->addClass('submenuitem');
$menu->addSubmenu($submenu);
if (Auth::isAdmin()) {
if (Module::getModuleByName('GEDFact_assistant')) {
$submenu = new Menu(I18N::translate('Manage the links'), '#', '', [
'onclick' => 'return window.open("inverselink.php?mediaid=' . $media->getXref() . '&linkto=manage", "_blank", find_window_specs);',
]);
- $submenu->addClass("submenuitem");
+ $submenu->addClass('submenuitem');
$menu->addSubmenu($submenu);
} else {
$submenu = new Menu(I18N::translate('Link this media object to an individual'), '#', 'menu-obje-link-indi', [
@@ -190,7 +190,7 @@ class AlbumModule extends AbstractModule implements ModuleTabInterface {
$submenu = new Menu(I18N::translate('Unlink the media object'), '#', '', [
'onclick' => 'return unlink_media("' . I18N::translate('Are you sure you want to remove links to this media object?') . '", "' . $controller->record->getXref() . '", "' . $media->getXref() . '");',
]);
- $submenu->addClass("submenuitem");
+ $submenu->addClass('submenuitem');
$menu->addSubmenu($submenu);
}
}
diff --git a/app/Module/CensusAssistantModule.php b/app/Module/CensusAssistantModule.php
index 7ed40cffde..51dcdf1170 100644
--- a/app/Module/CensusAssistantModule.php
+++ b/app/Module/CensusAssistantModule.php
@@ -146,7 +146,7 @@ class CensusAssistantModule extends AbstractModule {
function pasteid(id, name, thumb) {
if (thumb) {
window.opener.paste_id(id, name, thumb);
- <?php if (!$multiple) { echo "window.close();"; } ?>
+ <?php if (!$multiple) { echo 'window.close();'; } ?>
} else {
// GEDFact_assistant ========================
if (window.opener.document.getElementById('addlinkQueue')) {
@@ -156,7 +156,7 @@ class CensusAssistantModule extends AbstractModule {
if (window.opener.pastename) {
window.opener.pastename(name);
}
- <?php if (!$multiple) { echo "window.close();"; } ?>
+ <?php if (!$multiple) { echo 'window.close();'; } ?>
}
}
function checknames(frm) {
@@ -205,19 +205,19 @@ class CensusAssistantModule extends AbstractModule {
'" . $indi->getBirthYear() . "' ,
'" . (1901 - $indi->getBirthYear()) . "' ,
'" . $indi->getBirthPlace() . "'); return false;\">
- <b>" . $indi->getFullName() . "</b>&nbsp;&nbsp;&nbsp;";
+ <b>" . $indi->getFullName() . '</b>&nbsp;&nbsp;&nbsp;';
$born = GedcomTag::getLabel('BIRT');
- echo "</span><br><span class=\"list_item\">", $born, " ", $indi->getBirthYear(), "&nbsp;&nbsp;&nbsp;", $indi->getBirthPlace(), "</span></a></li>";
- echo "<hr>";
+ echo '</span><br><span class="list_item">', $born, ' ', $indi->getBirthYear(), '&nbsp;&nbsp;&nbsp;', $indi->getBirthPlace(), '</span></a></li>';
+ echo '<hr>';
}
echo '</ul></td></tr><tr><td class="list_label">', I18N::translate('Total individuals: %s', count($myindilist)), '</tr></td>';
} else {
- echo "<td class=\"list_value_wrap\">";
+ echo '<td class="list_value_wrap">';
echo I18N::translate('No results found.');
- echo "</td></tr>";
+ echo '</td></tr>';
}
- echo "</table>";
+ echo '</table>';
echo '</div>';
}
diff --git a/app/Module/ClippingsCart/ClippingsCartController.php b/app/Module/ClippingsCart/ClippingsCartController.php
index 5e21d9aa8c..14b2c9b6a4 100644
--- a/app/Module/ClippingsCart/ClippingsCartController.php
+++ b/app/Module/ClippingsCart/ClippingsCartController.php
@@ -135,9 +135,9 @@ class ClippingsCartController {
if ($others === 'parents') {
$this->addClipping($obj->getHusband());
$this->addClipping($obj->getWife());
- } elseif ($others === "members") {
+ } elseif ($others === 'members') {
$this->addFamilyMembers(Family::getInstance($this->id, $WT_TREE));
- } elseif ($others === "descendants") {
+ } elseif ($others === 'descendants') {
$this->addFamilyDescendancy(Family::getInstance($this->id, $WT_TREE));
}
} elseif ($this->type === 'INDI') {
@@ -184,8 +184,8 @@ class ClippingsCartController {
if ($subm) {
$filetext .= $subm . "\n";
}
- if ($convert === "yes") {
- $filetext = str_replace("UTF-8", "ANSI", $filetext);
+ if ($convert === 'yes') {
+ $filetext = str_replace('UTF-8', 'ANSI', $filetext);
$filetext = utf8_decode($filetext);
}
@@ -237,16 +237,16 @@ class ClippingsCartController {
case 'INDI':
$filetext .= $record . "\n";
$filetext .= "1 SOUR @WEBTREES@\n";
- $filetext .= "2 PAGE " . WT_BASE_URL . $object->getRawUrl() . "\n";
+ $filetext .= '2 PAGE ' . WT_BASE_URL . $object->getRawUrl() . "\n";
break;
case 'FAM':
$filetext .= $record . "\n";
$filetext .= "1 SOUR @WEBTREES@\n";
- $filetext .= "2 PAGE " . WT_BASE_URL . $object->getRawUrl() . "\n";
+ $filetext .= '2 PAGE ' . WT_BASE_URL . $object->getRawUrl() . "\n";
break;
case 'SOUR':
$filetext .= $record . "\n";
- $filetext .= "1 NOTE " . WT_BASE_URL . $object->getRawUrl() . "\n";
+ $filetext .= '1 NOTE ' . WT_BASE_URL . $object->getRawUrl() . "\n";
break;
default:
// This autoloads the PclZip library, so we can use its constants.
@@ -270,7 +270,7 @@ class ClippingsCartController {
}
}
- if ($this->IncludeMedia === "yes") {
+ if ($this->IncludeMedia === 'yes') {
$this->media_list = $media;
} else {
$this->media_list = [];
@@ -278,7 +278,7 @@ class ClippingsCartController {
$filetext .= "0 @WEBTREES@ SOUR\n1 TITL " . WT_BASE_URL . "\n";
if ($user_id = $WT_TREE->getPreference('CONTACT_EMAIL')) {
$user = User::find($user_id);
- $filetext .= "1 AUTH " . $user->getRealName() . "\n";
+ $filetext .= '1 AUTH ' . $user->getRealName() . "\n";
}
$filetext .= "0 TRLR\n";
//-- make sure the preferred line endings are used
@@ -294,30 +294,30 @@ class ClippingsCartController {
*/
private function zipCart() {
$tempFileName = 'clipping' . rand() . '.ged';
- $fp = fopen(WT_DATA_DIR . $tempFileName, "wb");
+ $fp = fopen(WT_DATA_DIR . $tempFileName, 'wb');
if ($fp) {
flock($fp, LOCK_EX);
fwrite($fp, $this->download_data);
flock($fp, LOCK_UN);
fclose($fp);
- $zipName = "clippings" . rand(0, 1500) . ".zip";
+ $zipName = 'clippings' . rand(0, 1500) . '.zip';
$fname = WT_DATA_DIR . $zipName;
- $comment = "Created by " . WT_WEBTREES . " " . WT_VERSION . " on " . date("d M Y") . ".";
+ $comment = 'Created by ' . WT_WEBTREES . ' ' . WT_VERSION . ' on ' . date('d M Y') . '.';
$archive = new PclZip($fname);
// add the ged file to the root of the zip file (strip off the data folder)
$this->media_list[] = [\PCLZIP_ATT_FILE_NAME => WT_DATA_DIR . $tempFileName, \PCLZIP_ATT_FILE_NEW_FULL_NAME => $tempFileName];
$v_list = $archive->create($this->media_list, \PCLZIP_OPT_COMMENT, $comment);
if ($v_list == 0) {
- echo "Error : " . $archive->errorInfo(true) . "</td></tr>";
+ echo 'Error : ' . $archive->errorInfo(true) . '</td></tr>';
} else {
- $openedFile = fopen($fname, "rb");
+ $openedFile = fopen($fname, 'rb');
$this->download_data = fread($openedFile, filesize($fname));
fclose($openedFile);
unlink($fname);
}
unlink(WT_DATA_DIR . $tempFileName);
} else {
- echo I18N::translate('The file %s could not be created.', WT_DATA_DIR . $tempFileName) . " " . I18N::translate('Check the access rights on this folder.') . "<br><br>";
+ echo I18N::translate('The file %s could not be created.', WT_DATA_DIR . $tempFileName) . ' ' . I18N::translate('Check the access rights on this folder.') . '<br><br>';
}
}
diff --git a/app/Module/FamiliesSidebarModule.php b/app/Module/FamiliesSidebarModule.php
index 10a7b7d4db..c7de2bac90 100644
--- a/app/Module/FamiliesSidebarModule.php
+++ b/app/Module/FamiliesSidebarModule.php
@@ -163,7 +163,7 @@ class FamiliesSidebarModule extends AbstractModule implements ModuleSidebarInter
break;
}
$html = '<a href="module.php?mod=' . $this->getName() . '&amp;mod_action=ajax&amp;alpha=' . urlencode($letter) . '" class="sb_fam_letter">' . $html . '</a>';
- $out .= $html . " ";
+ $out .= $html . ' ';
}
$out .= '</p>';
diff --git a/app/Module/FamilyNavigatorModule.php b/app/Module/FamilyNavigatorModule.php
index 32d241690b..f9374a5d83 100644
--- a/app/Module/FamilyNavigatorModule.php
+++ b/app/Module/FamilyNavigatorModule.php
@@ -221,7 +221,7 @@ class FamilyNavigatorModule extends AbstractModule implements ModuleSidebarInter
}
if ($stepParents) {
$relationship = $father instanceof Individual ?
- I18N::translateContext("father’s wife", "step-mother") : I18N::translateContext("mother’s husband", "step-father");
+ I18N::translateContext('father’s wife', 'step-mother') : I18N::translateContext('mother’s husband', 'step-father');
$html .= sprintf(self::TTL, $relationship) . $stepParents;
}
}
diff --git a/app/Module/FamilyTreeFavoritesModule.php b/app/Module/FamilyTreeFavoritesModule.php
index 4ad70fd461..4826056d11 100644
--- a/app/Module/FamilyTreeFavoritesModule.php
+++ b/app/Module/FamilyTreeFavoritesModule.php
@@ -166,7 +166,7 @@ class FamilyTreeFavoritesModule extends AbstractModule implements ModuleBlockInt
$record = GedcomRecord::getInstance($favorite['gid'], $WT_TREE);
if ($record && $record->canShow()) {
if ($record instanceof Individual) {
- $content .= '<div id="box' . $favorite["gid"] . '.0" class="person_box action_header';
+ $content .= '<div id="box' . $favorite['gid'] . '.0" class="person_box action_header';
switch ($record->getSex()) {
case 'M':
break;
@@ -178,7 +178,7 @@ class FamilyTreeFavoritesModule extends AbstractModule implements ModuleBlockInt
break;
}
$content .= '">';
- if ($ctype == "user" || Auth::isManager($WT_TREE)) {
+ if ($ctype == 'user' || Auth::isManager($WT_TREE)) {
$content .= $removeFavourite;
}
$content .= Theme::theme()->individualBoxLarge($record);
diff --git a/app/Module/FamilyTreeNewsModule.php b/app/Module/FamilyTreeNewsModule.php
index c6c4478ece..2c035a2d7e 100644
--- a/app/Module/FamilyTreeNewsModule.php
+++ b/app/Module/FamilyTreeNewsModule.php
@@ -134,7 +134,7 @@ class FamilyTreeNewsModule extends AbstractModule implements ModuleBlockInterfac
if (Auth::isManager($WT_TREE)) {
$content .= ' | ';
}
- $content .= '<a href="#" onclick="jQuery(\'#' . $id . '\').load(\'index.php?ctype=gedcom&amp;ged=' . $WT_TREE->getNameUrl() . '&amp;block_id=' . $block_id . '&amp;action=ajax&amp;more_news=' . ($more_news + 1) . '\'); return false;">' . I18N::translate('More news articles') . "</a>";
+ $content .= '<a href="#" onclick="jQuery(\'#' . $id . '\').load(\'index.php?ctype=gedcom&amp;ged=' . $WT_TREE->getNameUrl() . '&amp;block_id=' . $block_id . '&amp;action=ajax&amp;more_news=' . ($more_news + 1) . '\'); return false;">' . I18N::translate('More news articles') . '</a>';
}
if ($template) {
diff --git a/app/Module/FamilyTreeStatisticsModule.php b/app/Module/FamilyTreeStatisticsModule.php
index 86359e95df..00309f6df6 100644
--- a/app/Module/FamilyTreeStatisticsModule.php
+++ b/app/Module/FamilyTreeStatisticsModule.php
@@ -104,7 +104,7 @@ class FamilyTreeStatisticsModule extends AbstractModule implements ModuleBlockIn
/** Responsive Design */
$content .= '<div class="stat-table1">';
if ($stat_indi) {
- $content .= '<div class="stat-row"><div class="facts_label stat-cell">' . I18N::translate('Individuals') . '</div><div class="facts_value stats_value stat-cell"><a href="' . "indilist.php?surname_sublist=no&amp;ged=" . $WT_TREE->getNameUrl() . '">' . $stats->totalIndividuals() . '</a></div></div>';
+ $content .= '<div class="stat-row"><div class="facts_label stat-cell">' . I18N::translate('Individuals') . '</div><div class="facts_value stats_value stat-cell"><a href="' . 'indilist.php?surname_sublist=no&amp;ged=' . $WT_TREE->getNameUrl() . '">' . $stats->totalIndividuals() . '</a></div></div>';
$content .= '<div class="stat-row"><div class="facts_label stat-cell">' . I18N::translate('Males') . '</div><div class="facts_value stats_value stat-cell">' . $stats->totalSexMales() . '<br>' . $stats->totalSexMalesPercentage() . '</div></div>';
$content .= '<div class="stat-row"><div class="facts_label stat-cell">' . I18N::translate('Females') . '</div><div class="facts_value stats_value stat-cell">' . $stats->totalSexFemales() . '<br>' . $stats->totalSexFemalesPercentage() . '</div></div>';
}
diff --git a/app/Module/GoogleMapsModule.php b/app/Module/GoogleMapsModule.php
index 8a3db2415d..b0b2c6815e 100644
--- a/app/Module/GoogleMapsModule.php
+++ b/app/Module/GoogleMapsModule.php
@@ -537,9 +537,9 @@ class GoogleMapsModule extends AbstractModule implements ModuleConfigInterface,
<?php if (Filter::post('selcountry') == 'Countries') { ?>
window.opener.document.editplaces.icon.value = 'places/flags/<?php echo $flags[Filter::post('FLAGS')] ?>.png';
window.opener.document.getElementById('flagsDiv').innerHTML = "<img src=\"<?php echo WT_STATIC_URL . WT_MODULES_DIR ?>googlemap/places/flags/<?php echo $country[Filter::post('FLAGS')] ?>.png\">&nbsp;&nbsp;<a href=\"#\" onclick=\"change_icon();return false;\"><?php echo I18N::translate('Change flag') ?></a>&nbsp;&nbsp;<a href=\"#\" onclick=\"remove_icon();return false;\"><?php echo I18N::translate('Remove flag') ?></a>";
- <?php } elseif (Filter::post('selstate') != "States") { ?>
+ <?php } elseif (Filter::post('selstate') != 'States') { ?>
window.opener.document.editplaces.icon.value = 'places/<?php echo $countrySelected . '/flags/' . Filter::post('selstate') . '/' . $flags_s[Filter::post('FLAGS')] ?>.png';
- window.opener.document.getElementById('flagsDiv').innerHTML = "<img src=\"<?php echo WT_STATIC_URL . WT_MODULES_DIR ?>googlemap/places/<?php echo $countrySelected . "/flags/" . Filter::post('selstate') . '/' . $flags_s[Filter::post('FLAGS')] ?>.png\">&nbsp;&nbsp;<a href=\"#\" onclick=\"change_icon();return false;\"><?php echo I18N::translate('Change flag') ?></a>&nbsp;&nbsp;<a href=\"#\" onclick=\"remove_icon();return false;\"><?php echo I18N::translate('Remove flag') ?></a>";
+ window.opener.document.getElementById('flagsDiv').innerHTML = "<img src=\"<?php echo WT_STATIC_URL . WT_MODULES_DIR ?>googlemap/places/<?php echo $countrySelected . '/flags/' . Filter::post('selstate') . '/' . $flags_s[Filter::post('FLAGS')] ?>.png\">&nbsp;&nbsp;<a href=\"#\" onclick=\"change_icon();return false;\"><?php echo I18N::translate('Change flag') ?></a>&nbsp;&nbsp;<a href=\"#\" onclick=\"remove_icon();return false;\"><?php echo I18N::translate('Remove flag') ?></a>";
<?php } else { ?>
window.opener.document.editplaces.icon.value = "places/<?php echo $countrySelected . '/flags/' . $flags[Filter::post('FLAGS')] ?>.png";
window.opener.document.getElementById('flagsDiv').innerHTML = "<img src=\"<?php echo WT_STATIC_URL . WT_MODULES_DIR ?>googlemap/places/<?php echo $countrySelected . '/flags/' . $flags[Filter::post('FLAGS')] ?>.png\">&nbsp;&nbsp;<a href=\"#\" onclick=\"change_icon();return false;\"><?php echo I18N::translate('Change flag') ?></a>&nbsp;&nbsp;<a href=\"#\" onclick=\"remove_icon();return false;\"><?php echo I18N::translate('Remove flag') ?></a>";
@@ -624,7 +624,7 @@ class GoogleMapsModule extends AbstractModule implements ModuleConfigInterface,
$path = WT_STATIC_URL . WT_MODULES_DIR . 'googlemap/places/';
$path .= $countrySelected == 'Countries' ? 'flags/' : $countrySelected . '/flags/';
foreach (array_chunk($flags, 4) as $row) {
- echo "<tr>";
+ echo '<tr>';
foreach ($row as $flag) {
if ($flag != 'blank') {
if (isset($countries[$flag])) {
@@ -643,7 +643,7 @@ class GoogleMapsModule extends AbstractModule implements ModuleConfigInterface,
}
echo str_repeat('<td></td>', 4 - count($row));
- echo "</tr>";
+ echo '</tr>';
}
echo'<tr style="visibility:' . (($countrySelected == 'Countries' || count($stateList) == 0) ? 'hidden' : 'visible') . '">';
@@ -668,7 +668,7 @@ class GoogleMapsModule extends AbstractModule implements ModuleConfigInterface,
$i = 0;
if (!empty($flags_s)) {
foreach (array_chunk($flags_s, 4) as $row) {
- echo "<tr>";
+ echo '<tr>';
foreach ($row as $flag) {
echo '<td><input type="radio" dir="ltr" name="FLAGS" value="', $i++, '"><img src="', WT_STATIC_URL . WT_MODULES_DIR, 'googlemap/places/', $countrySelected, '/flags/', $stateSelected, '/', $flag, '.png">&nbsp;&nbsp;', $flag, '</td>';
}
@@ -1403,8 +1403,8 @@ class GoogleMapsModule extends AbstractModule implements ModuleConfigInterface,
$x = 0;
$max = 0;
while ($x < $i) {
- $levels = explode(",", $place_list[$x]);
- $parts = count($levels);
+ $levels = explode(',', $place_list[$x]);
+ $parts = count($levels);
if ($parts > $max) {
$max = $parts;
}
@@ -1456,7 +1456,7 @@ class GoogleMapsModule extends AbstractModule implements ModuleConfigInterface,
foreach ($levels as $pindex => $ppart) {
$placestr .= '&amp;parent[' . $pindex . ']=' . urlencode($ppart);
}
- $placestr .= '">' . $place_list[$x] . "</a>";
+ $placestr .= '">' . $place_list[$x] . '</a>';
$gedplace = '<tr><td>' . $placestr . '</td>';
$z = 0;
$id = 0;
@@ -1494,15 +1494,15 @@ class GoogleMapsModule extends AbstractModule implements ModuleConfigInterface,
}
if ($row['pl_place'] != '') {
- $placestr2 = $mapstr_edit . $id . "&amp;level=" . $level . $mapstr3 . $mapstr5 . I18N::translate('Zoom') . ' ' . $row['pl_zoom'] . $mapstr6 . $row['pl_placerequested'] . $mapstr8;
+ $placestr2 = $mapstr_edit . $id . '&amp;level=' . $level . $mapstr3 . $mapstr5 . I18N::translate('Zoom') . ' ' . $row['pl_zoom'] . $mapstr6 . $row['pl_placerequested'] . $mapstr8;
if ($row['pl_place'] === 'unknown') {
$matched[$x]++;
}
} else {
if ($levels[$z] === 'unknown') {
- $placestr2 = $mapstr_add . $id . "&amp;level=" . $level . $mapstr3 . $mapstr7 . "<strong>" . I18N::translate('unknown') . "</strong>" . $mapstr8; $matched[$x]++;
+ $placestr2 = $mapstr_add . $id . '&amp;level=' . $level . $mapstr3 . $mapstr7 . '<strong>' . I18N::translate('unknown') . '</strong>' . $mapstr8; $matched[$x]++;
} else {
- $placestr2 = $mapstr_add . $id . "&amp;place_name=" . urlencode($levels[$z]) . "&amp;level=" . $level . $mapstr3 . $mapstr7 . '<span class="danger">' . $levels[$z] . '</span>' . $mapstr8; $matched[$x]++;
+ $placestr2 = $mapstr_add . $id . '&amp;place_name=' . urlencode($levels[$z]) . '&amp;level=' . $level . $mapstr3 . $mapstr7 . '<span class="danger">' . $levels[$z] . '</span>' . $mapstr8; $matched[$x]++;
}
}
$plac[$z] = '<td>' . $placestr2 . '</td>';
@@ -1523,8 +1523,8 @@ class GoogleMapsModule extends AbstractModule implements ModuleConfigInterface,
$matched[$x]++;
}
$level++;
- $mapstr3 = $mapstr3 . "&amp;parent[" . $z . "]=" . Filter::escapeJs($row['pl_placerequested']);
- $mapstr4 = $mapstr4 . "&amp;parent[" . $z . "]=" . Filter::escapeJs($levels[$z]);
+ $mapstr3 = $mapstr3 . '&amp;parent[' . $z . ']=' . Filter::escapeJs($row['pl_placerequested']);
+ $mapstr4 = $mapstr4 . '&amp;parent[' . $z . ']=' . Filter::escapeJs($levels[$z]);
$z++;
}
if ($matching) {
@@ -2333,7 +2333,7 @@ class GoogleMapsModule extends AbstractModule implements ModuleConfigInterface,
<?php echo Filter::getCsrf() ?>
<input type='hidden' name='placeid' value='<?php echo $placeid ?>'>
<input type='hidden' name='action' value='update_sv_params'>
- <input type='hidden' name='destination' value='<?php echo Filter::server("REQUEST_URI") ?>'>
+ <input type='hidden' name='destination' value='<?php echo Filter::server('REQUEST_URI') ?>'>
<label for='sv_latiText'><?php echo GedcomTag::getLabel('LATI') ?></label>
<input name='sv_latiText' id='sv_latiText' type='text' title="<?php echo $sv_lat ?>" style='width:42px;' value='<?php echo $sv_lat ?>'>
<label for='sv_longText'><?php echo GedcomTag::getLabel('LONG') ?></label>
@@ -2766,7 +2766,7 @@ class GoogleMapsModule extends AbstractModule implements ModuleConfigInterface,
$it = new \RecursiveIteratorIterator($di);
foreach ($it as $file) {
- if ($file->getExtension() == "csv") {
+ if ($file->getExtension() == 'csv') {
$placefiles[] = '/' . $file->getFilename();
}
}
@@ -2857,7 +2857,7 @@ class GoogleMapsModule extends AbstractModule implements ModuleConfigInterface,
->fetchOneRow();
$place_name = $row->pl_place;
$place_icon = $row->pl_icon;
- $selected_country = explode("/", $place_icon);
+ $selected_country = explode('/', $place_icon);
if (isset($selected_country[1]) && $selected_country[1] !== 'flags') {
$selected_country = $selected_country[1];
} else {
@@ -3515,10 +3515,10 @@ class GoogleMapsModule extends AbstractModule implements ModuleConfigInterface,
$i = 1;
$placerec = Functions::getSubRecord(2, '2 PLAC', $gedrec, $i);
while (!empty($placerec)) {
- if (preg_match("/2 PLAC (.+)/", $placerec, $match)) {
+ if (preg_match('/2 PLAC (.+)/', $placerec, $match)) {
$placelist[$j] = [];
$placelist[$j]['place'] = trim($match[1]);
- if (preg_match("/4 LATI (.*)/", $placerec, $match)) {
+ if (preg_match('/4 LATI (.*)/', $placerec, $match)) {
$placelist[$j]['lati'] = trim($match[1]);
if (($placelist[$j]['lati'][0] != 'N') && ($placelist[$j]['lati'][0] != 'S')) {
if ($placelist[$j]['lati'] < 0) {
@@ -3530,7 +3530,7 @@ class GoogleMapsModule extends AbstractModule implements ModuleConfigInterface,
} else {
$placelist[$j]['lati'] = null;
}
- if (preg_match("/4 LONG (.*)/", $placerec, $match)) {
+ if (preg_match('/4 LONG (.*)/', $placerec, $match)) {
$placelist[$j]['long'] = trim($match[1]);
if (($placelist[$j]['long'][0] != 'E') && ($placelist[$j]['long'][0] != 'W')) {
if ($placelist[$j]['long'] < 0) {
@@ -3659,7 +3659,7 @@ class GoogleMapsModule extends AbstractModule implements ModuleConfigInterface,
foreach ($placefiles as $p => $placefile) {
unset($placefiles[$p]);
$p = Filter::escapeHtml($placefile);
- if (substr($placefile, 0, 1) == "/") {
+ if (substr($placefile, 0, 1) == '/') {
$placefiles[$p] = substr($placefile, 1);
} else {
$placefiles[$p] = $placefile;
diff --git a/app/Module/IndividualSidebarModule.php b/app/Module/IndividualSidebarModule.php
index 0f43276f41..90e3f68949 100644
--- a/app/Module/IndividualSidebarModule.php
+++ b/app/Module/IndividualSidebarModule.php
@@ -164,7 +164,7 @@ class IndividualSidebarModule extends AbstractModule implements ModuleSidebarInt
break;
}
$html = '<a href="module.php?mod=' . $this->getName() . '&amp;mod_action=ajax&amp;alpha=' . urlencode($letter) . '" class="sb_indi_letter">' . $html . '</a>';
- $out .= $html . " ";
+ $out .= $html . ' ';
}
$out .= '</p>';
diff --git a/app/Module/RelativesTabModule.php b/app/Module/RelativesTabModule.php
index 91b29dc7a1..8721dc4362 100644
--- a/app/Module/RelativesTabModule.php
+++ b/app/Module/RelativesTabModule.php
@@ -367,7 +367,7 @@ class RelativesTabModule extends AbstractModule implements ModuleTabInterface {
<a href="#" onclick="return add_famc('<?php echo $controller->record->getXref(); ?>');"><?php echo I18N::translate('Link this individual to an existing family as a child'); ?></a>
</td>
</tr>
- <?php if ($controller->record->getSex() != "F") { ?>
+ <?php if ($controller->record->getSex() != 'F') { ?>
<tr>
<td class="facts_value">
<a href="#" onclick="return add_spouse_to_individual('<?php echo $controller->record->getXref(); ?>','WIFE');"><?php echo I18N::translate('Add a wife'); ?></a>
@@ -379,7 +379,7 @@ class RelativesTabModule extends AbstractModule implements ModuleTabInterface {
</td>
</tr>
<?php }
- if ($controller->record->getSex() != "M") { ?>
+ if ($controller->record->getSex() != 'M') { ?>
<tr>
<td class="facts_value">
<a href="#" onclick="return add_spouse_to_individual('<?php echo $controller->record->getXref(); ?>','HUSB');"><?php echo I18N::translate('Add a husband'); ?></a>
diff --git a/app/Module/ReviewChangesModule.php b/app/Module/ReviewChangesModule.php
index ae9f0a7e1b..5d1cc156db 100644
--- a/app/Module/ReviewChangesModule.php
+++ b/app/Module/ReviewChangesModule.php
@@ -108,11 +108,11 @@ class ReviewChangesModule extends AbstractModule implements ModuleBlockInterface
$content = '';
if (Auth::isModerator($WT_TREE)) {
- $content .= "<a href=\"#\" onclick=\"window.open('edit_changes.php','_blank', chan_window_specs); return false;\">" . I18N::translate('There are pending changes for you to moderate.') . "</a><br>";
+ $content .= "<a href=\"#\" onclick=\"window.open('edit_changes.php','_blank', chan_window_specs); return false;\">" . I18N::translate('There are pending changes for you to moderate.') . '</a><br>';
}
if ($sendmail === '1') {
- $content .= I18N::translate('Last email reminder was sent ') . FunctionsDate::formatTimestamp(Site::getPreference('LAST_CHANGE_EMAIL')) . "<br>";
- $content .= I18N::translate('Next email reminder will be sent after ') . FunctionsDate::formatTimestamp(Site::getPreference('LAST_CHANGE_EMAIL') + (60 * 60 * 24 * $days)) . "<br><br>";
+ $content .= I18N::translate('Last email reminder was sent ') . FunctionsDate::formatTimestamp(Site::getPreference('LAST_CHANGE_EMAIL')) . '<br>';
+ $content .= I18N::translate('Next email reminder will be sent after ') . FunctionsDate::formatTimestamp(Site::getPreference('LAST_CHANGE_EMAIL') + (60 * 60 * 24 * $days)) . '<br><br>';
}
$content .= '<ul>';
$changes = Database::prepare(
diff --git a/app/Module/SlideShowModule.php b/app/Module/SlideShowModule.php
index fee72d2b70..b023aad26b 100644
--- a/app/Module/SlideShowModule.php
+++ b/app/Module/SlideShowModule.php
@@ -136,7 +136,7 @@ class SlideShowModule extends AbstractModule implements ModuleBlockInterface {
$icon_class = 'icon-media-play';
}
$content .= '<div dir="ltr" class="center" id="random_picture_controls' . $block_id . '"><br>';
- $content .= "<a href=\"#\" onclick=\"togglePlay(); return false;\" id=\"play_stop\" class=\"" . $icon_class . "\" title=\"" . I18N::translate('Play') . "/" . I18N::translate('Stop') . '"></a>';
+ $content .= '<a href="#" onclick="togglePlay(); return false;" id="play_stop" class="' . $icon_class . '" title="' . I18N::translate('Play') . '/' . I18N::translate('Stop') . '"></a>';
$content .= '<a href="#" onclick="jQuery(\'#block_' . $block_id . '\').load(\'index.php?ctype=' . $ctype . '&amp;action=ajax&amp;block_id=' . $block_id . '\');return false;" title="' . I18N::translate('Next image') . '" class="icon-media-next"></a>';
$content .= '</div><script>
var play = false;
@@ -183,7 +183,7 @@ class SlideShowModule extends AbstractModule implements ModuleBlockInterface {
$content .= '<a href="' . $source->getHtmlUrl() . '">' . I18N::translate('View this source') . ' — ' . $source->getFullName() . '</a><br>';
}
$content .= '<br><div class="indent">';
- $content .= FunctionsPrint::printFactNotes($random_media->getGedcom(), "1", false);
+ $content .= FunctionsPrint::printFactNotes($random_media->getGedcom(), '1', false);
$content .= '</div>';
$content .= '</td></tr></table>';
$content .= '</div>'; // random_picture_content
diff --git a/app/Module/TopGivenNamesModule.php b/app/Module/TopGivenNamesModule.php
index efd5b58fb1..f3a42cc8b0 100644
--- a/app/Module/TopGivenNamesModule.php
+++ b/app/Module/TopGivenNamesModule.php
@@ -77,7 +77,7 @@ class TopGivenNamesModule extends AbstractModule implements ModuleBlockInterface
$content = '<div class="normal_inner_block">';
//Select List or Table
switch ($infoStyle) {
- case "list": // Output style 1: Simple list style. Better suited to left side of page.
+ case 'list': // Output style 1: Simple list style. Better suited to left side of page.
if (I18N::direction() === 'ltr') {
$padding = 'padding-left: 15px';
} else {
@@ -95,7 +95,7 @@ class TopGivenNamesModule extends AbstractModule implements ModuleBlockInterface
$content .= '<b>' . I18N::translate('Males') . '</b><div class="wrap" style="' . $padding . '">' . $totals . '</div><br>';
}
break;
- case "table": // Style 2: Tabular format. Narrow, 2 or 3 column table, good on right side of page
+ case 'table': // Style 2: Tabular format. Narrow, 2 or 3 column table, good on right side of page
$params = [1, $num, 'rcount'];
$content .= '<table style="margin:auto;">
<tr>
@@ -104,7 +104,7 @@ class TopGivenNamesModule extends AbstractModule implements ModuleBlockInterface
$content .= '</tr></table>';
break;
}
- $content .= "</div>";
+ $content .= '</div>';
if ($template) {
return Theme::theme()->formatBlock($id, $title, $class, $content);
diff --git a/app/Module/TopPageViewsModule.php b/app/Module/TopPageViewsModule.php
index a7f7c0ff7d..0f1f533b6d 100644
--- a/app/Module/TopPageViewsModule.php
+++ b/app/Module/TopPageViewsModule.php
@@ -102,7 +102,7 @@ class TopPageViewsModule extends AbstractModule implements ModuleBlockInterface
$content .= '</tr>';
}
}
- $content .= "</table>";
+ $content .= '</table>';
if ($template) {
return Theme::theme()->formatBlock($id, $title, $class, $content);
@@ -161,9 +161,9 @@ class TopPageViewsModule extends AbstractModule implements ModuleBlockInterface
echo '<input type="text" name="num" size="2" value="', $num, '">';
echo '</td></tr>';
- echo "<tr><td class=\"descriptionbox wrap width33\">";
+ echo '<tr><td class="descriptionbox wrap width33">';
echo /* I18N: Label for a configuration option */ I18N::translate('Show counts before or after name');
- echo "</td><td class=\"optionbox\">";
+ echo '</td><td class="optionbox">';
echo FunctionsEdit::selectEditControl('count_placement', ['before' => I18N::translate('before'), 'after' => I18N::translate('after')], null, $count_placement, '');
echo '</td></tr>';
}
diff --git a/app/Module/WelcomeBlockModule.php b/app/Module/WelcomeBlockModule.php
index 2b6cd6825c..4e5ca7e6b7 100644
--- a/app/Module/WelcomeBlockModule.php
+++ b/app/Module/WelcomeBlockModule.php
@@ -59,8 +59,8 @@ class WelcomeBlockModule extends AbstractModule implements ModuleBlockInterface
if (Site::getPreference('USE_REGISTRATION_MODULE') && !Auth::check()) {
$content .= '<td><a href="' . WT_LOGIN_URL . '?action=register"><i class="icon-user_add"></i><br>' . I18N::translate('Request a new user account') . '</a></td>';
}
- $content .= "</tr>";
- $content .= "</table>";
+ $content .= '</tr>';
+ $content .= '</table>';
if ($template) {
return Theme::theme()->formatBlock($id, $title, $class, $content);
diff --git a/app/Module/YahrzeitModule.php b/app/Module/YahrzeitModule.php
index 025b220b5b..3984ca8de4 100644
--- a/app/Module/YahrzeitModule.php
+++ b/app/Module/YahrzeitModule.php
@@ -123,11 +123,11 @@ class YahrzeitModule extends AbstractModule implements ModuleBlockInterface {
foreach ($yahrzeits as $yahrzeit) {
if ($yahrzeit->jd >= $startjd && $yahrzeit->jd < $startjd + $days) {
$ind = $yahrzeit->getParent();
- $content .= "<a href=\"" . $ind->getHtmlUrl() . "\" class=\"list_item name2\">" . $ind->getFullName() . "</a>" . $ind->getSexImage();
- $content .= "<div class=\"indent\">";
+ $content .= '<a href="' . $ind->getHtmlUrl() . '" class="list_item name2">' . $ind->getFullName() . '</a>' . $ind->getSexImage();
+ $content .= '<div class="indent">';
$content .= $yahrzeit->getDate()->display(true);
$content .= ', ' . I18N::translate('%s year anniversary', $yahrzeit->anniv);
- $content .= "</div>";
+ $content .= '</div>';
}
}
break;
diff --git a/app/Report/ReportBaseCell.php b/app/Report/ReportBaseCell.php
index e555765471..b9c78d8f31 100644
--- a/app/Report/ReportBaseCell.php
+++ b/app/Report/ReportBaseCell.php
@@ -24,7 +24,7 @@ class ReportBaseCell extends ReportBaseElement {
*
* @var string
*/
- public $align = "";
+ public $align = '';
/**
* Whether or not a border should be printed around this box. 0 = no border, 1 = border. Default is 0.
* Or a string containing some or all of the following characters (in any order):<ul><li>L: left</li><li>T: top</li><li>R: right</li><li>B: bottom</li></ul>
@@ -141,10 +141,10 @@ class ReportBaseCell extends ReportBaseElement {
$this->left = $left;
$this->newline = $ln;
$this->styleName = $style;
- $this->text = "";
+ $this->text = '';
$this->tcolor = $tcolor;
$this->top = $top;
- $this->url = "";
+ $this->url = '';
$this->stretch = $stretch;
$this->width = $width;
$this->reseth = $reseth;
diff --git a/app/Report/ReportBaseElement.php b/app/Report/ReportBaseElement.php
index 2e18582689..9733107ab1 100644
--- a/app/Report/ReportBaseElement.php
+++ b/app/Report/ReportBaseElement.php
@@ -62,7 +62,7 @@ class ReportBaseElement {
*/
public function addText($t) {
$t = trim($t, "\r\n\t");
- $t = str_replace(["<br>", "&nbsp;"], ["\n", " "], $t);
+ $t = str_replace(['<br>', '&nbsp;'], ["\n", ' '], $t);
$t = strip_tags($t);
$t = htmlspecialchars_decode($t);
$this->text .= $t;
diff --git a/app/Report/ReportBaseFootnote.php b/app/Report/ReportBaseFootnote.php
index b5cefa1515..285e7b2264 100644
--- a/app/Report/ReportBaseFootnote.php
+++ b/app/Report/ReportBaseFootnote.php
@@ -24,7 +24,7 @@ class ReportBaseFootnote extends ReportBaseElement {
*
* @var string
*/
- public $styleName = "";
+ public $styleName = '';
/**
* Numbers for the links
@@ -38,7 +38,7 @@ class ReportBaseFootnote extends ReportBaseElement {
*
* @var string
*/
- public $numText = "";
+ public $numText = '';
/**
* Remaining width of a cell
@@ -62,12 +62,12 @@ class ReportBaseFootnote extends ReportBaseElement {
*
* @param string $style
*/
- public function __construct($style = "") {
- $this->text = "";
+ public function __construct($style = '') {
+ $this->text = '';
if (!empty($style)) {
$this->styleName = $style;
} else {
- $this->styleName = "footnote";
+ $this->styleName = 'footnote';
}
}
@@ -80,7 +80,7 @@ class ReportBaseFootnote extends ReportBaseElement {
*/
public function addText($t) {
$t = trim($t, "\r\n\t");
- $t = str_replace(["<br>", "&nbsp;"], ["\n", " "], $t);
+ $t = str_replace(['<br>', '&nbsp;'], ["\n", ' '], $t);
$t = strip_tags($t);
$t = htmlspecialchars_decode($t);
$this->text .= $t;
diff --git a/app/Report/ReportBaseHtml.php b/app/Report/ReportBaseHtml.php
index 5c0f9e15d5..ba8766e09e 100644
--- a/app/Report/ReportBaseHtml.php
+++ b/app/Report/ReportBaseHtml.php
@@ -47,11 +47,11 @@ class ReportBaseHtml extends ReportBaseElement {
* @return string
*/
public function getStart() {
- $str = "<" . $this->tag . " ";
+ $str = '<' . $this->tag . ' ';
foreach ($this->attrs as $key => $value) {
- $str .= $key . "=\"" . $value . "\" ";
+ $str .= $key . '="' . $value . '" ';
}
- $str .= ">";
+ $str .= '>';
return $str;
}
@@ -62,7 +62,7 @@ class ReportBaseHtml extends ReportBaseElement {
* @return string
*/
public function getEnd() {
- return "</" . $this->tag . ">";
+ return '</' . $this->tag . '>';
}
/**
diff --git a/app/Report/ReportBaseImage.php b/app/Report/ReportBaseImage.php
index 11435ff335..d9895af551 100644
--- a/app/Report/ReportBaseImage.php
+++ b/app/Report/ReportBaseImage.php
@@ -54,13 +54,13 @@ class ReportBaseImage extends ReportBaseElement {
*
* @var string
*/
- public $align = "";
+ public $align = '';
/**
* T:same line, N:next line
*
* @var string
*/
- public $line = "";
+ public $line = '';
/**
* Image class function - Base
diff --git a/app/Report/ReportBaseLine.php b/app/Report/ReportBaseLine.php
index adc2217f1a..11c06d1602 100644
--- a/app/Report/ReportBaseLine.php
+++ b/app/Report/ReportBaseLine.php
@@ -24,25 +24,25 @@ class ReportBaseLine extends ReportBaseElement {
*
* @var mixed
*/
- public $x1 = ".";
+ public $x1 = '.';
/**
* Start vertical position, current position (default)
*
* @var mixed
*/
- public $y1 = ".";
+ public $y1 = '.';
/**
* End horizontal position, maximum width (default)
*
* @var mixed
*/
- public $x2 = ".";
+ public $x2 = '.';
/**
* End vertical position
*
* @var mixed
*/
- public $y2 = ".";
+ public $y2 = '.';
/**
* Create a line class - Base
diff --git a/app/Report/ReportHtml.php b/app/Report/ReportHtml.php
index 88a22b6bea..3af3ffefc7 100644
--- a/app/Report/ReportHtml.php
+++ b/app/Report/ReportHtml.php
@@ -138,7 +138,7 @@ class ReportHtml extends ReportBase {
parent::setup();
// Setting up the correct dimensions if Portrait (default) or Landscape
- if ($this->orientation == "landscape") {
+ if ($this->orientation == 'landscape') {
$tmpw = $this->pagew;
$this->pagew = $this->pageh;
$this->pageh = $tmpw;
@@ -147,11 +147,11 @@ class ReportHtml extends ReportBase {
$this->noMarginWidth = (int) ($this->pagew - $this->leftmargin - $this->rightmargin);
// If RTL
if ($this->rtl) {
- $this->alignRTL = "right";
- $this->entityRTL = "&rlm;";
+ $this->alignRTL = 'right';
+ $this->entityRTL = '&rlm;';
}
// Change the default HTML font name
- $this->defaultFont = "Arial";
+ $this->defaultFont = 'Arial';
if ($this->showGenText) {
// The default style name for Generated by.... is 'genby'
@@ -168,11 +168,11 @@ class ReportHtml extends ReportBase {
* @param $element
*/
public function addElement($element) {
- if ($this->processing == "B") {
+ if ($this->processing == 'B') {
$this->bodyElements[] = $element;
- } elseif ($this->processing == "H") {
+ } elseif ($this->processing == 'H') {
$this->headerElements[] = $element;
- } elseif ($this->processing == "F") {
+ } elseif ($this->processing == 'F') {
$this->footerElements[] = $element;
}
}
@@ -184,9 +184,9 @@ class ReportHtml extends ReportBase {
foreach ($this->pageHeaderElements as $element) {
if (is_object($element)) {
$element->render($this);
- } elseif (is_string($element) && $element == "footnotetexts") {
+ } elseif (is_string($element) && $element == 'footnotetexts') {
$this->footnotes();
- } elseif (is_string($element) && $element == "addpage") {
+ } elseif (is_string($element) && $element == 'addpage') {
$this->addPage();
}
}
@@ -196,7 +196,7 @@ class ReportHtml extends ReportBase {
* Generate footnotes
*/
public function footnotes() {
- $this->currentStyle = "";
+ $this->currentStyle = '';
if (!empty($this->printedfootnotes)) {
foreach ($this->printedfootnotes as $element) {
$element->renderFootnote($this);
@@ -218,8 +218,8 @@ class ReportHtml extends ReportBase {
echo 'body { font: 10px sans-serif;}';
foreach ($this->Styles as $class => $style) {
echo '.', $class, ' { ';
- if ($style["font"] == "dejavusans") {
- $style["font"] = $this->defaultFont;
+ if ($style['font'] == 'dejavusans') {
+ $style['font'] = $this->defaultFont;
}
echo 'font-family: ', $style['font'], '; ';
echo 'font-size: ', $style['size'], 'pt; ';
@@ -246,9 +246,9 @@ class ReportHtml extends ReportBase {
foreach ($this->headerElements as $element) {
if (is_object($element)) {
$element->render($this);
- } elseif (is_string($element) && $element == "footnotetexts") {
+ } elseif (is_string($element) && $element == 'footnotetexts') {
$this->footnotes();
- } elseif (is_string($element) && $element == "addpage") {
+ } elseif (is_string($element) && $element == 'addpage') {
$this->addPage();
}
}
@@ -262,9 +262,9 @@ class ReportHtml extends ReportBase {
foreach ($this->bodyElements as $element) {
if (is_object($element)) {
$element->render($this);
- } elseif (is_string($element) && $element == "footnotetexts") {
+ } elseif (is_string($element) && $element == 'footnotetexts') {
$this->footnotes();
- } elseif (is_string($element) && $element == "addpage") {
+ } elseif (is_string($element) && $element == 'addpage') {
$this->addPage();
}
}
@@ -279,9 +279,9 @@ class ReportHtml extends ReportBase {
foreach ($this->footerElements as $element) {
if (is_object($element)) {
$element->render($this);
- } elseif (is_string($element) && $element == "footnotetexts") {
+ } elseif (is_string($element) && $element == 'footnotetexts') {
$this->footnotes();
- } elseif (is_string($element) && $element == "addpage") {
+ } elseif (is_string($element) && $element == 'addpage') {
$this->addPage();
}
}
@@ -355,7 +355,7 @@ class ReportHtml extends ReportBase {
*
* @return ReportHtmlFootnote
*/
- public function createFootnote($style = "") {
+ public function createFootnote($style = '') {
return new ReportHtmlFootnote($style);
}
@@ -520,7 +520,7 @@ class ReportHtml extends ReportBase {
* @return int Number of lines. 0 if empty line
*/
public function countLines($str) {
- if ($str == "") {
+ if ($str == '') {
return 0;
}
@@ -547,7 +547,7 @@ class ReportHtml extends ReportBase {
}
$style = $this->getStyle($this->currentStyle);
- return $style["size"];
+ return $style['size'];
}
/**
diff --git a/app/Report/ReportHtmlCell.php b/app/Report/ReportHtmlCell.php
index 182ec9c786..0352fc9f84 100644
--- a/app/Report/ReportHtmlCell.php
+++ b/app/Report/ReportHtmlCell.php
@@ -25,10 +25,10 @@ class ReportHtmlCell extends ReportBaseCell {
* @param ReportHtml $renderer
*/
public function render($renderer) {
- if (strpos($this->text, "{{:ptp:}}") !== false) {
+ if (strpos($this->text, '{{:ptp:}}') !== false) {
return;
}
- $temptext = str_replace("#PAGENUM#", $renderer->pageNo(), $this->text);
+ $temptext = str_replace('#PAGENUM#', $renderer->pageNo(), $this->text);
// underline «title» part of Source item
$temptext = str_replace(['«', '»'], ['<u>', '</u>'], $temptext);
@@ -41,27 +41,27 @@ class ReportHtmlCell extends ReportBaseCell {
$cP = $renderer->cPadding;
// Adjust the positions
- if ($this->left == ".") {
+ if ($this->left == '.') {
$this->left = $renderer->getX();
} else {
$renderer->setX($this->left);
}
- if ($this->top == ".") {
+ if ($this->top == '.') {
$this->top = $renderer->getY();
} else {
$renderer->setY($this->top);
}
// Start collecting the HTML code
- echo "<div class=\"", $this->styleName, "\" style=\"position:absolute;top:", $this->top, "pt;";
+ echo '<div class="', $this->styleName, '" style="position:absolute;top:', $this->top, 'pt;';
// Use Cell around padding to support RTL also
- echo "padding:", $cP, "pt;";
+ echo 'padding:', $cP, 'pt;';
// LTR (left) or RTL (right)
- echo $renderer->alignRTL, ":", $this->left, "pt;";
+ echo $renderer->alignRTL, ':', $this->left, 'pt;';
// Background color
if (!empty($this->bgcolor)) {
- echo "background-color:", $this->bgcolor, ";";
+ echo 'background-color:', $this->bgcolor, ';';
}
// Border setup
$bpixX = 0;
@@ -69,54 +69,54 @@ class ReportHtmlCell extends ReportBaseCell {
if (!empty($this->border)) {
// Border all around
if ($this->border == 1) {
- echo " border:solid ";
+ echo ' border:solid ';
if (!empty($this->bocolor)) {
echo $this->bocolor;
} else {
- echo "black";
+ echo 'black';
}
- echo " 1pt;";
+ echo ' 1pt;';
$bpixX = 1;
$bpixY = 1;
} else {
- if (stripos($this->border, "T") !== false) {
- echo " border-top:solid ";
+ if (stripos($this->border, 'T') !== false) {
+ echo ' border-top:solid ';
if (!empty($this->bocolor)) {
echo $this->bocolor;
} else {
- echo "black";
+ echo 'black';
}
- echo " 1pt;";
+ echo ' 1pt;';
$bpixY = 1;
}
- if (stripos($this->border, "B") !== false) {
- echo " border-bottom:solid ";
+ if (stripos($this->border, 'B') !== false) {
+ echo ' border-bottom:solid ';
if (!empty($this->bocolor)) {
echo $this->bocolor;
} else {
- echo "black";
+ echo 'black';
}
- echo " 1pt;";
+ echo ' 1pt;';
$bpixY = 1;
}
- if (stripos($this->border, "R") !== false) {
- echo " border-right:solid ";
+ if (stripos($this->border, 'R') !== false) {
+ echo ' border-right:solid ';
if (!empty($this->bocolor)) {
echo $this->bocolor;
} else {
- echo "black";
+ echo 'black';
}
- echo " 1pt;";
+ echo ' 1pt;';
$bpixX = 1;
}
- if (stripos($this->border, "L") !== false) {
- echo " border-left:solid ";
+ if (stripos($this->border, 'L') !== false) {
+ echo ' border-left:solid ';
if (!empty($this->bocolor)) {
echo $this->bocolor;
} else {
- echo "black";
+ echo 'black';
}
- echo " 1pt;";
+ echo ' 1pt;';
$bpixX = 1;
}
}
@@ -143,34 +143,34 @@ class ReportHtmlCell extends ReportBaseCell {
if ($renderer->lastCellHeight > $this->height) {
$this->height = $renderer->lastCellHeight;
}
- echo " width:", $cW - $bpixX, "pt;height:", $this->height - $bpixY, "pt;";
+ echo ' width:', $cW - $bpixX, 'pt;height:', $this->height - $bpixY, 'pt;';
// Text alignment
switch ($this->align) {
- case "C":
- echo " text-align:center;";
+ case 'C':
+ echo ' text-align:center;';
break;
- case "L":
- echo " text-align:left;";
+ case 'L':
+ echo ' text-align:left;';
break;
- case "R":
- echo " text-align:right;";
+ case 'R':
+ echo ' text-align:right;';
break;
}
// Print the collected HTML code
- echo "\">";
+ echo '">';
// Print URL
if (!empty($this->url)) {
- echo "<a href=\"", $this->url, "\">";
+ echo '<a href="', $this->url, '">';
}
// Print any text if exists
if (!empty($temptext)) {
$renderer->write($temptext, $this->tcolor, false);
}
if (!empty($this->url)) {
- echo "</a>";
+ echo '</a>';
}
// Finish the cell printing and start to clean up
echo "</div>\n";
diff --git a/app/Report/ReportHtmlFootnote.php b/app/Report/ReportHtmlFootnote.php
index 837cde87f0..5804bb95e0 100644
--- a/app/Report/ReportHtmlFootnote.php
+++ b/app/Report/ReportHtmlFootnote.php
@@ -25,8 +25,8 @@ class ReportHtmlFootnote extends ReportBaseFootnote {
* @param ReportHtml $renderer
*/
public function render($renderer) {
- $renderer->setCurrentStyle("footnotenum");
- echo "<a href=\"#footnote", $this->num, "\"><sup>";
+ $renderer->setCurrentStyle('footnotenum');
+ echo '<a href="#footnote', $this->num, '"><sup>';
$renderer->write($renderer->entityRTL . $this->num);
echo "</sup></a>\n";
}
@@ -43,12 +43,12 @@ class ReportHtmlFootnote extends ReportBaseFootnote {
$html->setCurrentStyle($this->styleName);
}
- $temptext = str_replace("#PAGENUM#", $html->pageNo(), $this->text);
+ $temptext = str_replace('#PAGENUM#', $html->pageNo(), $this->text);
// underline «title» part of Source item
$temptext = str_replace(['«', '»'], ['<u>', '</u>'], $temptext);
- echo "\n<div><a name=\"footnote", $this->num, "\"></a>";
- $html->write($this->num . ". " . $temptext);
- echo "</div>";
+ echo "\n<div><a name=\"footnote", $this->num, '"></a>';
+ $html->write($this->num . '. ' . $temptext);
+ echo '</div>';
$html->setXy(0, $html->getY() + $this->getFootnoteHeight($html));
}
@@ -86,7 +86,7 @@ class ReportHtmlFootnote extends ReportBaseFootnote {
*/
public function getWidth($html) {
// Setup the style name
- $html->setCurrentStyle("footnotenum");
+ $html->setCurrentStyle('footnotenum');
// Check for the largest font size in the box
$fsize = $html->getCurrentStyleHeight();
@@ -107,7 +107,7 @@ class ReportHtmlFootnote extends ReportBaseFootnote {
if ($this->wrapWidthRemaining > 0) {
// Check with line counter too!
if ($lw >= $this->wrapWidthRemaining || $lfct > 1) {
- $newtext = "";
+ $newtext = '';
$wrapWidthRemaining = $this->wrapWidthRemaining;
$lines = explode("\n", $this->numText);
// Go throught the text line by line
@@ -116,22 +116,22 @@ class ReportHtmlFootnote extends ReportBaseFootnote {
$lw = $html->getStringWidth($line);
// If the line has to be wraped
if ($lw > $wrapWidthRemaining) {
- $words = explode(" ", $line);
+ $words = explode(' ', $line);
$addspace = count($words);
$lw = 0;
foreach ($words as $word) {
$addspace--;
- $lw += $html->getStringWidth($word . " ");
+ $lw += $html->getStringWidth($word . ' ');
if ($lw <= $wrapWidthRemaining) {
$newtext .= $word;
if ($addspace != 0) {
- $newtext .= " ";
+ $newtext .= ' ';
}
} else {
- $lw = $html->getStringWidth($word . " ");
+ $lw = $html->getStringWidth($word . ' ');
$newtext .= "\n$word";
if ($addspace != 0) {
- $newtext .= " ";
+ $newtext .= ' ';
}
// Reset the wrap width to the cell width
$wrapWidthRemaining = $this->wrapWidthCell;
diff --git a/app/Report/ReportHtmlHtml.php b/app/Report/ReportHtmlHtml.php
index e0ac4e7c34..8925f27e8b 100644
--- a/app/Report/ReportHtmlHtml.php
+++ b/app/Report/ReportHtmlHtml.php
@@ -29,15 +29,15 @@ class ReportHtmlHtml extends ReportBaseHtml {
* @return string
*/
public function render($renderer, $sub = false, $inat = true) {
- if (!empty($this->attrs["wt_style"])) {
- $renderer->setCurrentStyle($this->attrs["wt_style"]);
+ if (!empty($this->attrs['wt_style'])) {
+ $renderer->setCurrentStyle($this->attrs['wt_style']);
}
$this->text = $this->getStart() . $this->text;
foreach ($this->elements as $element) {
- if (is_string($element) && $element == "footnotetexts") {
+ if (is_string($element) && $element == 'footnotetexts') {
$renderer->footnotes();
- } elseif (is_string($element) && $element == "addpage") {
+ } elseif (is_string($element) && $element == 'addpage') {
$renderer->addPage();
} elseif ($element instanceof ReportBaseHtml) {
$element->render($renderer, true, false);
@@ -55,7 +55,7 @@ class ReportHtmlHtml extends ReportBaseHtml {
$startX = $renderer->getX();
$startY = $renderer->getY();
$width = $renderer->getRemainingWidth();
- echo "<div style=\"position: absolute;top: ", $startY, "pt;", $renderer->alignRTL, ": ", $startX, "pt;width: ", $width, "pt;\">";
+ echo '<div style="position: absolute;top: ', $startY, 'pt;', $renderer->alignRTL, ': ', $startX, 'pt;width: ', $width, 'pt;">';
$startY += $renderer->getCurrentStyleHeight() + 2;
$renderer->setY($startY);
}
diff --git a/app/Report/ReportHtmlImage.php b/app/Report/ReportHtmlImage.php
index b99a7b1b71..0257cd7a8d 100644
--- a/app/Report/ReportHtmlImage.php
+++ b/app/Report/ReportHtmlImage.php
@@ -28,10 +28,10 @@ class ReportHtmlImage extends ReportBaseImage {
global $lastpicbottom, $lastpicpage, $lastpicleft, $lastpicright;
// Get the current positions
- if ($this->x == ".") {
+ if ($this->x == '.') {
$this->x = $renderer->getX();
}
- if ($this->y == ".") {
+ if ($this->y == '.') {
//-- first check for a collision with the last picture
if (isset($lastpicbottom)) {
if (($renderer->pageNo() == $lastpicpage) && ($lastpicbottom >= $renderer->getY()) && ($this->x >= $lastpicleft) && ($this->x <= $lastpicright)) {
@@ -43,20 +43,20 @@ class ReportHtmlImage extends ReportBaseImage {
// Image alignment
switch ($this->align) {
- case "L":
- echo "<div style=\"position:absolute;top:", $this->y, "pt;left:0pt;width:", $renderer->getRemainingWidth(), "pt;text-align:left;\">\n";
- echo "<img src=\"", $this->file, "\" style=\"width:", $this->width, "pt;height:", $this->height, "pt;\" alt=\"\">\n</div>\n";
+ case 'L':
+ echo '<div style="position:absolute;top:', $this->y, 'pt;left:0pt;width:', $renderer->getRemainingWidth(), "pt;text-align:left;\">\n";
+ echo '<img src="', $this->file, '" style="width:', $this->width, 'pt;height:', $this->height, "pt;\" alt=\"\">\n</div>\n";
break;
- case "C":
- echo "<div style=\"position:absolute;top:", $this->y, "pt;left:0pt;width:", $renderer->getRemainingWidth(), "pt;text-align:center;\">\n";
- echo "<img src=\"", $this->file, "\" style=\"width:", $this->width, "pt;height:", $this->height, "pt;\" alt=\"\">\n</div>\n";
+ case 'C':
+ echo '<div style="position:absolute;top:', $this->y, 'pt;left:0pt;width:', $renderer->getRemainingWidth(), "pt;text-align:center;\">\n";
+ echo '<img src="', $this->file, '" style="width:', $this->width, 'pt;height:', $this->height, "pt;\" alt=\"\">\n</div>\n";
break;
- case "R":
- echo "<div style=\"position:absolute;top:", $this->y, "pt;left:0pt;width:", $renderer->getRemainingWidth(), "pt;text-align:right;\">\n";
- echo "<img src=\"", $this->file, "\" style=\"width:", $this->width, "pt;height:", $this->height, "pt;\" alt=\"\">\n</div>\n";
+ case 'R':
+ echo '<div style="position:absolute;top:', $this->y, 'pt;left:0pt;width:', $renderer->getRemainingWidth(), "pt;text-align:right;\">\n";
+ echo '<img src="', $this->file, '" style="width:', $this->width, 'pt;height:', $this->height, "pt;\" alt=\"\">\n</div>\n";
break;
default:
- echo "<img src=\"", $this->file, "\" style=\"position:absolute;", $renderer->alignRTL, ":", $this->x, "pt;top:", $this->y, "pt;width:", $this->width, "pt;height:", $this->height, "pt;\" alt=\"\">\n";
+ echo '<img src="', $this->file, '" style="position:absolute;', $renderer->alignRTL, ':', $this->x, 'pt;top:', $this->y, 'pt;width:', $this->width, 'pt;height:', $this->height, "pt;\" alt=\"\">\n";
}
$lastpicpage = $renderer->pageNo();
@@ -64,7 +64,7 @@ class ReportHtmlImage extends ReportBaseImage {
$lastpicright = $this->x + $this->width;
$lastpicbottom = $this->y + $this->height;
// Setup for the next line
- if ($this->line == "N") {
+ if ($this->line == 'N') {
$renderer->setY($lastpicbottom);
}
// Keep max Y updated
diff --git a/app/Report/ReportHtmlLine.php b/app/Report/ReportHtmlLine.php
index 446dad3ec6..babd11d2a1 100644
--- a/app/Report/ReportHtmlLine.php
+++ b/app/Report/ReportHtmlLine.php
@@ -39,11 +39,11 @@ class ReportHtmlLine extends ReportBaseLine {
}
// Vertical line
if ($this->x1 == $this->x2) {
- echo "<div style=\"position:absolute;overflow:hidden;border-", $renderer->alignRTL, ":solid black 1pt;", $renderer->alignRTL, ":", $this->x1, "pt;top:", $this->y1 + 1, "pt;width:1pt;height:", $this->y2 - $this->y1, "pt;\"> </div>\n";
+ echo '<div style="position:absolute;overflow:hidden;border-', $renderer->alignRTL, ':solid black 1pt;', $renderer->alignRTL, ':', $this->x1, 'pt;top:', $this->y1 + 1, 'pt;width:1pt;height:', $this->y2 - $this->y1, "pt;\"> </div>\n";
}
// Horizontal line
if ($this->y1 == $this->y2) {
- echo "<div style=\"position:absolute;overflow:hidden;border-top:solid black 1pt;", $renderer->alignRTL, ":", $this->x1, "pt;top:", $this->y1 + 1, "pt;width:", $this->x2 - $this->x1, "pt;height:1pt;\"> </div>\n";
+ echo '<div style="position:absolute;overflow:hidden;border-top:solid black 1pt;', $renderer->alignRTL, ':', $this->x1, 'pt;top:', $this->y1 + 1, 'pt;width:', $this->x2 - $this->x1, "pt;height:1pt;\"> </div>\n";
}
// Keep max Y updated
// One or the other will be higher... lasy mans way...
diff --git a/app/Report/ReportHtmlText.php b/app/Report/ReportHtmlText.php
index 47d48f9a90..6c248f9d80 100644
--- a/app/Report/ReportHtmlText.php
+++ b/app/Report/ReportHtmlText.php
@@ -32,7 +32,7 @@ class ReportHtmlText extends ReportBaseText {
if ($renderer->getCurrentStyle() != $this->styleName) {
$renderer->setCurrentStyle($this->styleName);
}
- $temptext = str_replace("#PAGENUM#", $renderer->pageNo(), $this->text);
+ $temptext = str_replace('#PAGENUM#', $renderer->pageNo(), $this->text);
// underline «title» part of Source item
$temptext = str_replace(['«', '»'], ['<u>', '</u>'], $temptext);
@@ -50,7 +50,7 @@ class ReportHtmlText extends ReportBaseText {
if ($renderer->getStringWidth($temptext) > $width) {
$lines = explode("\n", $temptext);
foreach ($lines as $line) {
- echo "<div style=\"position:absolute;top:", $startY, "pt;", $renderer->alignRTL, ":", $startX, "pt;width:", $width, "pt;\">";
+ echo '<div style="position:absolute;top:', $startY, 'pt;', $renderer->alignRTL, ':', $startX, 'pt;width:', $width, 'pt;">';
$line = $renderer->textWrap($line, $width);
$startY += $renderer->getTextCellHeight($line);
$renderer->setY($startY);
@@ -58,7 +58,7 @@ class ReportHtmlText extends ReportBaseText {
echo "</div>\n";
}
} else {
- echo "<div style=\"position:absolute;top:", $startY, "pt;", $renderer->alignRTL, ":", $startX, "pt;width:", $width, "pt;\">";
+ echo '<div style="position:absolute;top:', $startY, 'pt;', $renderer->alignRTL, ':', $startX, 'pt;width:', $width, 'pt;">';
$renderer->write($temptext, $this->color);
echo "</div>\n";
$renderer->setX($startX + $renderer->getStringWidth($temptext));
@@ -85,7 +85,7 @@ class ReportHtmlText extends ReportBaseText {
}
$style = $html->getStyle($this->styleName);
- return ($style["size"] * $ct) * $html->cellHeightRatio;
+ return ($style['size'] * $ct) * $html->cellHeightRatio;
}
/**
@@ -115,7 +115,7 @@ class ReportHtmlText extends ReportBaseText {
if ($this->wrapWidthRemaining > 0) {
// Check with line counter too!
if ($lw >= $this->wrapWidthRemaining || $lfct > 1) {
- $newtext = "";
+ $newtext = '';
$wrapWidthRemaining = $this->wrapWidthRemaining;
$lines = explode("\n", $this->text);
// Go throught the text line by line
@@ -124,22 +124,22 @@ class ReportHtmlText extends ReportBaseText {
$lw = $html->getStringWidth($line);
// If the line has to be wraped
if ($lw > $wrapWidthRemaining) {
- $words = explode(" ", $line);
+ $words = explode(' ', $line);
$addspace = count($words);
$lw = 0;
foreach ($words as $word) {
$addspace--;
- $lw += $html->getStringWidth($word . " ");
+ $lw += $html->getStringWidth($word . ' ');
if ($lw <= $wrapWidthRemaining) {
$newtext .= $word;
if ($addspace != 0) {
- $newtext .= " ";
+ $newtext .= ' ';
}
} else {
- $lw = $html->getStringWidth($word . " ");
+ $lw = $html->getStringWidth($word . ' ');
$newtext .= "\n$word";
if ($addspace != 0) {
- $newtext .= " ";
+ $newtext .= ' ';
}
// Reset the wrap width to the cell width
$wrapWidthRemaining = $this->wrapWidthCell;
diff --git a/app/Report/ReportHtmlTextbox.php b/app/Report/ReportHtmlTextbox.php
index 6e5c0f8756..1cf984b7c8 100644
--- a/app/Report/ReportHtmlTextbox.php
+++ b/app/Report/ReportHtmlTextbox.php
@@ -48,7 +48,7 @@ class ReportHtmlTextbox extends ReportBaseTextbox {
} else {
// Checking if the Text has the same style
if ($element->getStyleName() == $lastelement->getStyleName()) {
- $lastelement->addText(str_replace("\n", "<br>", $element->getValue()));
+ $lastelement->addText(str_replace("\n", '<br>', $element->getValue()));
} elseif (!empty($lastelement)) {
$newelements[] = $lastelement;
$lastelement = $element;
@@ -66,7 +66,7 @@ class ReportHtmlTextbox extends ReportBaseTextbox {
// Save the Footnote with it’s link number as key for sorting later
$footnote_element[$element->num] = $element;
} //-- do not keep empty footnotes
- elseif (!($element instanceof ReportBaseFootnote) || trim($element->getValue()) != "") {
+ elseif (!($element instanceof ReportBaseFootnote) || trim($element->getValue()) != '') {
if (!empty($footnote_element)) {
ksort($footnote_element);
foreach ($footnote_element as $links) {
@@ -113,14 +113,14 @@ class ReportHtmlTextbox extends ReportBaseTextbox {
$renderer->largestFontHeight = 0;
// Current position
- if ($this->left == ".") {
+ if ($this->left == '.') {
$cX = $renderer->getX();
} else {
$cX = $this->left;
$renderer->setX($cX);
}
// Current position (top)
- if ($this->top == ".") {
+ if ($this->top == '.') {
$this->top = $renderer->getY();
} else {
$renderer->setY($this->top);
@@ -212,28 +212,28 @@ class ReportHtmlTextbox extends ReportBaseTextbox {
$renderer->addMaxY($this->top + $cH);
// Start to print HTML
- echo "<div style=\"position:absolute;top:", $this->top, "pt;";
+ echo '<div style="position:absolute;top:', $this->top, 'pt;';
// LTR (left) or RTL (right)
- echo $renderer->alignRTL, ":", $cX, "pt;";
+ echo $renderer->alignRTL, ':', $cX, 'pt;';
// Background color
if ($this->fill) {
if (!empty($this->bgcolor)) {
- echo " background-color:", $this->bgcolor, ";";
+ echo ' background-color:', $this->bgcolor, ';';
}
}
// Print padding only when it’s set
if ($this->padding) {
// Use Cell around padding to support RTL also
- echo "padding:", $cP, "pt;";
+ echo 'padding:', $cP, 'pt;';
}
// Border setup
if ($this->border) {
- echo " border:solid black 1pt;";
- echo "width:", ($this->width - 1 - ($cP * 2)), "pt;height:", $cH - 1, "pt;";
+ echo ' border:solid black 1pt;';
+ echo 'width:', ($this->width - 1 - ($cP * 2)), 'pt;height:', $cH - 1, 'pt;';
} else {
- echo "width:", ($this->width - ($cP * 2)), "pt;height:", $cH, "pt;";
+ echo 'width:', ($this->width - ($cP * 2)), 'pt;height:', $cH, 'pt;';
}
- echo "\">";
+ echo '">';
// Do a little "margin" trick before print
// to get the correct current position => "."
@@ -245,9 +245,9 @@ class ReportHtmlTextbox extends ReportBaseTextbox {
foreach ($this->elements as $element) {
if (is_object($element)) {
$element->render($renderer, $cX, false);
- } elseif (is_string($element) && $element == "footnotetexts") {
+ } elseif (is_string($element) && $element == 'footnotetexts') {
$renderer->footnotes();
- } elseif (is_string($element) && $element == "addpage") {
+ } elseif (is_string($element) && $element == 'addpage') {
$renderer->addPage();
}
}
diff --git a/app/Report/ReportParserGenerate.php b/app/Report/ReportParserGenerate.php
index f24b1a1422..59ab5bd5b3 100644
--- a/app/Report/ReportParserGenerate.php
+++ b/app/Report/ReportParserGenerate.php
@@ -150,7 +150,7 @@ class ReportParserGenerate extends ReportParserBase {
$newattrs[$key] = $value;
}
$attrs = $newattrs;
- if ($this->process_footnote && ($this->process_ifs === 0 || $name === "if") && ($this->process_gedcoms === 0 || $name === "Gedcom") && ($this->process_repeats === 0 || $name === "Facts" || $name === "RepeatTag")) {
+ if ($this->process_footnote && ($this->process_ifs === 0 || $name === 'if') && ($this->process_gedcoms === 0 || $name === 'Gedcom') && ($this->process_repeats === 0 || $name === 'Facts' || $name === 'RepeatTag')) {
$start_method = $name . 'StartHandler';
$end_method = $name . 'EndHandler';
if (method_exists($this, $start_method)) {
@@ -171,7 +171,7 @@ class ReportParserGenerate extends ReportParserBase {
* @param string $name the name of the XML element parsed
*/
protected function endElement($parser, $name) {
- if (($this->process_footnote || $name === "Footnote") && ($this->process_ifs === 0 || $name === "if") && ($this->process_gedcoms === 0 || $name === "Gedcom") && ($this->process_repeats === 0 || $name === "Facts" || $name === "RepeatTag" || $name === "List" || $name === "Relatives")) {
+ if (($this->process_footnote || $name === 'Footnote') && ($this->process_ifs === 0 || $name === 'if') && ($this->process_gedcoms === 0 || $name === 'Gedcom') && ($this->process_repeats === 0 || $name === 'Facts' || $name === 'RepeatTag' || $name === 'List' || $name === 'Relatives')) {
$start_method = $name . 'StartHandler';
$end_method = $name . 'EndHandler';
if (method_exists($this, $end_method)) {
@@ -223,7 +223,7 @@ class ReportParserGenerate extends ReportParserBase {
} // Get it as int to ignore all decimal points or text (if any text then int(0))
// string B: bold, I: italic, U: underline, D: line trough, The default value is regular.
- $s['style'] = "";
+ $s['style'] = '';
if (!empty($attrs['style'])) {
$s['style'] = $attrs['style'];
}
@@ -252,7 +252,7 @@ class ReportParserGenerate extends ReportParserBase {
// Left Margin
if (isset($attrs['leftmargin'])) {
- if ($attrs['leftmargin'] === "0") {
+ if ($attrs['leftmargin'] === '0') {
$this->wt_report->leftmargin = 0;
} elseif (!empty($attrs['leftmargin'])) {
$this->wt_report->leftmargin = (int) $attrs['leftmargin']; // Get it as int to ignore all decimal points or text (if any text then int(0))
@@ -260,7 +260,7 @@ class ReportParserGenerate extends ReportParserBase {
}
// Right Margin
if (isset($attrs['rightmargin'])) {
- if ($attrs['rightmargin'] === "0") {
+ if ($attrs['rightmargin'] === '0') {
$this->wt_report->rightmargin = 0;
} elseif (!empty($attrs['rightmargin'])) {
$this->wt_report->rightmargin = (int) $attrs['rightmargin']; // Get it as int to ignore all decimal points or text (if any text then int(0))
@@ -268,7 +268,7 @@ class ReportParserGenerate extends ReportParserBase {
}
// Top Margin
if (isset($attrs['topmargin'])) {
- if ($attrs['topmargin'] === "0") {
+ if ($attrs['topmargin'] === '0') {
$this->wt_report->topmargin = 0;
} elseif (!empty($attrs['topmargin'])) {
$this->wt_report->topmargin = (int) $attrs['topmargin']; // Get it as int to ignore all decimal points or text (if any text then int(0))
@@ -276,7 +276,7 @@ class ReportParserGenerate extends ReportParserBase {
}
// Bottom Margin
if (isset($attrs['bottommargin'])) {
- if ($attrs['bottommargin'] === "0") {
+ if ($attrs['bottommargin'] === '0') {
$this->wt_report->bottommargin = 0;
} elseif (!empty($attrs['bottommargin'])) {
$this->wt_report->bottommargin = (int) $attrs['bottommargin']; // Get it as int to ignore all decimal points or text (if any text then int(0))
@@ -284,7 +284,7 @@ class ReportParserGenerate extends ReportParserBase {
}
// Header Margin
if (isset($attrs['headermargin'])) {
- if ($attrs['headermargin'] === "0") {
+ if ($attrs['headermargin'] === '0') {
$this->wt_report->headermargin = 0;
} elseif (!empty($attrs['headermargin'])) {
$this->wt_report->headermargin = (int) $attrs['headermargin']; // Get it as int to ignore all decimal points or text (if any text then int(0))
@@ -292,7 +292,7 @@ class ReportParserGenerate extends ReportParserBase {
}
// Footer Margin
if (isset($attrs['footermargin'])) {
- if ($attrs['footermargin'] === "0") {
+ if ($attrs['footermargin'] === '0') {
$this->wt_report->footermargin = 0;
} elseif (!empty($attrs['footermargin'])) {
$this->wt_report->footermargin = (int) $attrs['footermargin']; // Get it as int to ignore all decimal points or text (if any text then int(0))
@@ -301,10 +301,10 @@ class ReportParserGenerate extends ReportParserBase {
// Page Orientation
if (!empty($attrs['orientation'])) {
- if ($attrs['orientation'] == "landscape") {
- $this->wt_report->orientation = "landscape";
- } elseif ($attrs['orientation'] == "portrait") {
- $this->wt_report->orientation = "portrait";
+ if ($attrs['orientation'] == 'landscape') {
+ $this->wt_report->orientation = 'landscape';
+ } elseif ($attrs['orientation'] == 'portrait') {
+ $this->wt_report->orientation = 'portrait';
}
}
// Page Size
@@ -314,9 +314,9 @@ class ReportParserGenerate extends ReportParserBase {
// Show Generated By...
if (isset($attrs['showGeneratedBy'])) {
- if ($attrs['showGeneratedBy'] === "0") {
+ if ($attrs['showGeneratedBy'] === '0') {
$this->wt_report->showGenText = false;
- } elseif ($attrs['showGeneratedBy'] === "1") {
+ } elseif ($attrs['showGeneratedBy'] === '1') {
$this->wt_report->showGenText = true;
}
}
@@ -337,7 +337,7 @@ class ReportParserGenerate extends ReportParserBase {
private function headerStartHandler() {
// Clear the Header before any new elements are added
$this->wt_report->clearHeader();
- $this->wt_report->setProcessing("H");
+ $this->wt_report->setProcessing('H');
}
/**
@@ -364,14 +364,14 @@ class ReportParserGenerate extends ReportParserBase {
* XML <bodyStartHandler>
*/
private function bodyStartHandler() {
- $this->wt_report->setProcessing("B");
+ $this->wt_report->setProcessing('B');
}
/**
* XML <footerStartHandler>
*/
private function footerStartHandler() {
- $this->wt_report->setProcessing("F");
+ $this->wt_report->setProcessing('F');
}
/**
@@ -381,27 +381,27 @@ class ReportParserGenerate extends ReportParserBase {
*/
private function cellStartHandler($attrs) {
// string The text alignment of the text in this box.
- $align = "";
+ $align = '';
if (!empty($attrs['align'])) {
$align = $attrs['align'];
// RTL supported left/right alignment
- if ($align == "rightrtl") {
+ if ($align == 'rightrtl') {
if ($this->wt_report->rtl) {
- $align = "left";
+ $align = 'left';
} else {
- $align = "right";
+ $align = 'right';
}
- } elseif ($align == "leftrtl") {
+ } elseif ($align == 'leftrtl') {
if ($this->wt_report->rtl) {
- $align = "right";
+ $align = 'right';
} else {
- $align = "left";
+ $align = 'left';
}
}
}
// string The color to fill the background of this cell
- $bgcolor = "";
+ $bgcolor = '';
if (!empty($attrs['bgcolor'])) {
$bgcolor = $attrs['bgcolor'];
}
@@ -409,9 +409,9 @@ class ReportParserGenerate extends ReportParserBase {
// int Whether or not the background should be painted
$fill = 1;
if (isset($attrs['fill'])) {
- if ($attrs['fill'] === "0") {
+ if ($attrs['fill'] === '0') {
$fill = 0;
- } elseif ($attrs['fill'] === "1") {
+ } elseif ($attrs['fill'] === '1') {
$fill = 1;
}
}
@@ -419,9 +419,9 @@ class ReportParserGenerate extends ReportParserBase {
$reseth = true;
// boolean if true reset the last cell height (default true)
if (isset($attrs['reseth'])) {
- if ($attrs['reseth'] === "0") {
+ if ($attrs['reseth'] === '0') {
$reseth = false;
- } elseif ($attrs['reseth'] === "1") {
+ } elseif ($attrs['reseth'] === '1') {
$reseth = true;
}
}
@@ -432,7 +432,7 @@ class ReportParserGenerate extends ReportParserBase {
$border = $attrs['border'];
}
// string Border color in HTML code
- $bocolor = "";
+ $bocolor = '';
if (!empty($attrs['bocolor'])) {
$bocolor = $attrs['bocolor'];
}
@@ -455,36 +455,36 @@ class ReportParserGenerate extends ReportParserBase {
}
// mixed Position the left corner of this box on the page. The default is the current position.
- $left = ".";
+ $left = '.';
if (isset($attrs['left'])) {
- if ($attrs['left'] === ".") {
- $left = ".";
+ if ($attrs['left'] === '.') {
+ $left = '.';
} elseif (!empty($attrs['left'])) {
$left = (int) $attrs['left'];
- } elseif ($attrs['left'] === "0") {
+ } elseif ($attrs['left'] === '0') {
$left = 0;
}
}
// mixed Position the top corner of this box on the page. the default is the current position
- $top = ".";
+ $top = '.';
if (isset($attrs['top'])) {
- if ($attrs['top'] === ".") {
- $top = ".";
+ if ($attrs['top'] === '.') {
+ $top = '.';
} elseif (!empty($attrs['top'])) {
$top = (int) $attrs['top'];
- } elseif ($attrs['top'] === "0") {
+ } elseif ($attrs['top'] === '0') {
$top = 0;
}
}
// string The name of the Style that should be used to render the text.
- $style = "";
+ $style = '';
if (!empty($attrs['style'])) {
$style = $attrs['style'];
}
// string Text color in html code
- $tcolor = "";
+ $tcolor = '';
if (!empty($attrs['tcolor'])) {
$tcolor = $attrs['tcolor'];
}
@@ -494,19 +494,19 @@ class ReportParserGenerate extends ReportParserBase {
if (isset($attrs['newline'])) {
if (!empty($attrs['newline'])) {
$ln = (int) $attrs['newline'];
- } elseif ($attrs['newline'] === "0") {
+ } elseif ($attrs['newline'] === '0') {
$ln = 0;
}
}
- if ($align == "left") {
- $align = "L";
- } elseif ($align == "right") {
- $align = "R";
- } elseif ($align == "center") {
- $align = "C";
- } elseif ($align == "justify") {
- $align = "J";
+ if ($align == 'left') {
+ $align = 'L';
+ } elseif ($align == 'right') {
+ $align = 'R';
+ } elseif ($align == 'center') {
+ $align = 'C';
+ } elseif ($align == 'justify') {
+ $align = 'J';
}
array_push($this->print_data_stack, $this->print_data);
@@ -550,14 +550,14 @@ class ReportParserGenerate extends ReportParserBase {
* XML <PageNum /> element handler
*/
private function pageNumStartHandler() {
- $this->current_element->addText("#PAGENUM#");
+ $this->current_element->addText('#PAGENUM#');
}
/**
* XML <TotalPages /> element handler
*/
private function totalPagesStartHandler() {
- $this->current_element->addText("{{:ptp:}}");
+ $this->current_element->addText('{{:ptp:}}');
}
/**
@@ -575,8 +575,8 @@ class ReportParserGenerate extends ReportParserBase {
}
$tag = $attrs['id'];
- $tag = str_replace("@fact", $this->fact, $tag);
- $tags = explode(":", $tag);
+ $tag = str_replace('@fact', $this->fact, $tag);
+ $tags = explode(':', $tag);
$newgedrec = '';
if (count($tags) < 2) {
$tmp = GedcomRecord::getInstance($attrs['id'], $WT_TREE);
@@ -586,7 +586,7 @@ class ReportParserGenerate extends ReportParserBase {
$tgedrec = $this->gedrec;
$newgedrec = '';
foreach ($tags as $tag) {
- if (preg_match("/\\$(.+)/", $tag, $match)) {
+ if (preg_match('/\$(.+)/', $tag, $match)) {
if (isset($this->vars[$match[1]]['gedcom'])) {
$newgedrec = $this->vars[$match[1]]['gedcom'];
} else {
@@ -594,7 +594,7 @@ class ReportParserGenerate extends ReportParserBase {
$newgedrec = $tmp ? $tmp->privatizeGedcom(Auth::accessLevel($WT_TREE)) : '';
}
} else {
- if (preg_match("/@(.+)/", $tag, $match)) {
+ if (preg_match('/@(.+)/', $tag, $match)) {
$gmatch = [];
if (preg_match("/\d $match[1] @([^@]+)@/", $tgedrec, $gmatch)) {
$tmp = GedcomRecord::getInstance($gmatch[1], $WT_TREE);
@@ -605,7 +605,7 @@ class ReportParserGenerate extends ReportParserBase {
break;
}
} else {
- $temp = explode(" ", trim($tgedrec));
+ $temp = explode(' ', trim($tgedrec));
$level = $temp[0] + 1;
$newgedrec = Functions::getSubRecord($level, "$level $tag", $tgedrec);
$tgedrec = $newgedrec;
@@ -643,7 +643,7 @@ class ReportParserGenerate extends ReportParserBase {
*/
private function textBoxStartHandler($attrs) {
// string Background color code
- $bgcolor = "";
+ $bgcolor = '';
if (!empty($attrs['bgcolor'])) {
$bgcolor = $attrs['bgcolor'];
}
@@ -651,9 +651,9 @@ class ReportParserGenerate extends ReportParserBase {
// boolean Wether or not fill the background color
$fill = true;
if (isset($attrs['fill'])) {
- if ($attrs['fill'] === "0") {
+ if ($attrs['fill'] === '0') {
$fill = false;
- } elseif ($attrs['fill'] === "1") {
+ } elseif ($attrs['fill'] === '1') {
$fill = true;
}
}
@@ -661,9 +661,9 @@ class ReportParserGenerate extends ReportParserBase {
// var boolean Whether or not a border should be printed around this box. 0 = no border, 1 = border. Default is 0
$border = false;
if (isset($attrs['border'])) {
- if ($attrs['border'] === "1") {
+ if ($attrs['border'] === '1') {
$border = true;
- } elseif ($attrs['border'] === "0") {
+ } elseif ($attrs['border'] === '0') {
$border = false;
}
}
@@ -680,66 +680,66 @@ class ReportParserGenerate extends ReportParserBase {
}
// mixed Position the left corner of this box on the page. The default is the current position.
- $left = ".";
+ $left = '.';
if (isset($attrs['left'])) {
- if ($attrs['left'] === ".") {
- $left = ".";
+ if ($attrs['left'] === '.') {
+ $left = '.';
} elseif (!empty($attrs['left'])) {
$left = (int) $attrs['left'];
- } elseif ($attrs['left'] === "0") {
+ } elseif ($attrs['left'] === '0') {
$left = 0;
}
}
// mixed Position the top corner of this box on the page. the default is the current position
- $top = ".";
+ $top = '.';
if (isset($attrs['top'])) {
- if ($attrs['top'] === ".") {
- $top = ".";
+ if ($attrs['top'] === '.') {
+ $top = '.';
} elseif (!empty($attrs['top'])) {
$top = (int) $attrs['top'];
- } elseif ($attrs['top'] === "0") {
+ } elseif ($attrs['top'] === '0') {
$top = 0;
}
}
// boolean After this box is finished rendering, should the next section of text start immediately after the this box or should it start on a new line under this box. 0 = no new line, 1 = force new line. Default is 0
$newline = false;
if (isset($attrs['newline'])) {
- if ($attrs['newline'] === "1") {
+ if ($attrs['newline'] === '1') {
$newline = true;
- } elseif ($attrs['newline'] === "0") {
+ } elseif ($attrs['newline'] === '0') {
$newline = false;
}
}
// boolean
$pagecheck = true;
if (isset($attrs['pagecheck'])) {
- if ($attrs['pagecheck'] === "0") {
+ if ($attrs['pagecheck'] === '0') {
$pagecheck = false;
- } elseif ($attrs['pagecheck'] === "1") {
+ } elseif ($attrs['pagecheck'] === '1') {
$pagecheck = true;
}
}
// boolean Cell padding
$padding = true;
if (isset($attrs['padding'])) {
- if ($attrs['padding'] === "0") {
+ if ($attrs['padding'] === '0') {
$padding = false;
- } elseif ($attrs['padding'] === "1") {
+ } elseif ($attrs['padding'] === '1') {
$padding = true;
}
}
// boolean Reset this box Height
$reseth = false;
if (isset($attrs['reseth'])) {
- if ($attrs['reseth'] === "1") {
+ if ($attrs['reseth'] === '1') {
$reseth = true;
- } elseif ($attrs['reseth'] === "0") {
+ } elseif ($attrs['reseth'] === '0') {
$reseth = false;
}
}
// string Style of rendering
- $style = "";
+ $style = '';
array_push($this->print_data_stack, $this->print_data);
$this->print_data = false;
@@ -781,13 +781,13 @@ class ReportParserGenerate extends ReportParserBase {
$this->print_data = true;
// string The name of the Style that should be used to render the text.
- $style = "";
+ $style = '';
if (!empty($attrs['style'])) {
$style = $attrs['style'];
}
// string The color of the text - Keep the black color as default
- $color = "";
+ $color = '';
if (!empty($attrs['color'])) {
$color = $attrs['color'];
}
@@ -815,19 +815,19 @@ class ReportParserGenerate extends ReportParserBase {
private function getPersonNameStartHandler($attrs) {
global $WT_TREE;
- $id = "";
+ $id = '';
$match = [];
if (empty($attrs['id'])) {
- if (preg_match("/0 @(.+)@/", $this->gedrec, $match)) {
+ if (preg_match('/0 @(.+)@/', $this->gedrec, $match)) {
$id = $match[1];
}
} else {
- if (preg_match("/\\$(.+)/", $attrs['id'], $match)) {
+ if (preg_match('/\$(.+)/', $attrs['id'], $match)) {
if (isset($this->vars[$match[1]]['id'])) {
$id = $this->vars[$match[1]]['id'];
}
} else {
- if (preg_match("/@(.+)/", $attrs['id'], $match)) {
+ if (preg_match('/@(.+)/', $attrs['id'], $match)) {
$gmatch = [];
if (preg_match("/\d $match[1] @([^@]+)@/", $this->gedrec, $gmatch)) {
$id = $gmatch[1];
@@ -865,7 +865,7 @@ class ReportParserGenerate extends ReportParserBase {
if ($len > $attrs['truncate']) {
$first_letter = mb_substr($words[$i], 0, 1);
// Do not show " of nick-names
- if ($first_letter != "\"") {
+ if ($first_letter != '"') {
$name = mb_substr($words[$i], 0, 1) . '. ' . $name;
}
} else {
@@ -882,7 +882,7 @@ class ReportParserGenerate extends ReportParserBase {
);
$addname = strip_tags($addname);
if (!empty($addname)) {
- $name .= " " . $addname;
+ $name .= ' ' . $addname;
}
}
$this->current_element->addText(trim($name));
@@ -898,31 +898,31 @@ class ReportParserGenerate extends ReportParserBase {
private function gedcomValueStartHandler($attrs) {
global $WT_TREE;
- $id = "";
+ $id = '';
$match = [];
- if (preg_match("/0 @(.+)@/", $this->gedrec, $match)) {
+ if (preg_match('/0 @(.+)@/', $this->gedrec, $match)) {
$id = $match[1];
}
- if (isset($attrs['newline']) && $attrs['newline'] == "1") {
- $useBreak = "1";
+ if (isset($attrs['newline']) && $attrs['newline'] == '1') {
+ $useBreak = '1';
} else {
- $useBreak = "0";
+ $useBreak = '0';
}
$tag = $attrs['tag'];
if (!empty($tag)) {
- if ($tag == "@desc") {
+ if ($tag == '@desc') {
$value = $this->desc;
$value = trim($value);
$this->current_element->addText($value);
}
- if ($tag == "@id") {
+ if ($tag == '@id') {
$this->current_element->addText($id);
} else {
- $tag = str_replace("@fact", $this->fact, $tag);
+ $tag = str_replace('@fact', $this->fact, $tag);
if (empty($attrs['level'])) {
- $temp = explode(" ", trim($this->gedrec));
+ $temp = explode(' ', trim($this->gedrec));
$level = $temp[0];
if ($level == 0) {
$level++;
@@ -942,7 +942,7 @@ class ReportParserGenerate extends ReportParserBase {
$value = $tmp->getShortName();
break;
}
- if ($useBreak == "1") {
+ if ($useBreak == '1') {
// Insert <br> when multiple dates exist.
// This works around a TCPDF bug that incorrectly wraps RTL dates on LTR pages
$value = str_replace('(', '<br>(', $value);
@@ -978,19 +978,19 @@ class ReportParserGenerate extends ReportParserBase {
$this->repeats = [];
$this->repeat_bytes = xml_get_current_line_number($this->parser);
- $tag = "";
+ $tag = '';
if (isset($attrs['tag'])) {
$tag = $attrs['tag'];
}
if (!empty($tag)) {
- if ($tag == "@desc") {
+ if ($tag == '@desc') {
$value = $this->desc;
$value = trim($value);
$this->current_element->addText($value);
} else {
- $tag = str_replace("@fact", $this->fact, $tag);
- $tags = explode(":", $tag);
- $temp = explode(" ", trim($this->gedrec));
+ $tag = str_replace('@fact', $this->fact, $tag);
+ $tags = explode(':', $tag);
+ $temp = explode(' ', trim($this->gedrec));
$level = $temp[0];
if ($level == 0) {
$level++;
@@ -1056,7 +1056,7 @@ class ReportParserGenerate extends ReportParserBase {
}
//-- read the xml from the file
$lines = file($report);
- while (strpos($lines[$lineoffset + $this->repeat_bytes], "<RepeatTag") === false) {
+ while (strpos($lines[$lineoffset + $this->repeat_bytes], '<RepeatTag') === false) {
$lineoffset--;
}
$lineoffset++;
@@ -1065,9 +1065,9 @@ class ReportParserGenerate extends ReportParserBase {
// RepeatTag Level counter
$count = 1;
while (0 < $count) {
- if (strstr($lines[$line_nr], "<RepeatTag") !== false) {
+ if (strstr($lines[$line_nr], '<RepeatTag') !== false) {
$count++;
- } elseif (strstr($lines[$line_nr], "</RepeatTag") !== false) {
+ } elseif (strstr($lines[$line_nr], '</RepeatTag') !== false) {
$count--;
}
if (0 < $count) {
@@ -1128,12 +1128,12 @@ class ReportParserGenerate extends ReportParserBase {
$var = $this->vars[$var]['id'];
} else {
$tfact = $this->fact;
- if (($this->fact === "EVEN" || $this->fact === "FACT") && $this->type !== " ") {
+ if (($this->fact === 'EVEN' || $this->fact === 'FACT') && $this->type !== ' ') {
// Use :
// n TYPE This text if string
$tfact = $this->type;
}
- $var = str_replace(["@fact", "@desc"], [GedcomTag::getLabel($tfact), $this->desc], $var);
+ $var = str_replace(['@fact', '@desc'], [GedcomTag::getLabel($tfact), $this->desc], $var);
if (preg_match('/^I18N::number\((.+)\)$/', $var, $match)) {
$var = I18N::number($match[1]);
} elseif (preg_match('/^I18N::translate\(\'(.+)\'\)$/', $var, $match)) {
@@ -1144,7 +1144,7 @@ class ReportParserGenerate extends ReportParserBase {
}
// Check if variable is set as a date and reformat the date
if (isset($attrs['date'])) {
- if ($attrs['date'] === "1") {
+ if ($attrs['date'] === '1') {
$g = new Date($var);
$var = $g->display();
}
@@ -1170,16 +1170,16 @@ class ReportParserGenerate extends ReportParserBase {
$this->repeats = [];
$this->repeat_bytes = xml_get_current_line_number($this->parser);
- $id = "";
+ $id = '';
$match = [];
- if (preg_match("/0 @(.+)@/", $this->gedrec, $match)) {
+ if (preg_match('/0 @(.+)@/', $this->gedrec, $match)) {
$id = $match[1];
}
- $tag = "";
+ $tag = '';
if (isset($attrs['ignore'])) {
$tag .= $attrs['ignore'];
}
- if (preg_match("/\\$(.+)/", $tag, $match)) {
+ if (preg_match('/\$(.+)/', $tag, $match)) {
$tag = $this->vars[$match[1]]['id'];
}
@@ -1298,20 +1298,20 @@ class ReportParserGenerate extends ReportParserBase {
$value = $attrs['value'];
$match = [];
// Current GEDCOM record strings
- if ($value == "@ID") {
- if (preg_match("/0 @(.+)@/", $this->gedrec, $match)) {
+ if ($value == '@ID') {
+ if (preg_match('/0 @(.+)@/', $this->gedrec, $match)) {
$value = $match[1];
}
- } elseif ($value == "@fact") {
+ } elseif ($value == '@fact') {
$value = $this->fact;
- } elseif ($value == "@desc") {
+ } elseif ($value == '@desc') {
$value = $this->desc;
- } elseif ($value == "@generation") {
+ } elseif ($value == '@generation') {
$value = $this->generation;
} elseif (preg_match("/@(\w+)/", $value, $match)) {
$gmatch = [];
if (preg_match("/\d $match[1] (.+)/", $this->gedrec, $gmatch)) {
- $value = str_replace("@", "", trim($gmatch[1]));
+ $value = str_replace('@', '', trim($gmatch[1]));
}
}
if (preg_match("/\\$(\w+)/", $name, $match)) {
@@ -1321,7 +1321,7 @@ class ReportParserGenerate extends ReportParserBase {
$i = 0;
while ($i < $count) {
$t = $this->vars[$match[$i][1]]['id'];
- $value = preg_replace("/\\$" . $match[$i][1] . "/", $t, $value, 1);
+ $value = preg_replace('/\$' . $match[$i][1] . '/', $t, $value, 1);
$i++;
}
if (preg_match('/^I18N::number\((.+)\)$/', $value, $match)) {
@@ -1334,26 +1334,26 @@ class ReportParserGenerate extends ReportParserBase {
// Arithmetic functions
if (preg_match("/(\d+)\s*([\-\+\*\/])\s*(\d+)/", $value, $match)) {
switch ($match[2]) {
- case "+":
+ case '+':
$t = $match[1] + $match[3];
- $value = preg_replace("/" . $match[1] . "\s*([\-\+\*\/])\s*" . $match[3] . "/", $t, $value);
+ $value = preg_replace('/' . $match[1] . "\s*([\-\+\*\/])\s*" . $match[3] . '/', $t, $value);
break;
- case "-":
+ case '-':
$t = $match[1] - $match[3];
- $value = preg_replace("/" . $match[1] . "\s*([\-\+\*\/])\s*" . $match[3] . "/", $t, $value);
+ $value = preg_replace('/' . $match[1] . "\s*([\-\+\*\/])\s*" . $match[3] . '/', $t, $value);
break;
- case "*":
+ case '*':
$t = $match[1] * $match[3];
- $value = preg_replace("/" . $match[1] . "\s*([\-\+\*\/])\s*" . $match[3] . "/", $t, $value);
+ $value = preg_replace('/' . $match[1] . "\s*([\-\+\*\/])\s*" . $match[3] . '/', $t, $value);
break;
- case "/":
+ case '/':
$t = $match[1] / $match[3];
- $value = preg_replace("/" . $match[1] . "\s*([\-\+\*\/])\s*" . $match[3] . "/", $t, $value);
+ $value = preg_replace('/' . $match[1] . "\s*([\-\+\*\/])\s*" . $match[3] . '/', $t, $value);
break;
}
}
- if (strpos($value, "@") !== false) {
- $value = "";
+ if (strpos($value, '@') !== false) {
+ $value = '';
}
$this->vars[$name]['id'] = $value;
}
@@ -1372,28 +1372,28 @@ class ReportParserGenerate extends ReportParserBase {
$condition = $attrs['condition'];
$condition = $this->substituteVars($condition, true);
- $condition = str_replace([" LT ", " GT "], ["<", ">"], $condition);
+ $condition = str_replace([' LT ', ' GT '], ['<', '>'], $condition);
// Replace the first accurance only once of @fact:DATE or in any other combinations to the current fact, such as BIRT
- $condition = str_replace("@fact:", $this->fact . ':', $condition);
+ $condition = str_replace('@fact:', $this->fact . ':', $condition);
$match = [];
$count = preg_match_all("/@([\w:\.]+)/", $condition, $match, PREG_SET_ORDER);
$i = 0;
while ($i < $count) {
$id = $match[$i][1];
$value = '""';
- if ($id == "ID") {
- if (preg_match("/0 @(.+)@/", $this->gedrec, $match)) {
+ if ($id == 'ID') {
+ if (preg_match('/0 @(.+)@/', $this->gedrec, $match)) {
$value = "'" . $match[1] . "'";
}
- } elseif ($id === "fact") {
+ } elseif ($id === 'fact') {
$value = '"' . $this->fact . '"';
- } elseif ($id === "desc") {
+ } elseif ($id === 'desc') {
$value = '"' . addslashes($this->desc) . '"';
- } elseif ($id === "generation") {
+ } elseif ($id === 'generation') {
$value = '"' . $this->generation . '"';
} else {
- $temp = explode(" ", trim($this->gedrec));
+ $temp = explode(' ', trim($this->gedrec));
$level = $temp[0];
if ($level == 0) {
$level++;
@@ -1434,15 +1434,15 @@ class ReportParserGenerate extends ReportParserBase {
private function footnoteStartHandler($attrs) {
global $WT_TREE;
- $id = "";
- if (preg_match("/[0-9] (.+) @(.+)@/", $this->gedrec, $match)) {
+ $id = '';
+ if (preg_match('/[0-9] (.+) @(.+)@/', $this->gedrec, $match)) {
$id = $match[2];
}
$record = GedcomRecord::getInstance($id, $WT_TREE);
if ($record && $record->canShow()) {
array_push($this->print_data_stack, $this->print_data);
$this->print_data = true;
- $style = "";
+ $style = '';
if (!empty($attrs['style'])) {
$style = $attrs['style'];
}
@@ -1475,7 +1475,7 @@ class ReportParserGenerate extends ReportParserBase {
* XML <FootnoteTexts /> element
*/
private function footnoteTextsStartHandler() {
- $temp = "footnotetexts";
+ $temp = 'footnotetexts';
$this->wt_report->addElement($temp);
}
@@ -1487,7 +1487,7 @@ class ReportParserGenerate extends ReportParserBase {
global $factrec, $WT_TREE;
$match = [];
- if (preg_match("/0 @(.+)@/", $this->gedrec, $match)) {
+ if (preg_match('/0 @(.+)@/', $this->gedrec, $match)) {
$person = Individual::getInstance($match[1], $WT_TREE);
// Recorded age
if (preg_match('/\n2 AGE (.+)/', $factrec, $match)) {
@@ -1521,7 +1521,7 @@ class ReportParserGenerate extends ReportParserBase {
if (Date::compare($birth_date, $death_date) <= 0 || !$person->isDead()) {
$age = Date::getAgeGedcom($birth_date, $death_date);
// Only show calculated age if it differs from recorded age
- if ($age != '' && $age != "0d") {
+ if ($age != '' && $age != '0d') {
if ($fact_age != '' && $fact_age != $age || $fact_age == '' && $husb_age == '' && $wife_age == '' || $husb_age != '' && $person->getSex() == 'M' && $husb_age != $age || $wife_age != '' && $person->getSex() == 'F' && $wife_age != $age
) {
$value = FunctionsDate::getAgeAtEvent($age);
@@ -1564,7 +1564,7 @@ class ReportParserGenerate extends ReportParserBase {
$id = '';
$match = [];
- if (preg_match("/0 @(.+)@/", $this->gedrec, $match)) {
+ if (preg_match('/0 @(.+)@/', $this->gedrec, $match)) {
$id = $match[1];
}
@@ -1666,7 +1666,7 @@ class ReportParserGenerate extends ReportParserBase {
// mixed Position the top corner of this box on the page. the default is the current position
$top = '.';
if (isset($attrs['top'])) {
- if ($attrs['top'] === "0") {
+ if ($attrs['top'] === '0') {
$top = 0;
} elseif ($attrs['top'] === '.') {
$top = '.';
@@ -1712,7 +1712,7 @@ class ReportParserGenerate extends ReportParserBase {
if (!empty($attrs['file'])) {
$file = $attrs['file'];
}
- if ($file == "@FILE") {
+ if ($file == '@FILE') {
$match = [];
if (preg_match("/\d OBJE @(.+)@/", $this->gedrec, $match)) {
$mediaobject = Media::getInstance($match[1], $WT_TREE);
@@ -1754,7 +1754,7 @@ class ReportParserGenerate extends ReportParserBase {
}
}
} else {
- if (file_exists($file) && preg_match("/(jpg|jpeg|png|gif)$/i", $file)) {
+ if (file_exists($file) && preg_match('/(jpg|jpeg|png|gif)$/i', $file)) {
$size = getimagesize($file);
if ($width > 0 && $height == 0) {
$perc = $width / $size[0];
@@ -1779,45 +1779,45 @@ class ReportParserGenerate extends ReportParserBase {
*/
private function lineStartHandler($attrs) {
// Start horizontal position, current position (default)
- $x1 = ".";
+ $x1 = '.';
if (isset($attrs['x1'])) {
- if ($attrs['x1'] === "0") {
+ if ($attrs['x1'] === '0') {
$x1 = 0;
- } elseif ($attrs['x1'] === ".") {
- $x1 = ".";
+ } elseif ($attrs['x1'] === '.') {
+ $x1 = '.';
} elseif (!empty($attrs['x1'])) {
$x1 = (int) $attrs['x1'];
}
}
// Start vertical position, current position (default)
- $y1 = ".";
+ $y1 = '.';
if (isset($attrs['y1'])) {
- if ($attrs['y1'] === "0") {
+ if ($attrs['y1'] === '0') {
$y1 = 0;
- } elseif ($attrs['y1'] === ".") {
- $y1 = ".";
+ } elseif ($attrs['y1'] === '.') {
+ $y1 = '.';
} elseif (!empty($attrs['y1'])) {
$y1 = (int) $attrs['y1'];
}
}
// End horizontal position, maximum width (default)
- $x2 = ".";
+ $x2 = '.';
if (isset($attrs['x2'])) {
- if ($attrs['x2'] === "0") {
+ if ($attrs['x2'] === '0') {
$x2 = 0;
- } elseif ($attrs['x2'] === ".") {
- $x2 = ".";
+ } elseif ($attrs['x2'] === '.') {
+ $x2 = '.';
} elseif (!empty($attrs['x2'])) {
$x2 = (int) $attrs['x2'];
}
}
// End vertical position
- $y2 = ".";
+ $y2 = '.';
if (isset($attrs['y2'])) {
- if ($attrs['y2'] === "0") {
+ if ($attrs['y2'] === '0') {
$y2 = 0;
- } elseif ($attrs['y2'] === ".") {
- $y2 = ".";
+ } elseif ($attrs['y2'] === '.') {
+ $y2 = '.';
} elseif (!empty($attrs['y2'])) {
$y2 = (int) $attrs['y2'];
}
@@ -1848,17 +1848,17 @@ class ReportParserGenerate extends ReportParserBase {
$sortby = trim($sortby);
}
} else {
- $sortby = "NAME";
+ $sortby = 'NAME';
}
if (isset($attrs['list'])) {
$listname = $attrs['list'];
} else {
- $listname = "individual";
+ $listname = 'individual';
}
// Some filters/sorts can be applied using SQL, while others require PHP
switch ($listname) {
- case "pending":
+ case 'pending':
$rows = Database::prepare(
"SELECT xref, CASE new_gedcom WHEN '' THEN old_gedcom ELSE new_gedcom END AS gedcom" .
" FROM `##change`" . " WHERE (xref, change_id) IN (" .
@@ -1890,7 +1890,7 @@ class ReportParserGenerate extends ReportParserBase {
$sql_where .= " AND {$attr}.d_fact = :{$attr}fact";
$sql_params[$attr . 'fact'] = $match[1];
$date = new Date($match[3]);
- if ($match[2] == "LTE") {
+ if ($match[2] == 'LTE') {
$sql_where .= " AND {$attr}.d_julianday2 <= :{$attr}date";
$sql_params[$attr . 'date'] = $date->maximumJulianDay();
} else {
@@ -1907,17 +1907,17 @@ class ReportParserGenerate extends ReportParserBase {
if ($match[1] != '' || $sortby == 'NAME') {
$sql_join .= " JOIN `##name` AS {$attr} ON (n_file=i_file AND n_id=i_id)";
// Search the DB only if there is any name supplied
- if ($match[1] != "") {
- $names = explode(" ", $match[1]);
+ if ($match[1] != '') {
+ $names = explode(' ', $match[1]);
foreach ($names as $n => $name) {
$sql_where .= " AND {$attr}.n_full LIKE CONCAT('%', :{$attr}name{$n}, '%')";
$sql_params[$attr . 'name' . $n] = $name;
}
}
// Let the DB do the name sorting even when no name was entered
- if ($sortby == "NAME") {
- $sortby = "";
- $sql_order_by .= ($sql_order_by ? ", " : " ORDER BY ") . "{$attr}.n_sort";
+ if ($sortby == 'NAME') {
+ $sortby = '';
+ $sql_order_by .= ($sql_order_by ? ', ' : ' ORDER BY ') . "{$attr}.n_sort";
}
}
unset($attrs[$attr]); // This filter has been fully processed
@@ -1967,7 +1967,7 @@ class ReportParserGenerate extends ReportParserBase {
$sql_where .= " AND {$attr}.d_fact = :{$attr}fact";
$sql_params[$attr . 'fact'] = $match[1];
$date = new Date($match[3]);
- if ($match[2] == "LTE") {
+ if ($match[2] == 'LTE') {
$sql_where .= " AND {$attr}.d_julianday2 <= :{$attr}date";
$sql_params[$attr . 'date'] = $date->maximumJulianDay();
} else {
@@ -1975,8 +1975,8 @@ class ReportParserGenerate extends ReportParserBase {
$sql_params[$attr . 'date'] = $date->minimumJulianDay();
}
if ($sortby == $match[1]) {
- $sortby = "";
- $sql_order_by .= ($sql_order_by ? ", " : " ORDER BY ") . "{$attr}.d_julianday1";
+ $sortby = '';
+ $sql_order_by .= ($sql_order_by ? ', ' : ' ORDER BY ') . "{$attr}.d_julianday1";
}
unset($attrs[$attr]); // This filter has been fully processed
} elseif (preg_match('/^REGEXP \/(.+)\//', $value, $match)) {
@@ -1989,17 +1989,17 @@ class ReportParserGenerate extends ReportParserBase {
if ($match[1] != '' || $sortby == 'NAME') {
$sql_join .= " JOIN `##name` AS {$attr} ON n_file = f_file AND n_id IN (f_husb, f_wife)";
// Search the DB only if there is any name supplied
- if ($match[1] != "") {
- $names = explode(" ", $match[1]);
+ if ($match[1] != '') {
+ $names = explode(' ', $match[1]);
foreach ($names as $n => $name) {
$sql_where .= " AND {$attr}.n_full LIKE CONCAT('%', :{$attr}name{$n}, '%')";
$sql_params[$attr . 'name' . $n] = $name;
}
}
// Let the DB do the name sorting even when no name was entered
- if ($sortby == "NAME") {
- $sortby = "";
- $sql_order_by .= ($sql_order_by ? ", " : " ORDER BY ") . "{$attr}.n_sort";
+ if ($sortby == 'NAME') {
+ $sortby = '';
+ $sql_order_by .= ($sql_order_by ? ', ' : ' ORDER BY ') . "{$attr}.n_sort";
}
}
unset($attrs[$attr]); // This filter has been fully processed
@@ -2043,17 +2043,17 @@ class ReportParserGenerate extends ReportParserBase {
if (preg_match("/@(\w+)/", $condition, $match)) {
$id = $match[1];
$value = "''";
- if ($id == "ID") {
- if (preg_match("/0 @(.+)@/", $this->gedrec, $match)) {
+ if ($id == 'ID') {
+ if (preg_match('/0 @(.+)@/', $this->gedrec, $match)) {
$value = "'" . $match[1] . "'";
}
- } elseif ($id == "fact") {
+ } elseif ($id == 'fact') {
$value = "'" . $this->fact . "'";
- } elseif ($id == "desc") {
+ } elseif ($id == 'desc') {
$value = "'" . $this->desc . "'";
} else {
if (preg_match("/\d $id (.+)/", $this->gedrec, $match)) {
- $value = "'" . str_replace("@", "", trim($match[1])) . "'";
+ $value = "'" . str_replace('@', '', trim($match[1])) . "'";
}
}
$condition = preg_replace("/@$id/", $value, $condition);
@@ -2068,8 +2068,8 @@ class ReportParserGenerate extends ReportParserBase {
$val = trim($val);
}
if ($val) {
- $searchstr = "";
- $tags = explode(":", $tag);
+ $searchstr = '';
+ $tags = explode(':', $tag);
//-- only limit to a level number if we are specifically looking at a level
if (count($tags) > 1) {
$level = 1;
@@ -2078,22 +2078,22 @@ class ReportParserGenerate extends ReportParserBase {
$searchstr .= "[^\n]*(\n[2-9][^\n]*)*\n";
}
//-- search for both EMAIL and _EMAIL... silly double gedcom standard
- if ($t == "EMAIL" || $t == "_EMAIL") {
- $t = "_?EMAIL";
+ if ($t == 'EMAIL' || $t == '_EMAIL') {
+ $t = '_?EMAIL';
}
- $searchstr .= $level . " " . $t;
+ $searchstr .= $level . ' ' . $t;
$level++;
}
} else {
- if ($tag == "EMAIL" || $tag == "_EMAIL") {
- $tag = "_?EMAIL";
+ if ($tag == 'EMAIL' || $tag == '_EMAIL') {
+ $tag = '_?EMAIL';
}
$t = $tag;
- $searchstr = "1 " . $tag;
+ $searchstr = '1 ' . $tag;
}
switch ($expr) {
- case "CONTAINS":
- if ($t == "PLAC") {
+ case 'CONTAINS':
+ if ($t == 'PLAC') {
$searchstr .= "[^\n]*[, ]*" . $val;
} else {
$searchstr .= "[^\n]*" . $val;
@@ -2101,7 +2101,7 @@ class ReportParserGenerate extends ReportParserBase {
$filters[] = $searchstr;
break;
default:
- $filters2[] = ["tag" => $tag, "expr" => $expr, "val" => $val];
+ $filters2[] = ['tag' => $tag, 'expr' => $expr, 'val' => $val];
break;
}
}
@@ -2113,7 +2113,7 @@ class ReportParserGenerate extends ReportParserBase {
if ($filters) {
foreach ($this->list as $key => $record) {
foreach ($filters as $filter) {
- if (!preg_match("/" . $filter . "/i", $record->privatizeGedcom(Auth::accessLevel($WT_TREE)))) {
+ if (!preg_match('/' . $filter . '/i', $record->privatizeGedcom(Auth::accessLevel($WT_TREE)))) {
unset($this->list[$key]);
break;
}
@@ -2132,22 +2132,22 @@ class ReportParserGenerate extends ReportParserBase {
$expr = $filter['expr'];
$val = $filter['val'];
if ($val == "''") {
- $val = "";
+ $val = '';
}
- $tags = explode(":", $tag);
+ $tags = explode(':', $tag);
$t = end($tags);
$v = $this->getGedcomValue($tag, 1, $grec);
//-- check for EMAIL and _EMAIL (silly double gedcom standard :P)
- if ($t == "EMAIL" && empty($v)) {
- $tag = str_replace("EMAIL", "_EMAIL", $tag);
- $tags = explode(":", $tag);
+ if ($t == 'EMAIL' && empty($v)) {
+ $tag = str_replace('EMAIL', '_EMAIL', $tag);
+ $tags = explode(':', $tag);
$t = end($tags);
$v = Functions::getSubRecord(1, $tag, $grec);
}
switch ($expr) {
- case "GTE":
- if ($t == "DATE") {
+ case 'GTE':
+ if ($t == 'DATE') {
$date1 = new Date($v);
$date2 = new Date($val);
$keep = (Date::compare($date1, $date2) >= 0);
@@ -2155,8 +2155,8 @@ class ReportParserGenerate extends ReportParserBase {
$keep = true;
}
break;
- case "LTE":
- if ($t == "DATE") {
+ case 'LTE':
+ if ($t == 'DATE') {
$date1 = new Date($v);
$date2 = new Date($val);
$keep = (Date::compare($date1, $date2) <= 0);
@@ -2227,7 +2227,7 @@ class ReportParserGenerate extends ReportParserBase {
}
//-- read the xml from the file
$lines = file($report);
- while ((strpos($lines[$lineoffset + $this->repeat_bytes], "<List") === false) && (($lineoffset + $this->repeat_bytes) > 0)) {
+ while ((strpos($lines[$lineoffset + $this->repeat_bytes], '<List') === false) && (($lineoffset + $this->repeat_bytes) > 0)) {
$lineoffset--;
}
$lineoffset++;
@@ -2236,9 +2236,9 @@ class ReportParserGenerate extends ReportParserBase {
// List Level counter
$count = 1;
while (0 < $count) {
- if (strpos($lines[$line_nr], "<List") !== false) {
+ if (strpos($lines[$line_nr], '<List') !== false) {
$count++;
- } elseif (strpos($lines[$line_nr], "</List") !== false) {
+ } elseif (strpos($lines[$line_nr], '</List') !== false) {
$count--;
}
if (0 < $count) {
@@ -2248,7 +2248,7 @@ class ReportParserGenerate extends ReportParserBase {
}
// No need to drag this
unset($lines);
- $reportxml .= "</tempdoc>";
+ $reportxml .= '</tempdoc>';
// Save original values
array_push($this->parser_stack, $this->parser);
$oldgedrec = $this->gedrec;
@@ -2294,7 +2294,7 @@ class ReportParserGenerate extends ReportParserBase {
if ($this->list_private == 0) {
$this->current_element->addText($this->list_total);
} else {
- $this->current_element->addText(($this->list_total - $this->list_private) . " / " . $this->list_total);
+ $this->current_element->addText(($this->list_total - $this->list_private) . ' / ' . $this->list_total);
}
}
@@ -2311,7 +2311,7 @@ class ReportParserGenerate extends ReportParserBase {
return;
}
- $sortby = "NAME";
+ $sortby = 'NAME';
if (isset($attrs['sortby'])) {
$sortby = $attrs['sortby'];
}
@@ -2325,11 +2325,11 @@ class ReportParserGenerate extends ReportParserBase {
if (isset($attrs['maxgen'])) {
$maxgen = $attrs['maxgen'];
}
- if ($maxgen == "*") {
+ if ($maxgen == '*') {
$maxgen = -1;
}
- $group = "child-family";
+ $group = 'child-family';
if (isset($attrs['group'])) {
$group = $attrs['group'];
}
@@ -2338,7 +2338,7 @@ class ReportParserGenerate extends ReportParserBase {
$group = trim($group);
}
- $id = "";
+ $id = '';
if (isset($attrs['id'])) {
$id = $attrs['id'];
}
@@ -2352,7 +2352,7 @@ class ReportParserGenerate extends ReportParserBase {
if (!empty($person)) {
$this->list[$id] = $person;
switch ($group) {
- case "child-family":
+ case 'child-family':
foreach ($person->getChildFamilies() as $family) {
$husband = $family->getHusband();
$wife = $family->getWife();
@@ -2370,7 +2370,7 @@ class ReportParserGenerate extends ReportParserBase {
}
}
break;
- case "spouse-family":
+ case 'spouse-family':
foreach ($person->getSpouseFamilies() as $family) {
$husband = $family->getHusband();
$wife = $family->getWife();
@@ -2388,17 +2388,17 @@ class ReportParserGenerate extends ReportParserBase {
}
}
break;
- case "direct-ancestors":
+ case 'direct-ancestors':
$this->addAncestors($this->list, $id, false, $maxgen);
break;
- case "ancestors":
+ case 'ancestors':
$this->addAncestors($this->list, $id, true, $maxgen);
break;
- case "descendants":
+ case 'descendants':
$this->list[$id]->generation = 1;
$this->addDescendancy($this->list, $id, false, $maxgen);
break;
- case "all":
+ case 'all':
$this->addAncestors($this->list, $id, true, $maxgen);
$this->addDescendancy($this->list, $id, true, $maxgen);
break;
@@ -2458,7 +2458,7 @@ class ReportParserGenerate extends ReportParserBase {
}
//-- read the xml from the file
$lines = file($report);
- while ((strpos($lines[$lineoffset + $this->repeat_bytes], "<Relatives") === false) && (($lineoffset + $this->repeat_bytes) > 0)) {
+ while ((strpos($lines[$lineoffset + $this->repeat_bytes], '<Relatives') === false) && (($lineoffset + $this->repeat_bytes) > 0)) {
$lineoffset--;
}
$lineoffset++;
@@ -2467,9 +2467,9 @@ class ReportParserGenerate extends ReportParserBase {
// Relatives Level counter
$count = 1;
while (0 < $count) {
- if (strpos($lines[$line_nr], "<Relatives") !== false) {
+ if (strpos($lines[$line_nr], '<Relatives') !== false) {
$count++;
- } elseif (strpos($lines[$line_nr], "</Relatives") !== false) {
+ } elseif (strpos($lines[$line_nr], '</Relatives') !== false) {
$count--;
}
if (0 < $count) {
@@ -2500,7 +2500,7 @@ class ReportParserGenerate extends ReportParserBase {
xml_set_character_data_handler($repeat_parser, [$this, 'characterData']);
if (!xml_parse($repeat_parser, $reportxml, true)) {
- throw new \DomainException(sprintf("RelativesEHandler XML error: %s at line %d", xml_error_string(xml_get_error_code($repeat_parser)), xml_get_current_line_number($repeat_parser)));
+ throw new \DomainException(sprintf('RelativesEHandler XML error: %s at line %d', xml_error_string(xml_get_error_code($repeat_parser)), xml_get_current_line_number($repeat_parser)));
}
xml_parser_free($repeat_parser);
}
@@ -2527,7 +2527,7 @@ class ReportParserGenerate extends ReportParserBase {
* Has to be placed in an element (header, pageheader, body or footer)
*/
private function newPageStartHandler() {
- $temp = "addpage";
+ $temp = 'addpage';
$this->wt_report->addElement($temp);
}
@@ -2538,7 +2538,7 @@ class ReportParserGenerate extends ReportParserBase {
* @param array[] $attrs an array of key value pairs for the attributes
*/
private function htmlStartHandler($tag, $attrs) {
- if ($tag === "tempdoc") {
+ if ($tag === 'tempdoc') {
return;
}
array_push($this->wt_report_stack, $this->wt_report);
@@ -2555,7 +2555,7 @@ class ReportParserGenerate extends ReportParserBase {
* @param string $tag
*/
private function htmlEndHandler($tag) {
- if ($tag === "tempdoc") {
+ if ($tag === 'tempdoc') {
return;
}
@@ -2754,10 +2754,10 @@ class ReportParserGenerate extends ReportParserBase {
$subrec = Functions::getSubRecord($level, "$level $t", $lastsubrec);
}
if (empty($subrec)) {
- if ($t == "TITL") {
+ if ($t == 'TITL') {
$subrec = Functions::getSubRecord($level, "$level ABBR", $lastsubrec);
if (!empty($subrec)) {
- $t = "ABBR";
+ $t = 'ABBR';
}
}
if (empty($subrec)) {
@@ -2791,14 +2791,14 @@ class ReportParserGenerate extends ReportParserBase {
$value = $match[1];
}
}
- if ($level != 0 || $t != "NOTE") {
+ if ($level != 0 || $t != 'NOTE') {
$value .= Functions::getCont($level + 1, $subrec);
}
return $value;
}
- return "";
+ return '';
}
/**
diff --git a/app/Report/ReportParserSetup.php b/app/Report/ReportParserSetup.php
index 100e759870..6bd7bba48f 100644
--- a/app/Report/ReportParserSetup.php
+++ b/app/Report/ReportParserSetup.php
@@ -45,8 +45,8 @@ class ReportParserSetup extends ReportParserBase {
protected function reportStartHandler($attrs) {
$access = Auth::PRIV_PRIVATE;
if (isset($attrs['access'])) {
- if (isset($$attrs["access"])) {
- $access = $$attrs["access"];
+ if (isset($$attrs['access'])) {
+ $access = $$attrs['access'];
}
}
$this->data['access'] = $access;
diff --git a/app/Report/ReportPdf.php b/app/Report/ReportPdf.php
index 749bb5953c..f527882179 100644
--- a/app/Report/ReportPdf.php
+++ b/app/Report/ReportPdf.php
@@ -64,7 +64,7 @@ class ReportPdf extends ReportBase {
$this->pdf = new ReportTcpdf($this->orientation, parent::UNITS, [
$this->pagew,
$this->pageh,
- ], self::UNICODE, "UTF-8", self::DISK_CACHE);
+ ], self::UNICODE, 'UTF-8', self::DISK_CACHE);
// Setup the PDF margins
$this->pdf->SetMargins($this->leftmargin, $this->topmargin, $this->rightmargin);
@@ -82,9 +82,9 @@ class ReportPdf extends ReportBase {
// Only admin should see the version number
$appversion = WT_WEBTREES;
if (Auth::isAdmin()) {
- $appversion .= " " . WT_VERSION;
+ $appversion .= ' ' . WT_VERSION;
}
- $this->pdf->SetCreator($appversion . " (" . parent::WT_URL . ")");
+ $this->pdf->SetCreator($appversion . ' (' . parent::WT_URL . ')');
// Not implemented yet - ReportBase::setup()
$this->pdf->SetAuthor($this->rauthor);
$this->pdf->SetTitle($this->title);
@@ -95,7 +95,7 @@ class ReportPdf extends ReportBase {
if ($this->showGenText) {
// The default style name for Generated by.... is 'genby'
- $element = new ReportPdfCell(0, 10, 0, "C", "", "genby", 1, ".", ".", 0, 0, "", "", true);
+ $element = new ReportPdfCell(0, 10, 0, 'C', '', 'genby', 1, '.', '.', 0, 0, '', '', true);
$element->addText($this->generatedby);
$element->setUrl(parent::WT_URL);
$this->pdf->addFooter($element);
@@ -110,11 +110,11 @@ class ReportPdf extends ReportBase {
* @return int
*/
public function addElement($element) {
- if ($this->processing == "B") {
+ if ($this->processing == 'B') {
return $this->pdf->addBody($element);
- } elseif ($this->processing == "H") {
+ } elseif ($this->processing == 'H') {
return $this->pdf->addHeader($element);
- } elseif ($this->processing == "F") {
+ } elseif ($this->processing == 'F') {
return $this->pdf->addFooter($element);
}
diff --git a/app/Report/ReportPdfCell.php b/app/Report/ReportPdfCell.php
index 0ab131e001..3560a65a19 100644
--- a/app/Report/ReportPdfCell.php
+++ b/app/Report/ReportPdfCell.php
@@ -32,7 +32,7 @@ class ReportPdfCell extends ReportBaseCell {
if (($renderer->getCurrentStyle()) != ($this->styleName)) {
$renderer->setCurrentStyle($this->styleName);
}
- $temptext = str_replace("#PAGENUM#", $renderer->PageNo(), $this->text);
+ $temptext = str_replace('#PAGENUM#', $renderer->PageNo(), $this->text);
// underline «title» part of Source item
$temptext = str_replace(['«', '»'], ['<u>', '</u>'], $temptext);
$match = [];
@@ -40,7 +40,7 @@ class ReportPdfCell extends ReportBaseCell {
if ($this->fill == 1) {
if (!empty($this->bgcolor)) {
// HTML color to RGB
- if (preg_match("/#?(..)(..)(..)/", $this->bgcolor, $match)) {
+ if (preg_match('/#?(..)(..)(..)/', $this->bgcolor, $match)) {
$r = hexdec($match[1]);
$g = hexdec($match[2]);
$b = hexdec($match[3]);
@@ -54,7 +54,7 @@ class ReportPdfCell extends ReportBaseCell {
// Paint the Border color if set
if (!empty($this->bocolor)) {
// HTML color to RGB
- if (preg_match("/#?(..)(..)(..)/", $this->bocolor, $match)) {
+ if (preg_match('/#?(..)(..)(..)/', $this->bocolor, $match)) {
$r = hexdec($match[1]);
$g = hexdec($match[2]);
$b = hexdec($match[3]);
@@ -62,7 +62,7 @@ class ReportPdfCell extends ReportBaseCell {
}
}
// Paint the text color or they might use inherited colors by the previous function
- if (preg_match("/#?(..)(..)(..)/", $this->tcolor, $match)) {
+ if (preg_match('/#?(..)(..)(..)/', $this->tcolor, $match)) {
$r = hexdec($match[1]);
$g = hexdec($match[2]);
$b = hexdec($match[3]);
@@ -72,7 +72,7 @@ class ReportPdfCell extends ReportBaseCell {
}
// If current position (left)
- if ($this->left == ".") {
+ if ($this->left == '.') {
$cX = $renderer->GetX();
} // For static position add margin (also updates X)
else {
@@ -84,7 +84,7 @@ class ReportPdfCell extends ReportBaseCell {
$this->width = $renderer->getRemainingWidthPDF();
}
// For current position
- if ($this->top == ".") {
+ if ($this->top == '.') {
$this->top = $renderer->GetY();
} else {
$renderer->SetY($this->top);
@@ -109,7 +109,7 @@ class ReportPdfCell extends ReportBaseCell {
if ($renderer->checkPageBreakPDF($cHT)) {
$this->top = $renderer->GetY();
}
- $temptext = FunctionsRtl::spanLtrRtl($temptext, "BOTH");
+ $temptext = FunctionsRtl::spanLtrRtl($temptext, 'BOTH');
}
// HTML ready - last value is true
$renderer->MultiCell(
diff --git a/app/Report/ReportPdfFootnote.php b/app/Report/ReportPdfFootnote.php
index 3b27d2c040..e03c060462 100644
--- a/app/Report/ReportPdfFootnote.php
+++ b/app/Report/ReportPdfFootnote.php
@@ -25,7 +25,7 @@ class ReportPdfFootnote extends ReportBaseFootnote {
* @param ReportTcpdf $renderer
*/
public function render($renderer) {
- $renderer->setCurrentStyle("footnotenum");
+ $renderer->setCurrentStyle('footnotenum');
$renderer->Write($renderer->getCurrentStyleHeight(), $this->numText, $this->addlink); //source link numbers after name
}
@@ -39,15 +39,15 @@ class ReportPdfFootnote extends ReportBaseFootnote {
if ($pdf->getCurrentStyle() != $this->styleName) {
$pdf->setCurrentStyle($this->styleName);
}
- $temptext = str_replace("#PAGENUM#", $pdf->PageNo(), $this->text);
+ $temptext = str_replace('#PAGENUM#', $pdf->PageNo(), $this->text);
// Set the link to this y/page position
$pdf->SetLink($this->addlink, -1, -1);
// Print first the source number
// working
if ($pdf->getRTL()) {
- $pdf->writeHTML("<span> ." . $this->num . "</span>", false, false, false, false, "");
+ $pdf->writeHTML('<span> .' . $this->num . '</span>', false, false, false, false, '');
} else {
- $temptext = "<span>" . $this->num . ". </span>" . $temptext;
+ $temptext = '<span>' . $this->num . '. </span>' . $temptext;
}
// underline «title» part of Source item
$temptext = str_replace(['«', '»'], ['<u>', '</u>'], $temptext);
@@ -75,7 +75,7 @@ class ReportPdfFootnote extends ReportBaseFootnote {
*/
public function getWidth($pdf) {
// Setup the style name, a font must be selected to calculate the width
- $pdf->setCurrentStyle("footnotenum");
+ $pdf->setCurrentStyle('footnotenum');
// Check for the largest font size in the box
$fsize = $pdf->getCurrentStyleHeight();
@@ -106,22 +106,22 @@ class ReportPdfFootnote extends ReportBaseFootnote {
$lw = ceil($pdf->GetStringWidth($line));
// If the line has to be wraped
if ($lw >= $wrapWidthRemaining) {
- $words = explode(" ", $line);
+ $words = explode(' ', $line);
$addspace = count($words);
$lw = 0;
foreach ($words as $word) {
$addspace--;
- $lw += ceil($pdf->GetStringWidth($word . " "));
+ $lw += ceil($pdf->GetStringWidth($word . ' '));
if ($lw < $wrapWidthRemaining) {
$newtext .= $word;
if ($addspace != 0) {
- $newtext .= " ";
+ $newtext .= ' ';
}
} else {
- $lw = $pdf->GetStringWidth($word . " ");
+ $lw = $pdf->GetStringWidth($word . ' ');
$newtext .= "\n$word";
if ($addspace != 0) {
- $newtext .= " ";
+ $newtext .= ' ';
}
// Reset the wrap width to the cell width
$wrapWidthRemaining = $this->wrapWidthCell;
diff --git a/app/Report/ReportPdfHtml.php b/app/Report/ReportPdfHtml.php
index e15e3b3702..02e37e023a 100644
--- a/app/Report/ReportPdfHtml.php
+++ b/app/Report/ReportPdfHtml.php
@@ -37,9 +37,9 @@ class ReportPdfHtml extends ReportBaseHtml {
$this->text = $this->getStart() . $this->text;
foreach ($this->elements as $element) {
- if (is_string($element) && $element == "footnotetexts") {
+ if (is_string($element) && $element == 'footnotetexts') {
$renderer->Footnotes();
- } elseif (is_string($element) && $element == "addpage") {
+ } elseif (is_string($element) && $element == 'addpage') {
$renderer->newPage();
} elseif ($element instanceof ReportBaseHtml) {
$element->render($renderer, true);
diff --git a/app/Report/ReportPdfImage.php b/app/Report/ReportPdfImage.php
index ef899306f3..faa1d95cc9 100644
--- a/app/Report/ReportPdfImage.php
+++ b/app/Report/ReportPdfImage.php
@@ -34,14 +34,14 @@ class ReportPdfImage extends ReportBaseImage {
$curx = $renderer->GetX();
// If current position (left)set "."
- if ($this->x == ".") {
+ if ($this->x == '.') {
$this->x = $renderer->GetX();
} // For static position add margin
else {
$this->x = $renderer->addMarginX($this->x);
$renderer->SetX($curx);
}
- if ($this->y == ".") {
+ if ($this->y == '.') {
//-- first check for a collision with the last picture
if (isset($lastpicbottom)) {
if (($renderer->PageNo() == $lastpicpage) && ($lastpicbottom >= $renderer->GetY()) && ($this->x >= $lastpicleft) && ($this->x <= $lastpicright)
@@ -60,8 +60,8 @@ class ReportPdfImage extends ReportBaseImage {
$this->y,
$this->width,
$this->height,
- "",
- "",
+ '',
+ '',
$this->line,
false,
72,
@@ -74,8 +74,8 @@ class ReportPdfImage extends ReportBaseImage {
$this->y,
$this->width,
$this->height,
- "",
- "",
+ '',
+ '',
$this->line,
false,
72,
@@ -88,7 +88,7 @@ class ReportPdfImage extends ReportBaseImage {
$lastpicright = $this->x + $this->width;
$lastpicbottom = $this->y + $this->height;
// Setup for the next line
- if ($this->line == "N") {
+ if ($this->line == 'N') {
$renderer->SetY($lastpicbottom);
}
}
diff --git a/app/Report/ReportPdfLine.php b/app/Report/ReportPdfLine.php
index b40839c5be..5c13641b53 100644
--- a/app/Report/ReportPdfLine.php
+++ b/app/Report/ReportPdfLine.php
@@ -25,16 +25,16 @@ class ReportPdfLine extends ReportBaseLine {
* @param ReportTcpdf $renderer
*/
public function render($renderer) {
- if ($this->x1 == ".") {
+ if ($this->x1 == '.') {
$this->x1 = $renderer->GetX();
}
- if ($this->y1 == ".") {
+ if ($this->y1 == '.') {
$this->y1 = $renderer->GetY();
}
- if ($this->x2 == ".") {
+ if ($this->x2 == '.') {
$this->x2 = $renderer->getMaxLineWidth();
}
- if ($this->y2 == ".") {
+ if ($this->y2 == '.') {
$this->y2 = $renderer->GetY();
}
if ($renderer->getRTL()) {
diff --git a/app/Report/ReportPdfText.php b/app/Report/ReportPdfText.php
index 04b9ae617c..77564348e1 100644
--- a/app/Report/ReportPdfText.php
+++ b/app/Report/ReportPdfText.php
@@ -31,13 +31,13 @@ class ReportPdfText extends ReportBaseText {
if ($renderer->getCurrentStyle() != $this->styleName) {
$renderer->setCurrentStyle($this->styleName);
}
- $temptext = str_replace("#PAGENUM#", $renderer->PageNo(), $this->text);
+ $temptext = str_replace('#PAGENUM#', $renderer->PageNo(), $this->text);
// underline «title» part of Source item
$temptext = str_replace(['«', '»'], ['<u>', '</u>'], $temptext);
// Paint the text color or they might use inherited colors by the previous function
$match = [];
- if (preg_match("/#?(..)(..)(..)/", $this->color, $match)) {
+ if (preg_match('/#?(..)(..)(..)/', $this->color, $match)) {
$r = hexdec($match[1]);
$g = hexdec($match[2]);
$b = hexdec($match[3]);
@@ -45,7 +45,7 @@ class ReportPdfText extends ReportBaseText {
} else {
$renderer->SetTextColor(0, 0, 0);
}
- $temptext = FunctionsRtl::spanLtrRtl($temptext, "BOTH");
+ $temptext = FunctionsRtl::spanLtrRtl($temptext, 'BOTH');
$temptext = str_replace(
['<br><span dir="rtl" >', '<br><span dir="ltr" >', '> ', ' <'],
['<span dir="rtl" ><br>', '<span dir="ltr" ><br>', '>&nbsp;', '&nbsp;<'],
@@ -57,7 +57,7 @@ class ReportPdfText extends ReportBaseText {
false,
true,
false,
- ""
+ ''
); //change height - line break etc. - the form is mirror on rtl pages
// Reset the text color to black or it will be inherited
$renderer->SetTextColor(0, 0, 0);
@@ -104,7 +104,7 @@ class ReportPdfText extends ReportBaseText {
// but floor the $wrapWidthRemaining first to keep it bugfree!
$wrapWidthRemaining = (int) ($this->wrapWidthRemaining);
if ($lw >= $wrapWidthRemaining || $lfct > 1) {
- $newtext = "";
+ $newtext = '';
$lines = explode("\n", $this->text);
// Go throught the text line by line
foreach ($lines as $line) {
@@ -112,22 +112,22 @@ class ReportPdfText extends ReportBaseText {
$lw = $pdf->GetStringWidth($line);
// If the line has to be wraped
if ($lw >= $wrapWidthRemaining) {
- $words = explode(" ", $line);
+ $words = explode(' ', $line);
$addspace = count($words);
$lw = 0;
foreach ($words as $word) {
$addspace--;
- $lw += $pdf->GetStringWidth($word . " ");
+ $lw += $pdf->GetStringWidth($word . ' ');
if ($lw <= $wrapWidthRemaining) {
$newtext .= $word;
if ($addspace != 0) {
- $newtext .= " ";
+ $newtext .= ' ';
}
} else {
- $lw = $pdf->GetStringWidth($word . " ");
+ $lw = $pdf->GetStringWidth($word . ' ');
$newtext .= "\n$word";
if ($addspace != 0) {
- $newtext .= " ";
+ $newtext .= ' ';
}
// Reset the wrap width to the cell width
$wrapWidthRemaining = $this->wrapWidthCell;
diff --git a/app/Report/ReportPdfTextbox.php b/app/Report/ReportPdfTextbox.php
index b9c589a114..501986c1c3 100644
--- a/app/Report/ReportPdfTextbox.php
+++ b/app/Report/ReportPdfTextbox.php
@@ -29,7 +29,7 @@ class ReportPdfTextbox extends ReportBaseTextbox {
public function render($renderer) {
$newelements = [];
- $lastelement = "";
+ $lastelement = '';
$footnote_element = [];
// Element counter
$cE = count($this->elements);
@@ -50,7 +50,7 @@ class ReportPdfTextbox extends ReportBaseTextbox {
} else {
// Checking if the Text has the same style
if ($element->getStyleName() == $lastelement->getStyleName()) {
- $lastelement->addText(str_replace("\n", "<br>", $element->getValue()));
+ $lastelement->addText(str_replace("\n", '<br>', $element->getValue()));
} elseif (!empty($lastelement)) {
$newelements[] = $lastelement;
$lastelement = $element;
@@ -68,7 +68,7 @@ class ReportPdfTextbox extends ReportBaseTextbox {
// Save the Footnote with it’s link number as key for sorting later
$footnote_element[$element->num] = $element;
} //-- do not keep empty footnotes
- elseif (!($element instanceof ReportBaseFootnote) || trim($element->getValue()) != "") {
+ elseif (!($element instanceof ReportBaseFootnote) || trim($element->getValue()) != '') {
if (!empty($footnote_element)) {
ksort($footnote_element);
foreach ($footnote_element as $links) {
@@ -113,7 +113,7 @@ class ReportPdfTextbox extends ReportBaseTextbox {
$renderer->largestFontHeight = 0;
// If current position (left)
- if ($this->left == ".") {
+ if ($this->left == '.') {
$cX = $renderer->GetX();
} else {
// For static position add margin (returns and updates X)
@@ -121,7 +121,7 @@ class ReportPdfTextbox extends ReportBaseTextbox {
}
// If current position (top)
- if ($this->top == ".") {
+ if ($this->top == '.') {
$cY = $renderer->GetY();
} else {
$cY = $this->top;
@@ -223,16 +223,16 @@ class ReportPdfTextbox extends ReportBaseTextbox {
}
// Setup the border and background color
- $cS = ""; // Class Style
+ $cS = ''; // Class Style
if ($this->border) {
- $cS = "D";
+ $cS = 'D';
} // D or empty string: Draw (default)
$match = [];
// Fill the background
if ($this->fill) {
if (!empty($this->bgcolor)) {
- if (preg_match("/#?(..)(..)(..)/", $this->bgcolor, $match)) {
- $cS .= "F"; // F: Fill the background
+ if (preg_match('/#?(..)(..)(..)/', $this->bgcolor, $match)) {
+ $cS .= 'F'; // F: Fill the background
$r = hexdec($match[1]);
$g = hexdec($match[2]);
$b = hexdec($match[3]);
diff --git a/app/Report/ReportTcpdf.php b/app/Report/ReportTcpdf.php
index 4a628f8fb5..901f00375f 100644
--- a/app/Report/ReportTcpdf.php
+++ b/app/Report/ReportTcpdf.php
@@ -60,18 +60,18 @@ class ReportTcpdf extends TCPDF {
foreach ($this->headerElements as $element) {
if (is_object($element)) {
$element->render($this);
- } elseif (is_string($element) && $element == "footnotetexts") {
+ } elseif (is_string($element) && $element == 'footnotetexts') {
$this->footnotes();
- } elseif (is_string($element) && $element == "addpage") {
+ } elseif (is_string($element) && $element == 'addpage') {
$this->newPage();
}
}
foreach ($this->pageHeaderElements as $element) {
if (is_object($element)) {
$element->render($this);
- } elseif (is_string($element) && $element == "footnotetexts") {
+ } elseif (is_string($element) && $element == 'footnotetexts') {
$this->footnotes();
- } elseif (is_string($element) && $element == "addpage") {
+ } elseif (is_string($element) && $element == 'addpage') {
$this->newPage();
}
}
@@ -85,9 +85,9 @@ class ReportTcpdf extends TCPDF {
foreach ($this->bodyElements as $key => $element) {
if (is_object($element)) {
$element->render($this);
- } elseif (is_string($element) && $element == "footnotetexts") {
+ } elseif (is_string($element) && $element == 'footnotetexts') {
$this->footnotes();
- } elseif (is_string($element) && $element == "addpage") {
+ } elseif (is_string($element) && $element == 'addpage') {
$this->newPage();
}
// Delete used elements in hope to reduce 'some' memory usage
@@ -117,9 +117,9 @@ class ReportTcpdf extends TCPDF {
foreach ($this->footerElements as $element) {
if (is_object($element)) {
$element->render($this);
- } elseif (is_string($element) && $element == "footnotetexts") {
+ } elseif (is_string($element) && $element == 'footnotetexts') {
$this->footnotes();
- } elseif (is_string($element) && $element == "addpage") {
+ } elseif (is_string($element) && $element == 'addpage') {
$this->newPage();
}
}
diff --git a/app/Stats.php b/app/Stats.php
index 88fd0e162f..a4fc1a7951 100644
--- a/app/Stats.php
+++ b/app/Stats.php
@@ -124,7 +124,7 @@ class Stats {
isset($funcs) or $funcs = get_class_methods($this);
// Extract all tags from the provided text
- preg_match_all("/#([^#]+)(?=#)/", (string) $text, $match);
+ preg_match_all('/#([^#]+)(?=#)/', (string) $text, $match);
$tags = $match[1];
$c = count($tags);
$new_tags = []; // tag to replace
@@ -496,7 +496,7 @@ class Stats {
if (isset($params[0]) && $params[0] != '') {
$size = strtolower($params[0]);
} else {
- $size = $WT_STATS_S_CHART_X . "x" . $WT_STATS_S_CHART_Y;
+ $size = $WT_STATS_S_CHART_X . 'x' . $WT_STATS_S_CHART_Y;
}
if (isset($params[1]) && $params[1] != '') {
$color_from = strtolower($params[1]);
@@ -519,7 +519,7 @@ class Stats {
I18N::translate('With sources') . ' - ' . I18N::percentage($tot_sfam_per, 1);
$chart_title = I18N::translate('Families with sources');
- return "<img src=\"https://chart.googleapis.com/chart?cht=p3&amp;chd=e:{$chd}&chs={$size}&amp;chco={$color_from},{$color_to}&amp;chf=bg,s,ffffff00&amp;chl={$chl}\" width=\"{$sizes[0]}\" height=\"{$sizes[1]}\" alt=\"" . $chart_title . "\" title=\"" . $chart_title . "\" />";
+ return "<img src=\"https://chart.googleapis.com/chart?cht=p3&amp;chd=e:{$chd}&chs={$size}&amp;chco={$color_from},{$color_to}&amp;chf=bg,s,ffffff00&amp;chl={$chl}\" width=\"{$sizes[0]}\" height=\"{$sizes[1]}\" alt=\"" . $chart_title . '" title="' . $chart_title . '" />';
}
}
@@ -946,7 +946,7 @@ class Stats {
I18N::translate('Females') . ' - ' . $per_f . I18N::$list_separator .
I18N::translateContext('unknown people', 'Unknown') . ' - ' . $per_u;
- return "<img src=\"https://chart.googleapis.com/chart?cht=p3&amp;chd=e:{$chd}&amp;chs={$size}&amp;chco={$color_unknown},{$color_female},{$color_male}&amp;chf=bg,s,ffffff00&amp;chl={$chl}\" width=\"{$sizes[0]}\" height=\"{$sizes[1]}\" alt=\"" . $chart_title . "\" title=\"" . $chart_title . "\" />";
+ return "<img src=\"https://chart.googleapis.com/chart?cht=p3&amp;chd=e:{$chd}&amp;chs={$size}&amp;chco={$color_unknown},{$color_female},{$color_male}&amp;chf=bg,s,ffffff00&amp;chl={$chl}\" width=\"{$sizes[0]}\" height=\"{$sizes[1]}\" alt=\"" . $chart_title . '" title="' . $chart_title . '" />';
} else {
$chd = $this->arrayToExtendedEncoding([4095 * $tot_f / $tot, 4095 * $tot_m / $tot]);
$chl =
@@ -955,7 +955,7 @@ class Stats {
$chart_title = I18N::translate('Males') . ' - ' . $per_m . I18N::$list_separator .
I18N::translate('Females') . ' - ' . $per_f;
- return "<img src=\"https://chart.googleapis.com/chart?cht=p3&amp;chd=e:{$chd}&amp;chs={$size}&amp;chco={$color_female},{$color_male}&amp;chf=bg,s,ffffff00&amp;chl={$chl}\" width=\"{$sizes[0]}\" height=\"{$sizes[1]}\" alt=\"" . $chart_title . "\" title=\"" . $chart_title . "\" />";
+ return "<img src=\"https://chart.googleapis.com/chart?cht=p3&amp;chd=e:{$chd}&amp;chs={$size}&amp;chco={$color_female},{$color_male}&amp;chf=bg,s,ffffff00&amp;chl={$chl}\" width=\"{$sizes[0]}\" height=\"{$sizes[1]}\" alt=\"" . $chart_title . '" title="' . $chart_title . '" />';
}
}
@@ -1040,7 +1040,7 @@ class Stats {
if (isset($params[0]) && $params[0] != '') {
$size = strtolower($params[0]);
} else {
- $size = $WT_STATS_S_CHART_X . "x" . $WT_STATS_S_CHART_Y;
+ $size = $WT_STATS_S_CHART_X . 'x' . $WT_STATS_S_CHART_Y;
}
if (isset($params[1]) && $params[1] != '') {
$color_living = strtolower($params[1]);
@@ -1070,7 +1070,7 @@ class Stats {
$chart_title = I18N::translate('Living') . ' - ' . $per_l . I18N::$list_separator .
I18N::translate('Dead') . ' - ' . $per_d;
- return "<img src=\"https://chart.googleapis.com/chart?cht=p3&amp;chd=e:{$chd}&amp;chs={$size}&amp;chco={$color_living},{$color_dead}&amp;chf=bg,s,ffffff00&amp;chl={$chl}\" width=\"{$sizes[0]}\" height=\"{$sizes[1]}\" alt=\"" . $chart_title . "\" title=\"" . $chart_title . "\" />";
+ return "<img src=\"https://chart.googleapis.com/chart?cht=p3&amp;chd=e:{$chd}&amp;chs={$size}&amp;chco={$color_living},{$color_dead}&amp;chf=bg,s,ffffff00&amp;chl={$chl}\" width=\"{$sizes[0]}\" height=\"{$sizes[1]}\" alt=\"" . $chart_title . '" title="' . $chart_title . '" />';
}
}
@@ -1357,8 +1357,8 @@ class Stats {
}
// Build a table listing only the media types actually present in the GEDCOM
$mediaCounts = [];
- $mediaTypes = "";
- $chart_title = "";
+ $mediaTypes = '';
+ $chart_title = '';
$c = 0;
$max = 0;
$media = [];
@@ -1402,7 +1402,7 @@ class Stats {
$chd = $this->arrayToExtendedEncoding($mediaCounts);
$chl = substr($mediaTypes, 0, -1);
- return "<img src=\"https://chart.googleapis.com/chart?cht=p3&amp;chd=e:{$chd}&amp;chs={$size}&amp;chco={$color_from},{$color_to}&amp;chf=bg,s,ffffff00&amp;chl={$chl}\" width=\"{$sizes[0]}\" height=\"{$sizes[1]}\" alt=\"" . $chart_title . "\" title=\"" . $chart_title . "\" />";
+ return "<img src=\"https://chart.googleapis.com/chart?cht=p3&amp;chd=e:{$chd}&amp;chs={$size}&amp;chco={$color_from},{$color_to}&amp;chf=bg,s,ffffff00&amp;chl={$chl}\" width=\"{$sizes[0]}\" height=\"{$sizes[1]}\" alt=\"" . $chart_title . '" title="' . $chart_title . '" />';
}
/**
@@ -1457,7 +1457,7 @@ class Stats {
$result = $date->display();
break;
case 'name':
- $result = "<a href=\"" . $record->getHtmlUrl() . "\">" . $record->getFullName() . "</a>";
+ $result = '<a href="' . $record->getHtmlUrl() . '">' . $record->getFullName() . '</a>';
break;
case 'place':
$fact = GedcomRecord::getInstance($row['d_gid'], $this->tree)->getFirstFact($row['d_fact']);
@@ -1632,7 +1632,7 @@ class Stats {
I18N::init(WT_LOCALE);
switch ($chart_type) {
case 'surname_distribution_chart':
- if ($surname == "") {
+ if ($surname == '') {
$surname = $this->getCommonSurname();
}
$chart_title = I18N::translate('Surname distribution chart') . ': ' . $surname;
@@ -1722,11 +1722,11 @@ class Stats {
}
break;
}
- $chart_url = "https://chart.googleapis.com/chart?cht=t&amp;chtm=" . $chart_shows;
- $chart_url .= "&amp;chco=" . $WT_STATS_CHART_COLOR1 . "," . $WT_STATS_CHART_COLOR3 . "," . $WT_STATS_CHART_COLOR2; // country colours
- $chart_url .= "&amp;chf=bg,s,ECF5FF"; // sea colour
- $chart_url .= "&amp;chs=" . $WT_STATS_MAP_X . "x" . $WT_STATS_MAP_Y;
- $chart_url .= "&amp;chld=" . implode('', array_keys($surn_countries)) . "&amp;chd=s:";
+ $chart_url = 'https://chart.googleapis.com/chart?cht=t&amp;chtm=' . $chart_shows;
+ $chart_url .= '&amp;chco=' . $WT_STATS_CHART_COLOR1 . ',' . $WT_STATS_CHART_COLOR3 . ',' . $WT_STATS_CHART_COLOR2; // country colours
+ $chart_url .= '&amp;chf=bg,s,ECF5FF'; // sea colour
+ $chart_url .= '&amp;chs=' . $WT_STATS_MAP_X . 'x' . $WT_STATS_MAP_Y;
+ $chart_url .= '&amp;chld=' . implode('', array_keys($surn_countries)) . '&amp;chd=s:';
foreach ($surn_countries as $count) {
$chart_url .= substr(WT_GOOGLE_CHART_ENCODING, (int) ($count / max($surn_countries) * 61), 1);
}
@@ -1884,8 +1884,8 @@ class Stats {
$sql =
"SELECT SQL_CACHE FLOOR(d_year/100+1) AS century, COUNT(*) AS total FROM `##dates` " .
"WHERE " .
- "d_file={$this->tree->getTreeId()} AND " .
- "d_year<>0 AND " .
+ "d_file = {$this->tree->getTreeId()} AND " .
+ "d_year <> 0 AND " .
"d_fact='BIRT' AND " .
"d_type IN ('@#DGREGORIAN@', '@#DJULIAN@')";
} elseif ($sex) {
@@ -1920,7 +1920,7 @@ class Stats {
if (isset($params[0]) && $params[0] != '') {
$size = strtolower($params[0]);
} else {
- $size = $WT_STATS_S_CHART_X . "x" . $WT_STATS_S_CHART_Y;
+ $size = $WT_STATS_S_CHART_X . 'x' . $WT_STATS_S_CHART_Y;
}
if (isset($params[1]) && $params[1] != '') {
$color_from = strtolower($params[1]);
@@ -1941,7 +1941,7 @@ class Stats {
if ($tot == 0) {
return '';
}
- $centuries = "";
+ $centuries = '';
$counts = [];
foreach ($rows as $values) {
$counts[] = round(100 * $values['total'] / $tot, 0);
@@ -1950,7 +1950,7 @@ class Stats {
$chd = $this->arrayToExtendedEncoding($counts);
$chl = rawurlencode(substr($centuries, 0, -1));
- return "<img src=\"https://chart.googleapis.com/chart?cht=p3&amp;chd=e:{$chd}&amp;chs={$size}&amp;chco={$color_from},{$color_to}&amp;chf=bg,s,ffffff00&amp;chl={$chl}\" width=\"{$sizes[0]}\" height=\"{$sizes[1]}\" alt=\"" . I18N::translate('Births by century') . "\" title=\"" . I18N::translate('Births by century') . "\" />";
+ return "<img src=\"https://chart.googleapis.com/chart?cht=p3&amp;chd=e:{$chd}&amp;chs={$size}&amp;chco={$color_from},{$color_to}&amp;chf=bg,s,ffffff00&amp;chl={$chl}\" width=\"{$sizes[0]}\" height=\"{$sizes[1]}\" alt=\"" . I18N::translate('Births by century') . '" title="' . I18N::translate('Births by century') . '" />';
} else {
return $rows;
}
@@ -2013,7 +2013,7 @@ class Stats {
if (isset($params[0]) && $params[0] != '') {
$size = strtolower($params[0]);
} else {
- $size = $WT_STATS_S_CHART_X . "x" . $WT_STATS_S_CHART_Y;
+ $size = $WT_STATS_S_CHART_X . 'x' . $WT_STATS_S_CHART_Y;
}
if (isset($params[1]) && $params[1] != '') {
$color_from = strtolower($params[1]);
@@ -2034,7 +2034,7 @@ class Stats {
if ($tot == 0) {
return '';
}
- $centuries = "";
+ $centuries = '';
$counts = [];
foreach ($rows as $values) {
$counts[] = round(100 * $values['total'] / $tot, 0);
@@ -2043,7 +2043,7 @@ class Stats {
$chd = $this->arrayToExtendedEncoding($counts);
$chl = rawurlencode(substr($centuries, 0, -1));
- return "<img src=\"https://chart.googleapis.com/chart?cht=p3&amp;chd=e:{$chd}&amp;chs={$size}&amp;chco={$color_from},{$color_to}&amp;chf=bg,s,ffffff00&amp;chl={$chl}\" width=\"{$sizes[0]}\" height=\"{$sizes[1]}\" alt=\"" . I18N::translate('Deaths by century') . "\" title=\"" . I18N::translate('Deaths by century') . "\" />";
+ return "<img src=\"https://chart.googleapis.com/chart?cht=p3&amp;chd=e:{$chd}&amp;chs={$size}&amp;chco={$color_from},{$color_to}&amp;chf=bg,s,ffffff00&amp;chl={$chl}\" width=\"{$sizes[0]}\" height=\"{$sizes[1]}\" alt=\"" . I18N::translate('Deaths by century') . '" title="' . I18N::translate('Deaths by century') . '" />';
}
return $rows;
@@ -2271,7 +2271,7 @@ class Stats {
$result = I18N::number((int) ($row['age'] / 365.25));
break;
case 'name':
- $result = "<a href=\"" . $person->getHtmlUrl() . "\">" . $person->getFullName() . "</a>";
+ $result = '<a href="' . $person->getHtmlUrl() . '">' . $person->getFullName() . '</a>';
break;
}
@@ -2340,9 +2340,9 @@ class Stats {
$age = FunctionsDate::getAgeAtEvent($age);
if ($person->canShow()) {
if ($type == 'list') {
- $top10[] = "<li><a href=\"" . $person->getHtmlUrl() . "\">" . $person->getFullName() . "</a> (" . $age . ")" . "</li>";
+ $top10[] = '<li><a href="' . $person->getHtmlUrl() . '">' . $person->getFullName() . '</a> (' . $age . ')' . '</li>';
} else {
- $top10[] = "<a href=\"" . $person->getHtmlUrl() . "\">" . $person->getFullName() . "</a> (" . $age . ")";
+ $top10[] = '<a href="' . $person->getHtmlUrl() . '">' . $person->getFullName() . '</a> (' . $age . ')';
}
}
}
@@ -2418,9 +2418,9 @@ class Stats {
}
$age = FunctionsDate::getAgeAtEvent($age);
if ($type === 'list') {
- $top10[] = "<li><a href=\"" . $person->getHtmlUrl() . "\">" . $person->getFullName() . "</a> (" . $age . ")" . "</li>";
+ $top10[] = '<li><a href="' . $person->getHtmlUrl() . '">' . $person->getFullName() . '</a> (' . $age . ')' . '</li>';
} else {
- $top10[] = "<a href=\"" . $person->getHtmlUrl() . "\">" . $person->getFullName() . "</a> (" . $age . ")";
+ $top10[] = '<a href="' . $person->getHtmlUrl() . '">' . $person->getFullName() . '</a> (' . $age . ')';
}
}
if ($type === 'list') {
@@ -2596,7 +2596,7 @@ class Stats {
$chtt = substr_replace($title, '|', $counter[$half], 1);
}
- return '<img src="' . "https://chart.googleapis.com/chart?cht=bvg&amp;chs={$sizes[0]}x{$sizes[1]}&amp;chm=D,FF0000,2,0,3,1|N*f1*,000000,0,-1,11,1|N*f1*,000000,1,-1,11,1&amp;chf=bg,s,ffffff00|c,s,ffffff00&amp;chtt=" . rawurlencode($chtt) . "&amp;chd={$chd}&amp;chco=0000FF,FFA0CB,FF0000&amp;chbh=20,3&amp;chxt=x,x,y,y&amp;chxl=" . rawurlencode($chxl) . "&amp;chdl=" . rawurlencode(I18N::translate('Males') . '|' . I18N::translate('Females') . '|' . I18N::translate('Average age at death')) . "\" width=\"{$sizes[0]}\" height=\"{$sizes[1]}\" alt=\"" . I18N::translate('Average age related to death century') . "\" title=\"" . I18N::translate('Average age related to death century') . "\" />";
+ return '<img src="' . "https://chart.googleapis.com/chart?cht=bvg&amp;chs={$sizes[0]}x{$sizes[1]}&amp;chm=D,FF0000,2,0,3,1|N*f1*,000000,0,-1,11,1|N*f1*,000000,1,-1,11,1&amp;chf=bg,s,ffffff00|c,s,ffffff00&amp;chtt=" . rawurlencode($chtt) . "&amp;chd={$chd}&amp;chco=0000FF,FFA0CB,FF0000&amp;chbh=20,3&amp;chxt=x,x,y,y&amp;chxl=" . rawurlencode($chxl) . '&amp;chdl=' . rawurlencode(I18N::translate('Males') . '|' . I18N::translate('Females') . '|' . I18N::translate('Average age at death')) . "\" width=\"{$sizes[0]}\" height=\"{$sizes[1]}\" alt=\"" . I18N::translate('Average age related to death century') . '" title="' . I18N::translate('Average age related to death century') . '" />';
} else {
$sex_search = '';
$years = '';
@@ -2627,7 +2627,7 @@ class Stats {
" birth.d_file=indi.i_file AND" .
" birth.d_fact='BIRT' AND" .
" death.d_fact='DEAT' AND" .
- " birth.d_julianday1<>0 AND" .
+ " birth.d_julianday1 <> 0 AND" .
" birth.d_type IN ('@#DGREGORIAN@', '@#DJULIAN@') AND" .
" death.d_type IN ('@#DGREGORIAN@', '@#DJULIAN@') AND" .
" death.d_julianday1>birth.d_julianday2" .
@@ -2962,7 +2962,7 @@ class Stats {
}
break;
case 'name':
- $result = "<a href=\"" . $record->getHtmlUrl() . "\">" . $record->getFullName() . "</a>";
+ $result = '<a href="' . $record->getHtmlUrl() . '">' . $record->getFullName() . '</a>';
break;
case 'place':
$fact = $record->getFirstFact($row['fact']);
@@ -3257,9 +3257,9 @@ class Stats {
if ($husb && $wife && ($husb->getAllDeathDates() && $wife->getAllDeathDates() || !$husb->isDead() || !$wife->isDead())) {
if ($family->canShow()) {
if ($type === 'list') {
- $top10[] = "<li><a href=\"" . $family->getHtmlUrl() . "\">" . $family->getFullName() . "</a> (" . $age . ")" . "</li>";
+ $top10[] = '<li><a href="' . $family->getHtmlUrl() . '">' . $family->getFullName() . '</a> (' . $age . ')' . '</li>';
} else {
- $top10[] = "<a href=\"" . $family->getHtmlUrl() . "\">" . $family->getFullName() . "</a> (" . $age . ")";
+ $top10[] = '<a href="' . $family->getHtmlUrl() . '">' . $family->getFullName() . '</a> (' . $age . ')';
}
}
if (++$i === $total) {
@@ -3348,7 +3348,7 @@ class Stats {
$age = FunctionsDate::getAgeAtEvent($age);
if ($family->canShow()) {
if ($type === 'list') {
- $top10[] = '<li><a href="' . $family->getHtmlUrl() . '">' . $family->getFullName() . '</a> (' . $age . ')' . "</li>";
+ $top10[] = '<li><a href="' . $family->getHtmlUrl() . '">' . $family->getFullName() . '</a> (' . $age . ')' . '</li>';
} else {
$top10[] = '<a href="' . $family->getHtmlUrl() . '">' . $family->getFullName() . '</a> (' . $age . ')';
}
@@ -3507,7 +3507,7 @@ class Stats {
if (isset($params[0]) && $params[0] != '') {
$size = strtolower($params[0]);
} else {
- $size = $WT_STATS_S_CHART_X . "x" . $WT_STATS_S_CHART_Y;
+ $size = $WT_STATS_S_CHART_X . 'x' . $WT_STATS_S_CHART_Y;
}
if (isset($params[1]) && $params[1] != '') {
$color_from = strtolower($params[1]);
@@ -3537,7 +3537,7 @@ class Stats {
$chd = $this->arrayToExtendedEncoding($counts);
$chl = substr($centuries, 0, -1);
- return "<img src=\"https://chart.googleapis.com/chart?cht=p3&amp;chd=e:{$chd}&amp;chs={$size}&amp;chco={$color_from},{$color_to}&amp;chf=bg,s,ffffff00&amp;chl={$chl}\" width=\"{$sizes[0]}\" height=\"{$sizes[1]}\" alt=\"" . I18N::translate('Marriages by century') . "\" title=\"" . I18N::translate('Marriages by century') . "\" />";
+ return "<img src=\"https://chart.googleapis.com/chart?cht=p3&amp;chd=e:{$chd}&amp;chs={$size}&amp;chco={$color_from},{$color_to}&amp;chf=bg,s,ffffff00&amp;chl={$chl}\" width=\"{$sizes[0]}\" height=\"{$sizes[1]}\" alt=\"" . I18N::translate('Marriages by century') . '" title="' . I18N::translate('Marriages by century') . '" />';
}
return $rows;
@@ -3604,7 +3604,7 @@ class Stats {
if (isset($params[0]) && $params[0] != '') {
$size = strtolower($params[0]);
} else {
- $size = $WT_STATS_S_CHART_X . "x" . $WT_STATS_S_CHART_Y;
+ $size = $WT_STATS_S_CHART_X . 'x' . $WT_STATS_S_CHART_Y;
}
if (isset($params[1]) && $params[1] != '') {
$color_from = strtolower($params[1]);
@@ -3634,7 +3634,7 @@ class Stats {
$chd = $this->arrayToExtendedEncoding($counts);
$chl = substr($centuries, 0, -1);
- return "<img src=\"https://chart.googleapis.com/chart?cht=p3&amp;chd=e:{$chd}&amp;chs={$size}&amp;chco={$color_from},{$color_to}&amp;chf=bg,s,ffffff00&amp;chl={$chl}\" width=\"{$sizes[0]}\" height=\"{$sizes[1]}\" alt=\"" . I18N::translate('Divorces by century') . "\" title=\"" . I18N::translate('Divorces by century') . "\" />";
+ return "<img src=\"https://chart.googleapis.com/chart?cht=p3&amp;chd=e:{$chd}&amp;chs={$size}&amp;chco={$color_from},{$color_to}&amp;chf=bg,s,ffffff00&amp;chl={$chl}\" width=\"{$sizes[0]}\" height=\"{$sizes[1]}\" alt=\"" . I18N::translate('Divorces by century') . '" title="' . I18N::translate('Divorces by century') . '" />';
}
return $rows;
@@ -3939,7 +3939,7 @@ class Stats {
$chtt = substr_replace(I18N::translate('Average age in century of marriage'), '|', $counter[$half], 1);
}
- return "<img src=\"" . "https://chart.googleapis.com/chart?cht=bvg&amp;chs={$sizes[0]}x{$sizes[1]}&amp;chm=D,FF0000,2,0,3,1|{$chmm}{$chmf}&amp;chf=bg,s,ffffff00|c,s,ffffff00&amp;chtt=" . rawurlencode($chtt) . "&amp;chd={$chd}&amp;chco=0000FF,FFA0CB,FF0000&amp;chbh=20,3&amp;chxt=x,x,y,y&amp;chxl=" . rawurlencode($chxl) . "&amp;chdl=" . rawurlencode(I18N::translate('Males') . "|" . I18N::translate('Females') . "|" . I18N::translate('Average age')) . "\" width=\"{$sizes[0]}\" height=\"{$sizes[1]}\" alt=\"" . I18N::translate('Average age in century of marriage') . "\" title=\"" . I18N::translate('Average age in century of marriage') . "\" />";
+ return '<img src="' . "https://chart.googleapis.com/chart?cht=bvg&amp;chs={$sizes[0]}x{$sizes[1]}&amp;chm=D,FF0000,2,0,3,1|{$chmm}{$chmf}&amp;chf=bg,s,ffffff00|c,s,ffffff00&amp;chtt=" . rawurlencode($chtt) . "&amp;chd={$chd}&amp;chco=0000FF,FFA0CB,FF0000&amp;chbh=20,3&amp;chxt=x,x,y,y&amp;chxl=" . rawurlencode($chxl) . '&amp;chdl=' . rawurlencode(I18N::translate('Males') . '|' . I18N::translate('Females') . '|' . I18N::translate('Average age')) . "\" width=\"{$sizes[0]}\" height=\"{$sizes[1]}\" alt=\"" . I18N::translate('Average age in century of marriage') . '" title="' . I18N::translate('Average age in century of marriage') . '" />';
} else {
if ($year1 >= 0 && $year2 >= 0) {
$years = " married.d_year BETWEEN {$year1} AND {$year2} AND ";
@@ -4409,7 +4409,7 @@ class Stats {
$result = I18N::number($row['tot']);
break;
case 'name':
- $result = "<a href=\"" . $family->getHtmlUrl() . "\">" . $family->getFullName() . '</a>';
+ $result = '<a href="' . $family->getHtmlUrl() . '">' . $family->getFullName() . '</a>';
break;
}
@@ -4554,32 +4554,32 @@ class Stats {
if ($type == 'list') {
if ($one && !in_array($fam['family'], $dist)) {
if ($child1->canShow() && $child2->canShow()) {
- $return = "<li>";
- $return .= "<a href=\"" . $child2->getHtmlUrl() . "\">" . $child2->getFullName() . "</a> ";
- $return .= I18N::translate('and') . " ";
- $return .= "<a href=\"" . $child1->getHtmlUrl() . "\">" . $child1->getFullName() . "</a>";
- $return .= " (" . $age . ")";
- $return .= " <a href=\"" . $family->getHtmlUrl() . "\">[" . I18N::translate('View this family') . "]</a>";
+ $return = '<li>';
+ $return .= '<a href="' . $child2->getHtmlUrl() . '">' . $child2->getFullName() . '</a> ';
+ $return .= I18N::translate('and') . ' ';
+ $return .= '<a href="' . $child1->getHtmlUrl() . '">' . $child1->getFullName() . '</a>';
+ $return .= ' (' . $age . ')';
+ $return .= ' <a href="' . $family->getHtmlUrl() . '">[' . I18N::translate('View this family') . ']</a>';
$return .= '</li>';
$top10[] = $return;
$dist[] = $fam['family'];
}
} elseif (!$one && $child1->canShow() && $child2->canShow()) {
- $return = "<li>";
- $return .= "<a href=\"" . $child2->getHtmlUrl() . "\">" . $child2->getFullName() . "</a> ";
- $return .= I18N::translate('and') . " ";
- $return .= "<a href=\"" . $child1->getHtmlUrl() . "\">" . $child1->getFullName() . "</a>";
- $return .= " (" . $age . ")";
- $return .= " <a href=\"" . $family->getHtmlUrl() . "\">[" . I18N::translate('View this family') . "]</a>";
+ $return = '<li>';
+ $return .= '<a href="' . $child2->getHtmlUrl() . '">' . $child2->getFullName() . '</a> ';
+ $return .= I18N::translate('and') . ' ';
+ $return .= '<a href="' . $child1->getHtmlUrl() . '">' . $child1->getFullName() . '</a>';
+ $return .= ' (' . $age . ')';
+ $return .= ' <a href="' . $family->getHtmlUrl() . '">[' . I18N::translate('View this family') . ']</a>';
$return .= '</li>';
$top10[] = $return;
}
} else {
if ($child1->canShow() && $child2->canShow()) {
$return = $child2->formatList('span', false, $child2->getFullName());
- $return .= "<br>" . I18N::translate('and') . "<br>";
+ $return .= '<br>' . I18N::translate('and') . '<br>';
$return .= $child1->formatList('span', false, $child1->getFullName());
- $return .= "<br><a href=\"" . $family->getHtmlUrl() . "\">[" . I18N::translate('View this family') . "]</a>";
+ $return .= '<br><a href="' . $family->getHtmlUrl() . '">[' . I18N::translate('View this family') . ']</a>';
return $return;
} else {
@@ -4853,7 +4853,7 @@ class Stats {
}
$chl = rawurlencode(implode('|', $chl));
- return "<img src=\"https://chart.googleapis.com/chart?cht=p3&amp;chd=e:{$chd}&amp;chs={$size}&amp;chco={$color_from},{$color_to}&amp;chf=bg,s,ffffff00&amp;chl={$chl}\" width=\"{$sizes[0]}\" height=\"{$sizes[1]}\" alt=\"" . I18N::translate('Largest families') . "\" title=\"" . I18N::translate('Largest families') . "\" />";
+ return "<img src=\"https://chart.googleapis.com/chart?cht=p3&amp;chd=e:{$chd}&amp;chs={$size}&amp;chco={$color_from},{$color_to}&amp;chf=bg,s,ffffff00&amp;chl={$chl}\" width=\"{$sizes[0]}\" height=\"{$sizes[1]}\" alt=\"" . I18N::translate('Largest families') . '" title="' . I18N::translate('Largest families') . '" />';
}
/**
@@ -4916,15 +4916,15 @@ class Stats {
$max = $values['num'];
}
}
- $chm = "";
- $chxl = "0:|";
+ $chm = '';
+ $chxl = '0:|';
$i = 0;
$counts = [];
foreach ($rows as $values) {
if ($sizes[0] < 980) {
$sizes[0] += 38;
}
- $chxl .= $this->centuryName($values['century']) . "|";
+ $chxl .= $this->centuryName($values['century']) . '|';
if ($max <= 5) {
$counts[] = round($values['num'] * 819.2 - 1, 1);
} elseif ($max <= 10) {
@@ -4938,14 +4938,14 @@ class Stats {
$chd = $this->arrayToExtendedEncoding($counts);
$chm = substr($chm, 0, -1);
if ($max <= 5) {
- $chxl .= "1:||" . I18N::translate('century') . "|2:|0|1|2|3|4|5|3:||" . I18N::translate('Number of children') . "|";
+ $chxl .= '1:||' . I18N::translate('century') . '|2:|0|1|2|3|4|5|3:||' . I18N::translate('Number of children') . '|';
} elseif ($max <= 10) {
- $chxl .= "1:||" . I18N::translate('century') . "|2:|0|1|2|3|4|5|6|7|8|9|10|3:||" . I18N::translate('Number of children') . "|";
+ $chxl .= '1:||' . I18N::translate('century') . '|2:|0|1|2|3|4|5|6|7|8|9|10|3:||' . I18N::translate('Number of children') . '|';
} else {
- $chxl .= "1:||" . I18N::translate('century') . "|2:|0|1|2|3|4|5|6|7|8|9|10|11|12|13|14|15|16|17|18|19|20|3:||" . I18N::translate('Number of children') . "|";
+ $chxl .= '1:||' . I18N::translate('century') . '|2:|0|1|2|3|4|5|6|7|8|9|10|11|12|13|14|15|16|17|18|19|20|3:||' . I18N::translate('Number of children') . '|';
}
- return "<img src=\"https://chart.googleapis.com/chart?cht=bvg&amp;chs={$sizes[0]}x{$sizes[1]}&amp;chf=bg,s,ffffff00|c,s,ffffff00&amp;chm=D,FF0000,0,0,3,1|{$chm}&amp;chd=e:{$chd}&amp;chco=0000FF&amp;chbh=30,3&amp;chxt=x,x,y,y&amp;chxl=" . rawurlencode($chxl) . "\" width=\"{$sizes[0]}\" height=\"{$sizes[1]}\" alt=\"" . I18N::translate('Average number of children per family') . "\" title=\"" . I18N::translate('Average number of children per family') . "\" />";
+ return "<img src=\"https://chart.googleapis.com/chart?cht=bvg&amp;chs={$sizes[0]}x{$sizes[1]}&amp;chf=bg,s,ffffff00|c,s,ffffff00&amp;chm=D,FF0000,0,0,3,1|{$chm}&amp;chd=e:{$chd}&amp;chco=0000FF&amp;chbh=30,3&amp;chxt=x,x,y,y&amp;chxl=" . rawurlencode($chxl) . "\" width=\"{$sizes[0]}\" height=\"{$sizes[1]}\" alt=\"" . I18N::translate('Average number of children per family') . '" title="' . I18N::translate('Average number of children per family') . '" />';
} else {
if ($sex == 'M') {
$sql =
@@ -4980,7 +4980,7 @@ class Stats {
} else {
$sql .= "WHERE f_file={$this->tree->getTreeId()}";
}
- $sql .= " GROUP BY f_numchil";
+ $sql .= ' GROUP BY f_numchil';
}
$rows = $this->runSql($sql);
@@ -5091,9 +5091,9 @@ class Stats {
$family = Family::getInstance($row['family'], $this->tree);
if ($family->canShow()) {
if ($type == 'list') {
- $top10[] = "<li><a href=\"" . $family->getHtmlUrl() . "\">" . $family->getFullName() . "</a></li>";
+ $top10[] = '<li><a href="' . $family->getHtmlUrl() . '">' . $family->getFullName() . '</a></li>';
} else {
- $top10[] = "<a href=\"" . $family->getHtmlUrl() . "\">" . $family->getFullName() . "</a>";
+ $top10[] = '<a href="' . $family->getHtmlUrl() . '">' . $family->getFullName() . '</a>';
}
}
}
@@ -5139,7 +5139,7 @@ class Stats {
if ($year1 >= 0 && $year2 >= 0) {
$years = " married.d_year BETWEEN '{$year1}' AND '{$year2}' AND";
} else {
- $years = "";
+ $years = '';
}
$max = 0;
$tot = 0;
@@ -5172,15 +5172,15 @@ class Stats {
if ($unknown > $max) {
$max = $unknown;
}
- $chm = "";
- $chxl = "0:|";
+ $chm = '';
+ $chxl = '0:|';
$i = 0;
$counts = [];
foreach ($rows as $values) {
if ($sizes[0] < 980) {
$sizes[0] += 38;
}
- $chxl .= $this->centuryName($values['century']) . "|";
+ $chxl .= $this->centuryName($values['century']) . '|';
$counts[] = round(4095 * $values['count'] / ($max + 1));
$chm .= 't' . $values['count'] . ',000000,0,' . $i . ',11,1|';
$i++;
@@ -5188,7 +5188,7 @@ class Stats {
$counts[] = round(4095 * $unknown / ($max + 1));
$chd = $this->arrayToExtendedEncoding($counts);
$chm .= 't' . $unknown . ',000000,0,' . $i . ',11,1';
- $chxl .= I18N::translateContext('unknown century', 'Unknown') . "|1:||" . I18N::translate('century') . "|2:|0|";
+ $chxl .= I18N::translateContext('unknown century', 'Unknown') . '|1:||' . I18N::translate('century') . '|2:|0|';
$step = $max + 1;
for ($d = (int) ($max + 1); $d > 0; $d--) {
if (($max + 1) < ($d * 10 + 1) && fmod(($max + 1), $d) == 0) {
@@ -5203,11 +5203,11 @@ class Stats {
}
}
for ($n = $step; $n <= ($max + 1); $n += $step) {
- $chxl .= $n . "|";
+ $chxl .= $n . '|';
}
- $chxl .= "3:||" . I18N::translate('Total families') . "|";
+ $chxl .= '3:||' . I18N::translate('Total families') . '|';
- return "<img src=\"https://chart.googleapis.com/chart?cht=bvg&amp;chs={$sizes[0]}x{$sizes[1]}&amp;chf=bg,s,ffffff00|c,s,ffffff00&amp;chm=D,FF0000,0,0:" . ($i - 1) . ",3,1|{$chm}&amp;chd=e:{$chd}&amp;chco=0000FF,ffffff00&amp;chbh=30,3&amp;chxt=x,x,y,y&amp;chxl=" . rawurlencode($chxl) . "\" width=\"{$sizes[0]}\" height=\"{$sizes[1]}\" alt=\"" . I18N::translate('Number of families without children') . "\" title=\"" . I18N::translate('Number of families without children') . "\" />";
+ return "<img src=\"https://chart.googleapis.com/chart?cht=bvg&amp;chs={$sizes[0]}x{$sizes[1]}&amp;chf=bg,s,ffffff00|c,s,ffffff00&amp;chm=D,FF0000,0,0:" . ($i - 1) . ",3,1|{$chm}&amp;chd=e:{$chd}&amp;chco=0000FF,ffffff00&amp;chbh=30,3&amp;chxt=x,x,y,y&amp;chxl=" . rawurlencode($chxl) . "\" width=\"{$sizes[0]}\" height=\"{$sizes[1]}\" alt=\"" . I18N::translate('Number of families without children') . '" title="' . I18N::translate('Number of families without children') . '" />';
}
/**
@@ -5406,7 +5406,7 @@ class Stats {
$WT_STATS_S_CHART_X = Theme::theme()->parameter('stats-small-chart-x');
$WT_STATS_S_CHART_Y = Theme::theme()->parameter('stats-small-chart-y');
- $size = empty($params[0]) ? $WT_STATS_S_CHART_X . "x" . $WT_STATS_S_CHART_Y : strtolower($params[0]);
+ $size = empty($params[0]) ? $WT_STATS_S_CHART_X . 'x' . $WT_STATS_S_CHART_Y : strtolower($params[0]);
$color_from = empty($params[1]) ? $WT_STATS_CHART_COLOR1 : strtolower($params[1]);
$color_to = empty($params[2]) ? $WT_STATS_CHART_COLOR2 : strtolower($params[2]);
$number_of_surnames = empty($params[3]) ? 10 : (int) $params[3];
@@ -5826,7 +5826,7 @@ class Stats {
if (isset($params[0]) && $params[0] != '') {
$size = strtolower($params[0]);
} else {
- $size = $WT_STATS_S_CHART_X . "x" . $WT_STATS_S_CHART_Y;
+ $size = $WT_STATS_S_CHART_X . 'x' . $WT_STATS_S_CHART_Y;
}
if (isset($params[1]) && $params[1] != '') {
$color_from = strtolower($params[1]);
@@ -5875,7 +5875,7 @@ class Stats {
$chart_title = implode(I18N::$list_separator, $chl);
$chl = implode('|', $chl);
- return "<img src=\"https://chart.googleapis.com/chart?cht=p3&amp;chd=e:{$chd}&amp;chs={$size}&amp;chco={$color_from},{$color_to}&amp;chf=bg,s,ffffff00&amp;chl=" . rawurlencode($chl) . "\" width=\"{$sizes[0]}\" height=\"{$sizes[1]}\" alt=\"" . $chart_title . "\" title=\"" . $chart_title . "\" />";
+ return "<img src=\"https://chart.googleapis.com/chart?cht=p3&amp;chd=e:{$chd}&amp;chs={$size}&amp;chco={$color_from},{$color_to}&amp;chf=bg,s,ffffff00&amp;chl=" . rawurlencode($chl) . "\" width=\"{$sizes[0]}\" height=\"{$sizes[1]}\" alt=\"" . $chart_title . '" title="' . $chart_title . '" />';
}
/**
@@ -5907,9 +5907,9 @@ class Stats {
if ($LoginUsers > 0) {
if ($NumAnonymous) {
if ($type == 'list') {
- $content .= "<br><br>";
+ $content .= '<br><br>';
} else {
- $content .= " " . I18N::translate('and') . " ";
+ $content .= ' ' . I18N::translate('and') . ' ';
}
}
$content .= '<b>' . I18N::plural('%s signed-in user', '%s signed-in users', $LoginUsers, I18N::number($LoginUsers)) . '</b>';
diff --git a/app/Theme/AbstractTheme.php b/app/Theme/AbstractTheme.php
index d8e3205e51..e3239b51e5 100644
--- a/app/Theme/AbstractTheme.php
+++ b/app/Theme/AbstractTheme.php
@@ -270,7 +270,7 @@ abstract class AbstractTheme {
case 'mailto':
return '<a href="mailto:' . Filter::escapeHtml($user->getEmail()) . '">' . $user->getRealNameHtml() . '</a>';
default:
- return "<a href='#' onclick='message(\"" . Filter::escapeHtml($user->getUserName()) . "\", \"" . $method . "\", \"" . WT_BASE_URL . Filter::escapeHtml(Functions::getQueryUrl()) . "\", \"\");return false;'>" . $user->getRealNameHtml() . '</a>';
+ return "<a href='#' onclick='message(\"" . Filter::escapeHtml($user->getUserName()) . '", "' . $method . '", "' . WT_BASE_URL . Filter::escapeHtml(Functions::getQueryUrl()) . "\", \"\");return false;'>" . $user->getRealNameHtml() . '</a>';
}
}
diff --git a/calendar.php b/calendar.php
index a04fb4ea40..e0f96c71a9 100644
--- a/calendar.php
+++ b/calendar.php
@@ -520,7 +520,7 @@ case 'month':
break 2;
}
if (get_class($alt_date) !== get_class($cal_date)) {
- echo '<span class="rtl_cal_day">' . $alt_date->format("%j %M") . '</span>';
+ echo '<span class="rtl_cal_day">' . $alt_date->format('%j %M') . '</span>';
// Just show the first conversion
break;
}
diff --git a/edit_changes.php b/edit_changes.php
index a7499253a0..38e1178260 100644
--- a/edit_changes.php
+++ b/edit_changes.php
@@ -34,12 +34,12 @@ $controller
->restrictAccess(Auth::isModerator($WT_TREE))
->setPageTitle(I18N::translate('Pending changes'))
->pageHeader()
- ->addInlineJavascript("
+ ->addInlineJavascript('
function show_diff(diffurl) {
window.opener.location = diffurl;
return false;
}
- ");
+ ');
$action = Filter::get('action');
$change_id = Filter::getInteger('change_id');
diff --git a/edit_interface.php b/edit_interface.php
index 3475df8b2c..7747362703 100644
--- a/edit_interface.php
+++ b/edit_interface.php
@@ -1219,11 +1219,11 @@ case 'addnewsource':
<td class="optionbox wrap"><input type="text" data-autocomplete-type="SOUR_TITL" name="TITL" id="TITL" value="" size="60"> <?php echo FunctionsPrint::printSpecialCharacterLink('TITL'); ?></td></tr>
<tr><td class="descriptionbox wrap width25"><?php echo GedcomTag::getLabel('ABBR'); ?></td>
<td class="optionbox wrap"><input type="text" name="ABBR" id="ABBR" value="" size="40" maxlength="255"> <?php echo FunctionsPrint::printSpecialCharacterLink('ABBR'); ?></td></tr>
- <?php if (strstr($WT_TREE->getPreference('ADVANCED_NAME_FACTS'), "_HEB") !== false) { ?>
+ <?php if (strstr($WT_TREE->getPreference('ADVANCED_NAME_FACTS'), '_HEB') !== false) { ?>
<tr><td class="descriptionbox wrap width25"><?php echo GedcomTag::getLabel('_HEB'); ?></td>
<td class="optionbox wrap"><input type="text" name="_HEB" id="_HEB" value="" size="60"> <?php echo FunctionsPrint::printSpecialCharacterLink('_HEB'); ?></td></tr>
<?php } ?>
- <?php if (strstr($WT_TREE->getPreference('ADVANCED_NAME_FACTS'), "ROMN") !== false) { ?>
+ <?php if (strstr($WT_TREE->getPreference('ADVANCED_NAME_FACTS'), 'ROMN') !== false) { ?>
<tr><td class="descriptionbox wrap width25"><?php echo GedcomTag::getLabel('ROMN'); ?></td>
<td class="optionbox wrap"><input type="text" name="ROMN" id="ROMN" value="" size="60"> <?php echo FunctionsPrint::printSpecialCharacterLink('ROMN'); ?></td></tr>
<?php } ?>
@@ -1536,11 +1536,11 @@ case 'addnewrepository':
<table class="facts_table">
<tr><td class="descriptionbox wrap width25"><?php echo I18N::translate('Repository name'); ?></td>
<td class="optionbox wrap"><input type="text" name="REPO_NAME" id="REPO_NAME" value="" size="40" maxlength="255"> <?php echo FunctionsPrint::printSpecialCharacterLink('REPO_NAME'); ?></td></tr>
- <?php if (strstr($WT_TREE->getPreference('ADVANCED_NAME_FACTS'), "_HEB") !== false) { ?>
+ <?php if (strstr($WT_TREE->getPreference('ADVANCED_NAME_FACTS'), '_HEB') !== false) { ?>
<tr><td class="descriptionbox wrap width25"><?php echo GedcomTag::getLabel('_HEB'); ?></td>
<td class="optionbox wrap"><input type="text" name="_HEB" id="_HEB" value="" size="40" maxlength="255"> <?php echo FunctionsPrint::printSpecialCharacterLink('_HEB'); ?></td></tr>
<?php } ?>
- <?php if (strstr($WT_TREE->getPreference('ADVANCED_NAME_FACTS'), "ROMN") !== false) { ?>
+ <?php if (strstr($WT_TREE->getPreference('ADVANCED_NAME_FACTS'), 'ROMN') !== false) { ?>
<tr><td class="descriptionbox wrap width25"><?php echo GedcomTag::getLabel('ROMN'); ?></td>
<td class="optionbox wrap"><input type="text" name="ROMN" id="ROMN" value="" size="40" maxlength="255"> <?php echo FunctionsPrint::printSpecialCharacterLink('ROMN'); ?></td></tr>
<?php } ?>
@@ -2525,7 +2525,7 @@ function print_indi_form($nextaction, Individual $person = null, Family $family
echo '</table><br><table class="facts_table">';
// 1 SEX
if ($famtag === 'HUSB' || $gender === 'M') {
- FunctionsEdit::addSimpleTag("0 SEX M");
+ FunctionsEdit::addSimpleTag('0 SEX M');
} elseif ($famtag === 'WIFE' || $gender === 'F') {
FunctionsEdit::addSimpleTag('0 SEX F');
} else {
diff --git a/find.php b/find.php
index 84cc24ab75..520ab8dee3 100644
--- a/find.php
+++ b/find.php
@@ -109,7 +109,7 @@ echo '<script>';
function pasteid(id, name, thumb) {
if (thumb) {
window.opener.<?php echo $callback; ?>(id, name, thumb);
- <?php echo "window.close();"; ?>
+ <?php echo 'window.close();'; ?>
} else {
// GEDFact_assistant ========================
if (window.opener.document.getElementById('addlinkQueue')) {
@@ -117,7 +117,7 @@ echo '<script>';
}
window.opener.<?php echo $callback; ?>(id);
if (window.opener.pastename) window.opener.pastename(name);
- <?php echo "window.close();"; ?>
+ <?php echo 'window.close();'; ?>
}
}
function checknames(frm) {
@@ -139,7 +139,7 @@ echo '</script>';
echo '<div id="find-page"><h2>', $controller->getPageTitle(), '</h2>';
// Show indi and hide the rest
-if ($type == "indi") {
+if ($type == 'indi') {
echo '<div id="find-header">
<form name="filterindi" method="get" onsubmit="return checknames(this);" action="find.php">
<input type="hidden" name="callback" value="' . $callback . '">
@@ -156,7 +156,7 @@ if ($type == "indi") {
}
// Show fam and hide the rest
-if ($type == "fam") {
+if ($type == 'fam') {
echo '<div id="find-header">
<form name="filterfam" method="get" onsubmit="return checknames(this);" action="find.php">
<input type="hidden" name="callback" value="' . $callback . '">
@@ -192,7 +192,7 @@ if ($type == 'media') {
}
// Show place and hide the rest
-if ($type == "place") {
+if ($type == 'place') {
echo '<div id="find-header">
<form name="filterplace" method="get" action="find.php">
<input type="hidden" name="action" value="filter">
@@ -210,7 +210,7 @@ if ($type == "place") {
}
// Show repo and hide the rest
-if ($type == "repo") {
+if ($type == 'repo') {
echo '<div id="find-header">
<form name="filterrepo" method="get" action="find.php">
<input type="hidden" name="action" value="filter">
@@ -229,7 +229,7 @@ if ($type == "repo") {
}
// Show Shared Notes and hide the rest
-if ($type == "note") {
+if ($type == 'note') {
echo '<div id="find-header">
<form name="filternote" method="get" action="find.php">
<input type="hidden" name="action" value="filter">
@@ -247,7 +247,7 @@ if ($type == "note") {
}
// Show source and hide the rest
-if ($type == "source") {
+if ($type == 'source') {
echo '<div id="find-header">
<form name="filtersource" method="get" action="find.php">
<input type="hidden" name="action" value="filter">
@@ -291,7 +291,7 @@ if ($type == 'specialchar') {
}
// Show facts
-if ($type == "factINDI" || $type == "factFAM" || $type == "factSOUR" || $type == "factREPO" || $type == "factNAME" || $type == "factPLAC") {
+if ($type == 'factINDI' || $type == 'factFAM' || $type == 'factSOUR' || $type == 'factREPO' || $type == 'factNAME' || $type == 'factPLAC') {
echo '<div id="find-facts-header">
<form name="filterfacts" method="get" action="find.php"
input type="hidden" name="type" value="facts">
@@ -530,7 +530,7 @@ if ($type == "factINDI" || $type == "factFAM" || $type == "factSOUR" || $type ==
<table id="tabFilterAndCustom"><tbody>
<tr><td>', I18N::translate('Filter'), ':</td><td><input type="text" id="tbxFilter"></td></tr>
- <tr><td>', I18N::translate('Custom tags'), ':</td><td><input type="text" id="tbxCustom" value="', addslashes(implode(",", $preselCustom)), '"></td></tr>
+ <tr><td>', I18N::translate('Custom tags'), ':</td><td><input type="text" id="tbxCustom" value="', addslashes(implode(',', $preselCustom)), '"></td></tr>
<td><td></tbody></table>
<table id="tabAction"><tbody><tr>
@@ -563,7 +563,7 @@ if ($action === 'filter') {
}
// Output Family
- if ($type == "fam") {
+ if ($type == 'fam') {
echo '<div id="find-output">';
// Get the famrecs with hits on names from the family table
// Get the famrecs with hits in the gedcom record from the family table
@@ -643,7 +643,7 @@ if ($action === 'filter') {
}
// Output Places
- if ($type == "place") {
+ if ($type == 'place') {
echo '<div id="find-output">';
if (!$filter || $all) {
$places = Place::allPlaces($WT_TREE);
@@ -670,7 +670,7 @@ if ($action === 'filter') {
}
// Output Repositories
- if ($type == "repo") {
+ if ($type == 'repo') {
echo '<div id="find-output">';
if ($filter) {
$repo_list = FunctionsDb::searchRepositories($filter_array, [$WT_TREE]);
@@ -684,7 +684,7 @@ if ($action === 'filter') {
echo '<li><a href="', $repo->getHtmlUrl(), '" onclick="pasteid(\'', $repo->getXref(), '\');"><span class="list_item">', $repo->getFullName(), '</span></a></li>';
}
echo '</ul>
- <p>', I18N::translate('Repositories found'), " ", count($repo_list), '</p>';
+ <p>', I18N::translate('Repositories found'), ' ', count($repo_list), '</p>';
} else {
echo '<p>', I18N::translate('No results found.'), '</p>';
}
@@ -692,7 +692,7 @@ if ($action === 'filter') {
}
// Output Shared Notes
- if ($type == "note") {
+ if ($type == 'note') {
echo '<div id="find-output">';
if ($filter) {
$mynotelist = FunctionsDb::searchNotes($filter_array, [$WT_TREE]);
@@ -714,7 +714,7 @@ if ($action === 'filter') {
}
// Output Sources
- if ($type == "source") {
+ if ($type == 'source') {
echo '<div id="find-output">';
if ($filter) {
$mysourcelist = FunctionsDb::searchSources($filter_array, [$WT_TREE]);
@@ -738,7 +738,7 @@ if ($action === 'filter') {
}
// Output Special Characters
- if ($type == "specialchar") {
+ if ($type == 'specialchar') {
echo '<div id="find-output-special"><p>';
// lower case special characters
foreach (SpecialChars::create($language_filter)->upper() as $special_character) {
@@ -758,4 +758,4 @@ if ($action === 'filter') {
}
}
echo '<button onclick="window.close();">', I18N::translate('close'), '</button>';
-echo "</div>";
+echo '</div>';
diff --git a/inverselink.php b/inverselink.php
index e6c064a494..65ef2fcdf7 100644
--- a/inverselink.php
+++ b/inverselink.php
@@ -53,7 +53,7 @@ if ($linkto == 'manage' && Module::getModuleByName('GEDFact_assistant')) {
$paramok = GedcomRecord::getInstance($linktoid, $WT_TREE)->canShow();
}
- if ($action == "choose" && $paramok) {
+ if ($action == 'choose' && $paramok) {
echo '<form name="link" method="get" action="inverselink.php">';
echo '<input type="hidden" name="action" value="update">';
if (!empty($mediaid)) {
@@ -91,10 +91,10 @@ if ($linkto == 'manage' && Module::getModuleByName('GEDFact_assistant')) {
}
echo '<tr><td class="descriptionbox">';
- if ($linkto == "person") {
- echo I18N::translate('Individual'), "</td>";
+ if ($linkto == 'person') {
+ echo I18N::translate('Individual'), '</td>';
echo '<td class="optionbox wrap">';
- if ($linktoid == "") {
+ if ($linktoid == '') {
echo '<input class="pedigree_form" type="text" name="linktoid" id="linktopid" size="3" value="', $linktoid, '"> ';
echo FunctionsPrint::printFindIndividualLink('linktopid');
} else {
@@ -103,10 +103,10 @@ if ($linkto == 'manage' && Module::getModuleByName('GEDFact_assistant')) {
}
}
- if ($linkto == "family") {
+ if ($linkto == 'family') {
echo I18N::translate('Family'), '</td>';
echo '<td class="optionbox wrap">';
- if ($linktoid == "") {
+ if ($linktoid == '') {
echo '<input class="pedigree_form" type="text" name="linktoid" id="linktofamid" size="3" value="', $linktoid, '"> ';
echo FunctionsPrint::printFindFamilyLink('linktofamid');
} else {
@@ -115,10 +115,10 @@ if ($linkto == 'manage' && Module::getModuleByName('GEDFact_assistant')) {
}
}
- if ($linkto == "source") {
- echo I18N::translate('Source'), "</td>";
+ if ($linkto == 'source') {
+ echo I18N::translate('Source'), '</td>';
echo '<td class="optionbox wrap">';
- if ($linktoid == "") {
+ if ($linktoid == '') {
echo '<input class="pedigree_form" type="text" name="linktoid" id="linktosid" size="3" value="', $linktoid, '"> ';
echo FunctionsPrint::printFindSourceLink('linktosid');
} else {
@@ -126,10 +126,10 @@ if ($linkto == 'manage' && Module::getModuleByName('GEDFact_assistant')) {
echo $record->formatList('span', false, $record->getFullName());
}
}
- if ($linkto == "repository") {
- echo I18N::translate('Repository'), "</td>";
+ if ($linkto == 'repository') {
+ echo I18N::translate('Repository'), '</td>';
echo '<td class="optionbox wrap">';
- if ($linktoid == "") {
+ if ($linktoid == '') {
echo '<input class="pedigree_form" type="text" name="linktoid" id="linktorid" size="3" value="', $linktoid, '">';
} else {
$record = Repository::getInstance($linktoid, $WT_TREE);
@@ -137,10 +137,10 @@ if ($linkto == 'manage' && Module::getModuleByName('GEDFact_assistant')) {
}
}
- if ($linkto == "note") {
- echo I18N::translate('Shared note'), "</td>";
+ if ($linkto == 'note') {
+ echo I18N::translate('Shared note'), '</td>';
echo '<td class="optionbox wrap">';
- if ($linktoid == "") {
+ if ($linktoid == '') {
echo '<input class="pedigree_form" type="text" name="linktoid" id="linktonid" size="3" value="', $linktoid, '">';
} else {
$record = Note::getInstance($linktoid, $WT_TREE);
@@ -152,7 +152,7 @@ if ($linkto == 'manage' && Module::getModuleByName('GEDFact_assistant')) {
echo '<tr><td class="topbottombar" colspan="2"><input type="submit" value="', /* I18N: A button label (a verb). */ I18N::translate('link'), '"></td></tr>';
echo '</table>';
echo '</form>';
- } elseif ($action == "update" && $paramok) {
+ } elseif ($action == 'update' && $paramok) {
$record = GedcomRecord::getInstance($linktoid, $WT_TREE);
$record->createFact('1 OBJE @' . $mediaid . '@', true);
$controller->addInlineJavascript('closePopupAndReloadParent();');
diff --git a/login.php b/login.php
index dd86a2ded8..b9dd8e0f9f 100644
--- a/login.php
+++ b/login.php
@@ -255,8 +255,8 @@ case 'requestpw':
I18N::translate('Lost password request'),
I18N::translate('Hello %s…', $user->getRealNameHtml()) . Mail::EOL . Mail::EOL .
I18N::translate('A new password has been requested for your username.') . Mail::EOL . Mail::EOL .
- I18N::translate('Username') . ": " . Filter::escapeHtml($user->getUserName()) . Mail::EOL .
- I18N::translate('Password') . ": " . $user_new_pw . Mail::EOL . Mail::EOL .
+ I18N::translate('Username') . ': ' . Filter::escapeHtml($user->getUserName()) . Mail::EOL .
+ I18N::translate('Password') . ': ' . $user_new_pw . Mail::EOL . Mail::EOL .
I18N::translate('After you have signed in, select the “My account” link under the “My pages” menu and fill in the password fields to change your password.') . Mail::EOL . Mail::EOL .
'<a href="' . WT_BASE_URL . 'login.php?ged=' . $WT_TREE->getNameUrl() . '">' . WT_BASE_URL . 'login.php?ged=' . $WT_TREE->getNameUrl() . '</a>'
);
@@ -342,10 +342,10 @@ case 'register':
I18N::translate('Follow this link to verify your email address.') .
Mail::EOL . Mail::EOL .
'<a href="' . WT_LOGIN_URL . '?user_name=' . Filter::escapeUrl($user->getUserName()) . '&amp;user_hashcode=' . $user->getPreference('reg_hashcode') . '&amp;action=userverify&amp;ged=' . $WT_TREE->getNameUrl() . '">' .
- WT_LOGIN_URL . "?user_name=" . Filter::escapeHtml($user->getUserName()) . "&amp;user_hashcode=" . urlencode($user->getPreference('reg_hashcode')) . '&amp;action=userverify&amp;ged=' . $WT_TREE->getNameHtml() .
+ WT_LOGIN_URL . '?user_name=' . Filter::escapeHtml($user->getUserName()) . '&amp;user_hashcode=' . urlencode($user->getPreference('reg_hashcode')) . '&amp;action=userverify&amp;ged=' . $WT_TREE->getNameHtml() .
'</a>' . Mail::EOL . Mail::EOL .
- I18N::translate('Username') . " - " . Filter::escapeHtml($user->getUserName()) . Mail::EOL .
- I18N::translate('Comments') . " - " . $user->getPreference('comment') . Mail::EOL .
+ I18N::translate('Username') . ' - ' . Filter::escapeHtml($user->getUserName()) . Mail::EOL .
+ I18N::translate('Comments') . ' - ' . $user->getPreference('comment') . Mail::EOL .
I18N::translate('If you didn’t request an account, you can just delete this message.') . Mail::EOL;
$mail2_subject = /* I18N: %s is a server name/URL */ I18N::translate('Your registration at %s', WT_BASE_URL);
$mail2_to = $user->getEmail();
@@ -553,7 +553,7 @@ case 'verify_hash':
I18N::init($webmaster->getPreference('language'));
$user = User::findByUserName($user_name);
- $edit_user_url = WT_BASE_URL . "admin_users.php?action=edit&amp;user_id=" . $user->getUserId();
+ $edit_user_url = WT_BASE_URL . 'admin_users.php?action=edit&amp;user_id=' . $user->getUserId();
$mail1_body =
I18N::translate('Hello administrator…') .
Mail::EOL . Mail::EOL .
diff --git a/message.php b/message.php
index 5435011300..ccfc100bcb 100644
--- a/message.php
+++ b/message.php
@@ -46,7 +46,7 @@ if (Auth::check()) {
$from = Auth::user()->getUserName();
} else {
// Visitors must provide a valid email address
- if ($from_email && (!preg_match("/(.+)@(.+)/", $from_email, $match) || function_exists('checkdnsrr') && checkdnsrr($match[2]) === false)) {
+ if ($from_email && (!preg_match('/(.+)@(.+)/', $from_email, $match) || function_exists('checkdnsrr') && checkdnsrr($match[2]) === false)) {
$errors .= '<p class="ui-state-error">' . I18N::translate('Please enter a valid email address.') . '</p>';
$action = 'compose';
}
@@ -282,7 +282,7 @@ function addMessage($message) {
}
if (empty($message['created'])) {
- $message['created'] = gmdate("D, d M Y H:i:s T");
+ $message['created'] = gmdate('D, d M Y H:i:s T');
}
if ($message['method'] !== 'messaging3' && $message['method'] !== 'mailto' && $message['method'] !== 'none') {
diff --git a/modules_v3/GEDFact_assistant/_MEDIA/media_0_inverselink.php b/modules_v3/GEDFact_assistant/_MEDIA/media_0_inverselink.php
index 8710c37718..a3c2ad05a5 100644
--- a/modules_v3/GEDFact_assistant/_MEDIA/media_0_inverselink.php
+++ b/modules_v3/GEDFact_assistant/_MEDIA/media_0_inverselink.php
@@ -105,7 +105,7 @@ if ($action == 'choose' && $paramok) {
echo '<td class="topbottombar" width="20" style="font-weight:100;" >', I18N::translate('Keep'), '</td>';
echo '<td class="topbottombar" width="20" style="font-weight:100;" >', I18N::translate('Remove'), '</td>';
echo '<td class="topbottombar" width="20" style="font-weight:100;" >', I18N::translate('Family navigator'), '</td>';
- echo "</tr>";
+ echo '</tr>';
$links = array_merge(
$media->linkedIndividuals('OBJE'),
@@ -147,17 +147,19 @@ if ($action == 'choose' && $paramok) {
echo '</tr>';
}
- echo "</table>";
- echo "</td></tr></table>";
+ echo '</table>';
+ echo '</td></tr></table>';
echo '</td></tr>';
}
- if (!isset($linktoid)) { $linktoid = ""; }
+ if (!isset($linktoid)) {
+ $linktoid = '';
+ }
echo '<tr><td class="descriptionbox wrap">';
echo I18N::translate('Add links');
echo '<td class="optionbox wrap ">';
- if ($linktoid == "") {
+ if ($linktoid == '') {
// ----
} else {
$record = Individual::getInstance($linktoid, $WT_TREE);
@@ -172,7 +174,7 @@ if ($action == 'choose' && $paramok) {
echo ' ', FunctionsPrint::printFindFamilyLink('gid');
echo ' ', FunctionsPrint::printFindSourceLink('gid');
echo '</td></tr></table>';
- echo "<sub>" . I18N::translate('Enter or search for the ID of the individual, family, or source to which this media object should be linked.') . "</sub>";
+ echo '<sub>' . I18N::translate('Enter or search for the ID of the individual, family, or source to which this media object should be linked.') . '</sub>';
echo '<br><br>';
echo '<input type="hidden" name="idName" id="idName" size="36" value="Name of ID">';
@@ -555,7 +557,7 @@ function shiftlinks() {
</p>
</form>
<?php
-} elseif ($action == "update" && $paramok) {
+} elseif ($action == 'update' && $paramok) {
// Unlink records indicated by radio button =========
if ($exist_links) {
foreach (explode(',', $exist_links) as $remLinkId) {
diff --git a/pedigree.php b/pedigree.php
index 371ae7b95a..981bcd2bca 100644
--- a/pedigree.php
+++ b/pedigree.php
@@ -90,7 +90,7 @@ $controller
p1 = jQuery("#sosa_" + (i+1));
// change line y position if within 10% of box top/bottom
addOffset = boxHeight / (p1.position().top - p0.position().top) > 0.9 ? extraOffsetY: 0;
- if (' . json_encode(I18N::direction() === "rtl") . ') {
+ if (' . json_encode(I18N::direction() === 'rtl') . ') {
drawLines(
ctx,
p0.position().left + p0.width(),
@@ -204,7 +204,7 @@ echo '<div id="pedigree_chart" class="layout', $controller->orientation, '">';
foreach ($controller->nodes as $i => $node) {
// -- draw the box
- printf('<div id="sosa_%s" class="shadow" style="%s:%spx; top:%spx">', $i + 1, $posn, $node["x"], $node["y"]);
+ printf('<div id="sosa_%s" class="shadow" style="%s:%spx; top:%spx">', $i + 1, $posn, $node['x'], $node['y']);
if ($controller->orientation === $controller::OLDEST_AT_TOP) {
if ($i >= $lastgenStart) {
diff --git a/reportengine.php b/reportengine.php
index ecc29371ba..08df94efe8 100644
--- a/reportengine.php
+++ b/reportengine.php
@@ -157,7 +157,7 @@ case 'setup':
}
foreach ($report_array['inputs'] as $input) {
echo '<tr><td class="descriptionbox wrap">';
- echo '<input type="hidden" name="varnames[]" value="', Filter::escapeHtml($input["name"]), '">';
+ echo '<input type="hidden" name="varnames[]" value="', Filter::escapeHtml($input['name']), '">';
echo I18N::translate($input['value']), '</td><td class="optionbox">';
if (!isset($input['type'])) {
$input['type'] = 'text';
diff --git a/search.php b/search.php
index 872668ea69..9a603131b7 100644
--- a/search.php
+++ b/search.php
@@ -220,7 +220,7 @@ function checknames(frm) {
</form>
<?php endif; ?>
-<?php if ($controller->action == "soundex"): ?>
+<?php if ($controller->action === 'soundex'): ?>
<form name="searchform" onsubmit="return checknames(this);">
<input type="hidden" name="action" value="soundex">
diff --git a/search_advanced.php b/search_advanced.php
index f99a86773f..ed707f856d 100644
--- a/search_advanced.php
+++ b/search_advanced.php
@@ -135,10 +135,10 @@ echo '</script>';
<?php
$fct = count($controller->fields);
for ($i = 0; $i < $fct; $i++) {
- if (strpos($controller->getField($i), "FAMC:HUSB:NAME") === 0) {
+ if (strpos($controller->getField($i), 'FAMC:HUSB:NAME') === 0) {
continue;
}
- if (strpos($controller->getField($i), "FAMC:WIFE:NAME") === 0) {
+ if (strpos($controller->getField($i), 'FAMC:WIFE:NAME') === 0) {
continue;
}
?>
@@ -152,17 +152,17 @@ echo '</script>';
$currentField = substr($currentFieldSearch, 0, strrpos($currentFieldSearch, ':')); // Get the actual field name
?>
<input type="text" id="value<?php echo $i; ?>" name="values[<?php echo $i; ?>]" value="<?php echo Filter::escapeHtml($controller->getValue($i)); ?>"<?php echo substr($controller->getField($i), -4) == 'PLAC' ? 'data-autocomplete-type="PLAC"' : ''; ?>>
- <?php if (preg_match("/^NAME:/", $currentFieldSearch) > 0) { ?>
+ <?php if (preg_match('/^NAME:/', $currentFieldSearch) > 0) { ?>
<select name="fields[<?php echo $i; ?>]">
- <option value="<?php echo $currentField; ?>:EXACT" <?php if (preg_match("/:EXACT$/", $currentFieldSearch) > 0) echo 'selected'; ?>><?php echo I18N::translate('Exact'); ?></option>
- <option value="<?php echo $currentField; ?>:BEGINS" <?php if (preg_match("/:BEGINS$/", $currentFieldSearch) > 0) echo 'selected'; ?>><?php echo I18N::translate('Begins with'); ?></option>
- <option value="<?php echo $currentField; ?>:CONTAINS" <?php if (preg_match("/:CONTAINS$/", $currentFieldSearch) > 0) echo 'selected'; ?>><?php echo I18N::translate('Contains'); ?></option>
- <option value="<?php echo $currentField; ?>:SDX" <?php if (preg_match("/:SDX$/", $currentFieldSearch) > 0) echo 'selected'; ?>><?php echo I18N::translate('Sounds like'); ?></option>
+ <option value="<?php echo $currentField; ?>:EXACT" <?php if (preg_match('/:EXACT$/', $currentFieldSearch) > 0) echo 'selected'; ?>><?php echo I18N::translate('Exact'); ?></option>
+ <option value="<?php echo $currentField; ?>:BEGINS" <?php if (preg_match('/:BEGINS$/', $currentFieldSearch) > 0) echo 'selected'; ?>><?php echo I18N::translate('Begins with'); ?></option>
+ <option value="<?php echo $currentField; ?>:CONTAINS" <?php if (preg_match('/:CONTAINS$/', $currentFieldSearch) > 0) echo 'selected'; ?>><?php echo I18N::translate('Contains'); ?></option>
+ <option value="<?php echo $currentField; ?>:SDX" <?php if (preg_match('/:SDX$/', $currentFieldSearch) > 0) echo 'selected'; ?>><?php echo I18N::translate('Sounds like'); ?></option>
</select>
<?php } else { ?>
<input type="hidden" name="fields[<?php echo $i; ?>]" value="<?php echo $controller->getField($i); ?>">
<?php }
- if (preg_match("/:DATE$/", $currentFieldSearch) > 0) {
+ if (preg_match('/:DATE$/', $currentFieldSearch) > 0) {
?>
<select name="plusminus[<?php echo $i; ?>]">
<option value=""><?php echo I18N::translate('Exact date'); ?></option>
diff --git a/timeline.php b/timeline.php
index fff81dc590..f08598cfea 100644
--- a/timeline.php
+++ b/timeline.php
@@ -260,7 +260,7 @@ document.onmouseup = function () {
$pid = $indi->getXref();
$col = $p % 6;
if ($i === $half) {
- echo "</tr><tr>";
+ echo '</tr><tr>';
}
$i++;
?>
@@ -310,8 +310,8 @@ document.onmouseup = function () {
$scalemod = round($controller->scale * .2) + 1;
?>
<td class="list_value" style="padding: 5px;">
- <a href="<?php echo WT_SCRIPT_NAME . "?" . $controller->pidlinks . "scale=" . ($controller->scale + $scalemod); ?>&amp;ged=<?php echo $WT_TREE->getNameUrl(); ?>" class="icon-zoomin" title="<?php echo I18N::translate('Zoom in'); ?>"></a><br>
- <a href="<?php echo WT_SCRIPT_NAME . "?" . $controller->pidlinks . "scale=" . ($controller->scale - $scalemod); ?>&amp;ged=<?php echo $WT_TREE->getNameUrl(); ?>" class="icon-zoomout" title="<?php echo I18N::translate('Zoom out'); ?>"></a><br>
+ <a href="<?php echo WT_SCRIPT_NAME . '?' . $controller->pidlinks . 'scale=' . ($controller->scale + $scalemod); ?>&amp;ged=<?php echo $WT_TREE->getNameUrl(); ?>" class="icon-zoomin" title="<?php echo I18N::translate('Zoom in'); ?>"></a><br>
+ <a href="<?php echo WT_SCRIPT_NAME . '?' . $controller->pidlinks . 'scale=' . ($controller->scale - $scalemod); ?>&amp;ged=<?php echo $WT_TREE->getNameUrl(); ?>" class="icon-zoomout" title="<?php echo I18N::translate('Zoom out'); ?>"></a><br>
<input type="button" value="<?php echo I18N::translate('reset'); ?>" onclick="window.location = 'timeline.php?ged=<?php echo $WT_TREE->getNameUrl(); ?>';">
</td>
<?php } ?>
@@ -324,7 +324,7 @@ if (count($controller->people) > 0) {
?>
<div id="timeline_chart">
<!-- print the timeline line image -->
- <div id="line" style="position:absolute; <?php echo I18N::direction() === 'ltr' ? 'left: ' . ($basexoffset + 22) : "right: " . ($basexoffset + 22); ?>px; top: <?php echo $baseyoffset; ?>px;">
+ <div id="line" style="position:absolute; <?php echo I18N::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; ?>">
</div>
<!-- print divs for the grid -->