summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorScrutinizer Auto-Fixer <auto-fixer@scrutinizer-ci.com>2015-01-18 20:44:15 +0000
committerScrutinizer Auto-Fixer <auto-fixer@scrutinizer-ci.com>2015-01-18 20:44:15 +0000
commit75af2bf88db1e26000b59b3b0c3a5da9f0dee1b9 (patch)
tree1867492f5eae6d96126e99935e55a79889e8a09c
parentdca625e27aa77b66cae2528860f361d4e2d78732 (diff)
downloadwebtrees-75af2bf88db1e26000b59b3b0c3a5da9f0dee1b9.tar.gz
webtrees-75af2bf88db1e26000b59b3b0c3a5da9f0dee1b9.tar.bz2
webtrees-75af2bf88db1e26000b59b3b0c3a5da9f0dee1b9.zip
Scrutinizer Auto-Fixes
This commit consists of patches automatically generated for this project on https://scrutinizer-ci.com
-rw-r--r--includes/functions/functions_date.php2
-rw-r--r--includes/functions/functions_export.php50
-rw-r--r--includes/functions/functions_mediadb.php14
-rw-r--r--includes/functions/functions_print.php168
-rw-r--r--includes/functions/functions_print_facts.php42
-rw-r--r--includes/functions/functions_print_lists.php37
-rw-r--r--includes/hitcount.php6
-rw-r--r--index_edit.php4
-rw-r--r--indilist.php2
-rw-r--r--individual.php28
-rw-r--r--library/WT/Report/HTML.php4
-rw-r--r--library/WT/Report/PDF_Footnote.php2
-rw-r--r--library/WT/Report/PDF_Text.php2
-rw-r--r--library/WT/Soundex.php22
-rw-r--r--library/WT/Theme/BaseTheme.php18
-rw-r--r--library/WT/Tree.php10
-rw-r--r--lifespan.php8
-rw-r--r--mediafirewall.php6
-rw-r--r--mediaviewer.php16
-rw-r--r--message.php2
-rw-r--r--modules_v3/GEDFact_assistant/CENS_ctrl.php12
-rw-r--r--modules_v3/GEDFact_assistant/MEDIA_ctrl.php8
-rw-r--r--modules_v3/ahnentafel_report/module.php10
-rw-r--r--modules_v3/batch_update/module.php10
-rw-r--r--modules_v3/batch_update/plugins/death_y.php4
-rw-r--r--modules_v3/batch_update/plugins/search_replace.php32
-rw-r--r--modules_v3/bdm_report/module.php10
-rw-r--r--modules_v3/birth_report/module.php10
-rw-r--r--modules_v3/cemetery_report/module.php10
-rw-r--r--modules_v3/change_report/module.php10
-rw-r--r--modules_v3/charts/help_text.php6
-rw-r--r--modules_v3/ckeditor/module.php2
-rw-r--r--modules_v3/clippings/help_text.php10
-rw-r--r--modules_v3/death_report/module.php10
-rw-r--r--modules_v3/descendancy_report/module.php10
-rw-r--r--modules_v3/fact_sources/module.php10
-rw-r--r--modules_v3/family_group_report/module.php10
-rw-r--r--modules_v3/family_nav/module.php11
-rw-r--r--modules_v3/faq/module.php22
-rw-r--r--modules_v3/gedcom_block/module.php16
-rw-r--r--modules_v3/gedcom_favorites/db_schema/db_schema_0_1.php22
-rw-r--r--modules_v3/gedcom_favorites/db_schema/db_schema_1_2.php26
-rw-r--r--modules_v3/gedcom_favorites/db_schema/db_schema_2_3.php8
-rw-r--r--modules_v3/gedcom_news/db_schema/db_schema_0_1.php16
-rw-r--r--modules_v3/gedcom_news/db_schema/db_schema_1_2.php24
-rw-r--r--modules_v3/gedcom_news/db_schema/db_schema_2_3.php8
-rw-r--r--modules_v3/gedcom_news/module.php6
47 files changed, 397 insertions, 379 deletions
diff --git a/includes/functions/functions_date.php b/includes/functions/functions_date.php
index 6c1284b0ef..f1f5073ca0 100644
--- a/includes/functions/functions_date.php
+++ b/includes/functions/functions_date.php
@@ -40,7 +40,7 @@ function get_age_at_event($age_string, $show_years) {
array(
'/(\d+)([ymwd])/',
),
- function ($match) use ($age_string, $show_years) {
+ function($match) use ($age_string, $show_years) {
switch ($match[2]) {
case 'y':
if ($show_years || preg_match('/[dm]/', $age_string)) {
diff --git a/includes/functions/functions_export.php b/includes/functions/functions_export.php
index 82f627d55a..e6d02dda65 100644
--- a/includes/functions/functions_export.php
+++ b/includes/functions/functions_export.php
@@ -32,34 +32,34 @@ use WT\Auth;
function reformat_record_export($rec) {
global $WORD_WRAPPED_NOTES;
- $newrec='';
+ $newrec = '';
foreach (preg_split('/[\r\n]+/', $rec, -1, PREG_SPLIT_NO_EMPTY) as $line) {
// Split long lines
// The total length of a GEDCOM line, including level number, cross-reference number,
// tag, value, delimiters, and terminator, must not exceed 255 (wide) characters.
if (mb_strlen($line) > WT_GEDCOM_LINE_LENGTH) {
- list($level, $tag)=explode(' ', $line, 3);
+ list($level, $tag) = explode(' ', $line, 3);
if ($tag != 'CONT' && $tag != 'CONC') {
$level++;
}
do {
// Split after $pos chars
- $pos=WT_GEDCOM_LINE_LENGTH;
+ $pos = WT_GEDCOM_LINE_LENGTH;
if ($WORD_WRAPPED_NOTES) {
// Split on a space, and remove it (for compatibility with some desktop apps)
- while ($pos && mb_substr($line, $pos-1, 1)!=' ') {
+ while ($pos && mb_substr($line, $pos - 1, 1) != ' ') {
--$pos;
}
if ($pos == strpos($line, ' ', 3) + 1) {
// No spaces in the data! Can’t split it :-(
break;
} else {
- $newrec .= mb_substr($line, 0, $pos - 1).WT_EOL;
- $line=$level.' CONC ' . mb_substr($line, $pos);
+ $newrec .= mb_substr($line, 0, $pos - 1) . WT_EOL;
+ $line = $level . ' CONC ' . mb_substr($line, $pos);
}
} else {
// Split on a non-space (standard gedcom behaviour)
- while ($pos && mb_substr($line, $pos-1, 1) == ' ') {
+ while ($pos && mb_substr($line, $pos - 1, 1) == ' ') {
--$pos;
}
if ($pos == strpos($line, ' ', 3)) {
@@ -115,19 +115,19 @@ function gedcom_header($gedfile) {
$COPR = $fact->getValue();
}
// Link to actual SUBM/SUBN records, if they exist
- $subn=
+ $subn =
WT_DB::prepare("SELECT o_id FROM `##other` WHERE o_type=? AND o_file=?")
->execute(array('SUBN', $ged_id))
->fetchOne();
if ($subn) {
- $SUBN="\n1 SUBN @{$subn}@";
+ $SUBN = "\n1 SUBN @{$subn}@";
}
- $subm=
+ $subm =
WT_DB::prepare("SELECT o_id FROM `##other` WHERE o_type=? AND o_file=?")
->execute(array('SUBM', $ged_id))
->fetchOne();
if ($subm) {
- $SUBM="\n1 SUBM @{$subm}@";
+ $SUBM = "\n1 SUBM @{$subm}@";
}
return $HEAD . $SOUR . $DEST . $DATE . $GEDC . $CHAR . $FILE . $COPR . $LANG . $PLAC . $SUBN . $SUBM . "\n";
@@ -143,20 +143,20 @@ function gedcom_header($gedfile) {
*/
function convert_media_path($rec, $path) {
if ($path && preg_match('/\n1 FILE (.+)/', $rec, $match)) {
- $old_file_name=$match[1];
+ $old_file_name = $match[1];
// Don’t modify external links
if (!preg_match('~^(https?|ftp):~', $old_file_name)) {
// Adding a windows path? Convert the slashes.
- if (strpos($path, '\\')!==false) {
- $new_file_name=preg_replace('~/+~', '\\', $old_file_name);
+ if (strpos($path, '\\') !== false) {
+ $new_file_name = preg_replace('~/+~', '\\', $old_file_name);
} else {
- $new_file_name=$old_file_name;
+ $new_file_name = $old_file_name;
}
// Path not present - add it.
- if (strpos($new_file_name, $path)===false) {
- $new_file_name=$path . $new_file_name;
+ if (strpos($new_file_name, $path) === false) {
+ $new_file_name = $path . $new_file_name;
}
- $rec=str_replace("\n1 FILE ".$old_file_name, "\n1 FILE ".$new_file_name, $rec);
+ $rec = str_replace("\n1 FILE " . $old_file_name, "\n1 FILE " . $new_file_name, $rec);
}
}
@@ -183,7 +183,7 @@ function export_gedcom($gedcom, $gedout, $exportOptions) {
$GEDCOM = $gedcom;
$ged_id = get_id_from_gedcom($gedcom);
- switch($exportOptions['privatize']) {
+ switch ($exportOptions['privatize']) {
case 'gedadmin':
$access_level = WT_PRIV_NONE;
break;
@@ -213,7 +213,7 @@ function export_gedcom($gedcom, $gedout, $exportOptions) {
// database queries, and we wish to avoid large gaps between queries due to MySQL connection timeouts.
$tmp_gedcom = '';
$rows = WT_DB::prepare(
- "SELECT 'OBJE' AS type, m_id AS xref, m_file AS gedcom_id, m_gedcom AS gedcom".
+ "SELECT 'OBJE' AS type, m_id AS xref, m_file AS gedcom_id, m_gedcom AS gedcom" .
" FROM `##media` WHERE m_file=? ORDER BY m_id"
)->execute(array($ged_id))->fetchAll();
foreach ($rows as $row) {
@@ -226,7 +226,7 @@ function export_gedcom($gedcom, $gedout, $exportOptions) {
}
$rows = WT_DB::prepare(
- "SELECT s_id AS xref, s_file AS gedcom_id, s_gedcom AS gedcom".
+ "SELECT s_id AS xref, s_file AS gedcom_id, s_gedcom AS gedcom" .
" FROM `##sources` WHERE s_file=? ORDER BY s_id"
)->execute(array($ged_id))->fetchAll();
foreach ($rows as $row) {
@@ -238,7 +238,7 @@ function export_gedcom($gedcom, $gedout, $exportOptions) {
}
$rows = WT_DB::prepare(
- "SELECT o_type AS type, o_id AS xref, o_file AS gedcom_id, o_gedcom AS gedcom".
+ "SELECT o_type AS type, o_id AS xref, o_file AS gedcom_id, o_gedcom AS gedcom" .
" FROM `##other` WHERE o_file=? AND o_type!='HEAD' AND o_type!='TRLR' ORDER BY o_id"
)->execute(array($ged_id))->fetchAll();
foreach ($rows as $row) {
@@ -262,12 +262,12 @@ function export_gedcom($gedcom, $gedout, $exportOptions) {
}
$rows = WT_DB::prepare(
- "SELECT i_id AS xref, i_file AS gedcom_id, i_gedcom AS gedcom".
+ "SELECT i_id AS xref, i_file AS gedcom_id, i_gedcom AS gedcom" .
" FROM `##individuals` WHERE i_file=? ORDER BY i_id"
)->execute(array($ged_id))->fetchAll();
foreach ($rows as $row) {
$rec = WT_Individual::getInstance($row->xref, $row->gedcom_id, $row->gedcom)->privatizeGedcom($access_level);
- if ($exportOptions['toANSI'] == 'yes') {
+ if ($exportOptions['toANSI'] == 'yes') {
$rec = utf8_decode($rec);
}
$buffer .= reformat_record_export($rec);
@@ -278,7 +278,7 @@ function export_gedcom($gedcom, $gedout, $exportOptions) {
}
$rows = WT_DB::prepare(
- "SELECT f_id AS xref, f_file AS gedcom_id, f_gedcom AS gedcom".
+ "SELECT f_id AS xref, f_file AS gedcom_id, f_gedcom AS gedcom" .
" FROM `##families` WHERE f_file=? ORDER BY f_id"
)->execute(array($ged_id))->fetchAll();
foreach ($rows as $row) {
diff --git a/includes/functions/functions_mediadb.php b/includes/functions/functions_mediadb.php
index 609a88481c..45b1a77b38 100644
--- a/includes/functions/functions_mediadb.php
+++ b/includes/functions/functions_mediadb.php
@@ -38,15 +38,15 @@ function return_bytes($val) {
switch (substr($val, -1)) {
case 'g':
case 'G':
- return (int)$val * 1024 * 1024 * 1024;
+ return (int) $val * 1024 * 1024 * 1024;
case 'm':
case 'M':
- return (int)$val * 1024 * 1024;
+ return (int) $val * 1024 * 1024;
case 'k':
case 'K':
- return (int)$val * 1024;
+ return (int) $val * 1024;
default:
- return (int)$val;
+ return (int) $val;
}
}
@@ -66,7 +66,7 @@ function hasMemoryForImage($serverFilename) {
}
// find out how much memory we are already using
- $memoryUsed=memory_get_usage();
+ $memoryUsed = memory_get_usage();
$imgsize = @getimagesize($serverFilename);
// find out how much memory this image needs for processing, probably only works for jpegs
@@ -79,8 +79,8 @@ function hasMemoryForImage($serverFilename) {
return true;
} else {
// not enough memory to load this file
- $image_info = sprintf('%.2fKB, %d × %d %d bits %d channels', filesize($serverFilename)/1024, $imgsize[0], $imgsize[1], $imgsize['bits'], $imgsize['channels']);
- Log::addMediaLog('Cannot create thumbnail '.$serverFilename.' ('.$image_info.') memory avail: '.$memoryAvailable.' used: '.$memoryUsed.' needed: '.$memoryNeeded.' spare: '.$memorySpare);
+ $image_info = sprintf('%.2fKB, %d × %d %d bits %d channels', filesize($serverFilename) / 1024, $imgsize[0], $imgsize[1], $imgsize['bits'], $imgsize['channels']);
+ Log::addMediaLog('Cannot create thumbnail ' . $serverFilename . ' (' . $image_info . ') memory avail: ' . $memoryAvailable . ' used: ' . $memoryUsed . ' needed: ' . $memoryNeeded . ' spare: ' . $memorySpare);
return false;
}
} else {
diff --git a/includes/functions/functions_print.php b/includes/functions/functions_print.php
index f16f3c5b43..22d25ce3a8 100644
--- a/includes/functions/functions_print.php
+++ b/includes/functions/functions_print.php
@@ -64,13 +64,13 @@ function print_pedigree_person(WT_Individual $person = null, $style = 1) {
*
* @return string
*/
-function print_note_record($text, $nlevel, $nrec, $textOnly=false) {
+function print_note_record($text, $nlevel, $nrec, $textOnly = false) {
global $WT_TREE;
$text .= get_cont($nlevel, $nrec);
// Check if shared note (we have already checked that it exists)
- if (preg_match('/^0 @('.WT_REGEX_XREF.')@ NOTE/', $nrec, $match)) {
+ if (preg_match('/^0 @(' . WT_REGEX_XREF . ')@ NOTE/', $nrec, $match)) {
$note = WT_Note::getInstance($match[1]);
$label = 'SHARED_NOTE';
// If Census assistant installed, allow it to format the note
@@ -128,21 +128,21 @@ function print_note_record($text, $nlevel, $nrec, $textOnly=false) {
*
* @return string HTML
*/
-function print_fact_notes($factrec, $level, $textOnly=false) {
+function print_fact_notes($factrec, $level, $textOnly = false) {
$data = "";
$previous_spos = 0;
- $nlevel = $level+1;
+ $nlevel = $level + 1;
$ct = preg_match_all("/$level NOTE (.*)/", $factrec, $match, PREG_SET_ORDER);
- for ($j=0; $j<$ct; $j++) {
+ for ($j = 0; $j < $ct; $j++) {
$spos1 = strpos($factrec, $match[$j][0], $previous_spos);
- $spos2 = strpos($factrec."\n$level", "\n$level", $spos1+1);
+ $spos2 = strpos($factrec . "\n$level", "\n$level", $spos1 + 1);
if (!$spos2) {
$spos2 = strlen($factrec);
}
$previous_spos = $spos2;
- $nrec = substr($factrec, $spos1, $spos2-$spos1);
+ $nrec = substr($factrec, $spos1, $spos2 - $spos1);
if (!isset($match[$j][1])) {
- $match[$j][1]="";
+ $match[$j][1] = "";
}
if (!preg_match("/@(.*)@/", $match[$j][1], $nmatch)) {
$data .= print_note_record($match[$j][1], $nlevel, $nrec, $textOnly);
@@ -152,20 +152,20 @@ function print_fact_notes($factrec, $level, $textOnly=false) {
if ($note->canShow()) {
$noterec = $note->getGedcom();
$nt = preg_match("/0 @$nmatch[1]@ NOTE (.*)/", $noterec, $n1match);
- $data .= print_note_record(($nt>0)?$n1match[1]:"", 1, $noterec, $textOnly);
+ $data .= print_note_record(($nt > 0) ? $n1match[1] : "", 1, $noterec, $textOnly);
if (!$textOnly) {
- if (strpos($noterec, "1 SOUR")!==false) {
- require_once WT_ROOT.'includes/functions/functions_print_facts.php';
+ if (strpos($noterec, "1 SOUR") !== false) {
+ require_once WT_ROOT . 'includes/functions/functions_print_facts.php';
$data .= print_fact_sources($noterec, 1);
}
}
}
} else {
- $data='<div class="fact_NOTE"><span class="label">'.WT_I18N::translate('Note').'</span>: <span class="field error">'.$nmatch[1].'</span></div>';
+ $data = '<div class="fact_NOTE"><span class="label">' . WT_I18N::translate('Note') . '</span>: <span class="field error">' . $nmatch[1] . '</span></div>';
}
}
if (!$textOnly) {
- if (strpos($factrec, "$nlevel SOUR")!==false) {
+ if (strpos($factrec, "$nlevel SOUR") !== false) {
$data .= "<div class=\"indent\">";
$data .= print_fact_sources($nrec, $nlevel);
$data .= "</div>";
@@ -183,8 +183,8 @@ function print_fact_notes($factrec, $level, $textOnly=false) {
*
* @return string
*/
-function help_link($help_topic, $module='') {
- return '<span class="icon-help" onclick="helpDialog(\''.$help_topic.'\',\''.$module.'\'); return false;">&nbsp;</span>';
+function help_link($help_topic, $module = '') {
+ return '<span class="icon-help" onclick="helpDialog(\'' . $help_topic . '\',\'' . $module . '\'); return false;">&nbsp;</span>';
}
/**
@@ -195,7 +195,7 @@ function help_link($help_topic, $module='') {
* @return string
*/
function wiki_help_link($topic) {
- return '<a class="help icon-wiki" href="'.WT_WEBTREES_WIKI.$topic.'" title="'.WT_I18N::translate('webtrees wiki').'" target="_blank">&nbsp;</a>';
+ return '<a class="help icon-wiki" href="' . WT_WEBTREES_WIKI . $topic . '" title="' . WT_I18N::translate('webtrees wiki') . '" target="_blank">&nbsp;</a>';
}
/**
@@ -214,14 +214,14 @@ function highlight_search_hits($string) {
// e.g. searching for "FOO BAR" will find records containing both FOO and BAR.
// However, we only highlight the original search string, not the search terms.
// The controller needs to provide its "query_terms" array.
- $regex=array();
+ $regex = array();
foreach (array($controller->query) as $search_term) {
- $regex[]=preg_quote($search_term, '/');
+ $regex[] = preg_quote($search_term, '/');
}
// Match these strings, provided they do not occur inside HTML tags
- $regex='('.implode('|', $regex).')(?![^<]*>)';
+ $regex = '(' . implode('|', $regex) . ')(?![^<]*>)';
- return preg_replace('/'.$regex.'/i', '<span class="search_hit">$1</span>', $string);
+ return preg_replace('/' . $regex . '/i', '<span class="search_hit">$1</span>', $string);
} else {
return $string;
}
@@ -250,8 +250,8 @@ function format_asso_rela_record(WT_Fact $event) {
return '';
}
- preg_match_all('/^1 ASSO @('.WT_REGEX_XREF.')@((\n[2-9].*)*)/', $event->getGedcom(), $amatches1, PREG_SET_ORDER);
- preg_match_all('/\n2 _?ASSO @('.WT_REGEX_XREF.')@((\n[3-9].*)*)/', $event->getGedcom(), $amatches2, PREG_SET_ORDER);
+ preg_match_all('/^1 ASSO @(' . WT_REGEX_XREF . ')@((\n[2-9].*)*)/', $event->getGedcom(), $amatches1, PREG_SET_ORDER);
+ preg_match_all('/\n2 _?ASSO @(' . WT_REGEX_XREF . ')@((\n[3-9].*)*)/', $event->getGedcom(), $amatches2, PREG_SET_ORDER);
$html = '';
// For each ASSO record
@@ -306,41 +306,41 @@ function format_asso_rela_record(WT_Fact $event) {
* @return string HTML
*/
function format_parents_age(WT_Individual $person, WT_Date $birth_date) {
- $html='';
- $families=$person->getChildFamilies();
+ $html = '';
+ $families = $person->getChildFamilies();
// Multiple sets of parents (e.g. adoption) cause complications, so ignore.
- if ($birth_date->isOK() && count($families)==1) {
- $family=current($families);
+ if ($birth_date->isOK() && count($families) == 1) {
+ $family = current($families);
foreach ($family->getSpouses() as $parent) {
if ($parent->getBirthDate()->isOK()) {
- $sex=$parent->getSexImage();
- $age=WT_Date::getAge($parent->getBirthDate(), $birth_date, 2);
- $deatdate=$parent->getDeathDate();
+ $sex = $parent->getSexImage();
+ $age = WT_Date::getAge($parent->getBirthDate(), $birth_date, 2);
+ $deatdate = $parent->getDeathDate();
switch ($parent->getSex()) {
case 'F':
// Highlight mothers who die in childbirth or shortly afterwards
- if ($deatdate->isOK() && $deatdate->MinJD()<$birth_date->MinJD()+90) {
- $html.=' <span title="'.WT_Gedcom_Tag::getLabel('_DEAT_PARE', $parent).'" class="parentdeath">'.$sex.$age.'</span>';
+ if ($deatdate->isOK() && $deatdate->MinJD() < $birth_date->MinJD() + 90) {
+ $html .= ' <span title="' . WT_Gedcom_Tag::getLabel('_DEAT_PARE', $parent) . '" class="parentdeath">' . $sex . $age . '</span>';
} else {
- $html.=' <span title="'.WT_I18N::translate('Mother’s age').'">'.$sex.$age.'</span>';
+ $html .= ' <span title="' . WT_I18N::translate('Mother’s age') . '">' . $sex . $age . '</span>';
}
break;
case 'M':
// Highlight fathers who die before the birth
- if ($deatdate->isOK() && $deatdate->MinJD()<$birth_date->MinJD()) {
- $html.=' <span title="'.WT_Gedcom_Tag::getLabel('_DEAT_PARE', $parent).'" class="parentdeath">'.$sex.$age.'</span>';
+ if ($deatdate->isOK() && $deatdate->MinJD() < $birth_date->MinJD()) {
+ $html .= ' <span title="' . WT_Gedcom_Tag::getLabel('_DEAT_PARE', $parent) . '" class="parentdeath">' . $sex . $age . '</span>';
} else {
- $html.=' <span title="'.WT_I18N::translate('Father’s age').'">'.$sex.$age.'</span>';
+ $html .= ' <span title="' . WT_I18N::translate('Father’s age') . '">' . $sex . $age . '</span>';
}
break;
default:
- $html.=' <span title="'.WT_I18N::translate('Parent’s age').'">'.$sex.$age.'</span>';
+ $html .= ' <span title="' . WT_I18N::translate('Parent’s age') . '">' . $sex . $age . '</span>';
break;
}
}
}
if ($html) {
- $html='<span class="age">'.$html.'</span>';
+ $html = '<span class="age">' . $html . '</span>';
}
}
return $html;
@@ -495,7 +495,7 @@ function format_fact_date(WT_Fact $event, WT_GedcomRecord $record, $anchor, $tim
*
* @return string HTML
*/
-function format_fact_place(WT_Fact $event, $anchor=false, $sub_records=false, $lds=false) {
+function format_fact_place(WT_Fact $event, $anchor = false, $sub_records = false, $lds = false) {
global $SEARCH_SPIDER;
if ($anchor) {
@@ -515,14 +515,14 @@ function format_fact_place(WT_Fact $event, $anchor=false, $sub_records=false, $l
if (!empty($placerec)) {
if (preg_match_all('/\n3 (?:_HEB|ROMN) (.+)/', $placerec, $matches)) {
foreach ($matches[1] as $match) {
- $wt_place=new WT_Place($match, WT_GED_ID);
- $html.=' - ' . $wt_place->getFullName();
+ $wt_place = new WT_Place($match, WT_GED_ID);
+ $html .= ' - ' . $wt_place->getFullName();
}
}
- $map_lati="";
+ $map_lati = "";
$cts = preg_match('/\d LATI (.*)/', $placerec, $match);
- if ($cts>0) {
- $map_lati=$match[1];
+ if ($cts > 0) {
+ $map_lati = $match[1];
$html .= '<br><span class="label">' . WT_Gedcom_Tag::getLabel('LATI') . ': </span>' . $map_lati;
}
$map_long = '';
@@ -545,13 +545,13 @@ function format_fact_place(WT_Fact $event, $anchor=false, $sub_records=false, $l
}
if ($lds) {
if (preg_match('/2 TEMP (.*)/', $event->getGedcom(), $match)) {
- $html.='<br>'.WT_I18N::translate('LDS temple').': '.WT_Gedcom_Code_Temp::templeName($match[1]);
+ $html .= '<br>' . WT_I18N::translate('LDS temple') . ': ' . WT_Gedcom_Code_Temp::templeName($match[1]);
}
if (preg_match('/2 STAT (.*)/', $event->getGedcom(), $match)) {
- $html.='<br>'.WT_I18N::translate('Status').': '.WT_Gedcom_Code_Stat::statusName($match[1]);
+ $html .= '<br>' . WT_I18N::translate('Status') . ': ' . WT_Gedcom_Code_Stat::statusName($match[1]);
if (preg_match('/3 DATE (.*)/', $event->getGedcom(), $match)) {
- $date=new WT_Date($match[1]);
- $html.=', '.WT_Gedcom_Tag::getLabel('STAT:DATE').': '.$date->display();
+ $date = new WT_Date($match[1]);
+ $html .= ', ' . WT_Gedcom_Tag::getLabel('STAT:DATE') . ': ' . $date->display();
}
}
}
@@ -570,7 +570,7 @@ function format_fact_place(WT_Fact $event, $anchor=false, $sub_records=false, $l
*/
function CheckFactUnique($uniquefacts, $recfacts, $type) {
foreach ($recfacts as $factarray) {
- $fact=false;
+ $fact = false;
if (is_object($factarray)) {
/* @var $factarray Event */
$fact = $factarray->getTag();
@@ -611,7 +611,7 @@ function print_add_new_fact($id, $usedfacts, $type) {
if ($WT_SESSION->clipboard) {
$newRow = true;
foreach (array_reverse($WT_SESSION->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><td class="descriptionbox">';
@@ -622,7 +622,7 @@ function print_add_new_fact($id, $usedfacts, $type) {
echo '<option value="', WT_Filter::escapeHtml($fact_id), '">', WT_Gedcom_Tag::getLabel($fact['fact']);
// TODO use the event class to store/parse the clipboard events
if (preg_match('/^2 DATE (.+)/m', $fact['factrec'], $match)) {
- $tmp=new WT_Date($match[1]);
+ $tmp = new WT_Date($match[1]);
echo '; ', $tmp->minDate()->format('%Y');
}
if (preg_match('/^2 PLAC ([^,\n]+)/m', $fact['factrec'], $match)) {
@@ -641,40 +641,40 @@ function print_add_new_fact($id, $usedfacts, $type) {
// -- 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);
+ $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);
+ $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);
+ $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);
+ $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);
+ $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;
}
- $addfacts=array_merge(CheckFactUnique($uniquefacts, $usedfacts, $type), $addfacts);
- $quickfacts=array_intersect($quickfacts, $addfacts);
- $translated_addfacts=array();
+ $addfacts = array_merge(CheckFactUnique($uniquefacts, $usedfacts, $type), $addfacts);
+ $quickfacts = array_intersect($quickfacts, $addfacts);
+ $translated_addfacts = array();
foreach ($addfacts as $addfact) {
$translated_addfacts[$addfact] = WT_Gedcom_Tag::getLabel($addfact);
}
- uasort($translated_addfacts, function ($x, $y) {
+ uasort($translated_addfacts, function($x, $y) {
return WT_I18N::strcasecmp(WT_I18N::translate($x), WT_I18N::translate($y));
});
echo '<tr><td class="descriptionbox">';
@@ -692,10 +692,10 @@ function print_add_new_fact($id, $usedfacts, $type) {
echo '<option value="EVEN">', WT_I18N::translate('Custom event'), '</option>';
}
echo '</select>';
- echo '<input type="button" value="', WT_I18N::translate('Add'), '" onclick="add_record(\''.$id.'\', \'newfact\');">';
+ echo '<input type="button" value="', WT_I18N::translate('Add'), '" onclick="add_record(\'' . $id . '\', \'newfact\');">';
echo '<span class="quickfacts">';
foreach ($quickfacts as $fact) {
- echo '<a href="#" onclick="add_new_record(\''.$id.'\', \''.$fact.'\');return false;">', WT_Gedcom_Tag::getLabel($fact), '</a>';
+ echo '<a href="#" onclick="add_new_record(\'' . $id . '\', \'' . $fact . '\');return false;">', WT_Gedcom_Tag::getLabel($fact), '</a>';
}
echo '</span></form>';
echo '</td></tr>';
@@ -742,8 +742,8 @@ function init_calendar_popup() {
*
* @return string
*/
-function print_findindi_link($element_id, $indiname='', $ged=WT_GEDCOM) {
- return '<a href="#" onclick="findIndi(document.getElementById(\''.$element_id.'\'), document.getElementById(\''.$indiname.'\'), \'' . WT_Filter::escapeHtml($ged) . '\'); return false;" class="icon-button_indi" title="'.WT_I18N::translate('Find an individual').'"></a>';
+function print_findindi_link($element_id, $indiname = '', $ged = WT_GEDCOM) {
+ return '<a href="#" onclick="findIndi(document.getElementById(\'' . $element_id . '\'), document.getElementById(\'' . $indiname . '\'), \'' . WT_Filter::escapeHtml($ged) . '\'); return false;" class="icon-button_indi" title="' . WT_I18N::translate('Find an individual') . '"></a>';
}
/**
@@ -752,7 +752,7 @@ function print_findindi_link($element_id, $indiname='', $ged=WT_GEDCOM) {
* @return string
*/
function print_findplace_link($element_id) {
- return '<a href="#" onclick="findPlace(document.getElementById(\''.$element_id.'\'), WT_GEDCOM); return false;" class="icon-button_place" title="'.WT_I18N::translate('Find a place').'"></a>';
+ return '<a href="#" onclick="findPlace(document.getElementById(\'' . $element_id . '\'), WT_GEDCOM); return false;" class="icon-button_place" title="' . WT_I18N::translate('Find a place') . '"></a>';
}
/**
@@ -761,7 +761,7 @@ function print_findplace_link($element_id) {
* @return string
*/
function print_findfamily_link($element_id) {
- return '<a href="#" onclick="findFamily(document.getElementById(\''.$element_id.'\'), WT_GEDCOM); return false;" class="icon-button_family" title="'.WT_I18N::translate('Find a family').'"></a>';
+ return '<a href="#" onclick="findFamily(document.getElementById(\'' . $element_id . '\'), WT_GEDCOM); return false;" class="icon-button_family" title="' . WT_I18N::translate('Find a family') . '"></a>';
}
/**
@@ -770,7 +770,7 @@ function print_findfamily_link($element_id) {
* @return string
*/
function print_specialchar_link($element_id) {
- return '<span onclick="findSpecialChar(document.getElementById(\''.$element_id.'\')); if (window.updatewholename) { updatewholename(); } return false;" class="icon-button_keyboard" title="'.WT_I18N::translate('Find a special character').'"></span>';
+ return '<span onclick="findSpecialChar(document.getElementById(\'' . $element_id . '\')); if (window.updatewholename) { updatewholename(); } return false;" class="icon-button_keyboard" title="' . WT_I18N::translate('Find a special character') . '"></span>';
}
/**
@@ -793,8 +793,8 @@ function print_autopaste_link($element_id, $choices) {
*
* @return string
*/
-function print_findsource_link($element_id, $sourcename='') {
- return '<a href="#" onclick="findSource(document.getElementById(\''.$element_id.'\'), document.getElementById(\''.$sourcename.'\'), WT_GEDCOM); return false;" class="icon-button_source" title="'.WT_I18N::translate('Find a source').'"></a>';
+function print_findsource_link($element_id, $sourcename = '') {
+ return '<a href="#" onclick="findSource(document.getElementById(\'' . $element_id . '\'), document.getElementById(\'' . $sourcename . '\'), WT_GEDCOM); return false;" class="icon-button_source" title="' . WT_I18N::translate('Find a source') . '"></a>';
}
/**
@@ -803,8 +803,8 @@ function print_findsource_link($element_id, $sourcename='') {
*
* @return string
*/
-function print_findnote_link($element_id, $notename='') {
- return '<a href="#" onclick="findnote(document.getElementById(\''.$element_id.'\'), document.getElementById(\''.$notename.'\'), \'WT_GEDCOM\'); return false;" class="icon-button_find" title="'.WT_I18N::translate('Find a shared note').'"></a>';
+function print_findnote_link($element_id, $notename = '') {
+ return '<a href="#" onclick="findnote(document.getElementById(\'' . $element_id . '\'), document.getElementById(\'' . $notename . '\'), \'WT_GEDCOM\'); return false;" class="icon-button_find" title="' . WT_I18N::translate('Find a shared note') . '"></a>';
}
/**
@@ -813,7 +813,7 @@ function print_findnote_link($element_id, $notename='') {
* @return string
*/
function print_findrepository_link($element_id) {
- return '<a href="#" onclick="findRepository(document.getElementById(\''.$element_id.'\'), WT_GEDCOM); return false;" class="icon-button_repository" title="'.WT_I18N::translate('Find a repository').'"></a>';
+ return '<a href="#" onclick="findRepository(document.getElementById(\'' . $element_id . '\'), WT_GEDCOM); return false;" class="icon-button_repository" title="' . WT_I18N::translate('Find a repository') . '"></a>';
}
/**
@@ -822,8 +822,8 @@ function print_findrepository_link($element_id) {
*
* @return string
*/
-function print_findmedia_link($element_id, $choose='') {
- return '<a href="#" onclick="findMedia(document.getElementById(\''.$element_id.'\'), \''.$choose.'\', WT_GEDCOM); return false;" class="icon-button_media" title="'.WT_I18N::translate('Find a media object').'"></a>';
+function print_findmedia_link($element_id, $choose = '') {
+ return '<a href="#" onclick="findMedia(document.getElementById(\'' . $element_id . '\'), \'' . $choose . '\', WT_GEDCOM); return false;" class="icon-button_media" title="' . WT_I18N::translate('Find a media object') . '"></a>';
}
/**
@@ -832,7 +832,7 @@ function print_findmedia_link($element_id, $choose='') {
* @return string
*/
function print_findfact_link($element_id) {
- return '<a href="#" onclick="findFact(document.getElementById(\''.$element_id.'\'), WT_GEDCOM); return false;" class="icon-button_find_facts" title="'.WT_I18N::translate('Find a fact or event').'"></a>';
+ return '<a href="#" onclick="findFact(document.getElementById(\'' . $element_id . '\'), WT_GEDCOM); return false;" class="icon-button_find_facts" title="' . WT_I18N::translate('Find a fact or event') . '"></a>';
}
/**
diff --git a/includes/functions/functions_print_facts.php b/includes/functions/functions_print_facts.php
index 1963a78753..6bea4ea0a0 100644
--- a/includes/functions/functions_print_facts.php
+++ b/includes/functions/functions_print_facts.php
@@ -370,8 +370,11 @@ function print_fact(WT_Fact $fact, WT_GedcomRecord $record) {
foreach (preg_split('/ *, */', $match[2]) as $event) {
$events[]=WT_Gedcom_Tag::getLabel($event);
}
- if (count($events)==1) echo WT_Gedcom_Tag::getLabelValue('EVEN', $event);
- else echo WT_Gedcom_Tag::getLabelValue('EVEN', implode(WT_I18N::$list_separator, $events));
+ if (count($events)==1) {
+ echo WT_Gedcom_Tag::getLabelValue('EVEN', $event);
+ } else {
+ echo WT_Gedcom_Tag::getLabelValue('EVEN', implode(WT_I18N::$list_separator, $events));
+ }
if (preg_match('/\n3 DATE (.+)/', $fact->getGedcom(), $date_match)) {
$date=new WT_Date($date_match[1]);
echo WT_Gedcom_Tag::getLabelValue('DATE', $date->display());
@@ -617,7 +620,9 @@ function print_media_links($factrec, $level) {
$famid = trim($match[1]);
$family = WT_Family::getInstance($famid);
if ($family) {
- if ($spouse) echo " - ";
+ if ($spouse) {
+ echo " - ";
+ }
echo '<a href="', $family->getHtmlUrl(), '">', WT_I18N::translate('View family'), '</a>';
}
}
@@ -668,15 +673,22 @@ function print_main_sources(WT_Fact $fact, $level) {
$sid = trim($match[$j][2], '@');
$spos1 = strpos($factrec, $match[$j][1], $spos2);
$spos2 = strpos($factrec, "\n$level", $spos1);
- if (!$spos2) $spos2 = strlen($factrec);
+ if (!$spos2) {
+ $spos2 = strlen($factrec);
+ }
$srec = substr($factrec, $spos1, $spos2-$spos1);
$source=WT_Source::getInstance($sid);
// Allow access to "1 SOUR @non_existent_source@", so it can be corrected/deleted
if (!$source || $source->canShow()) {
- if ($level>1) echo '<tr class="row_sour2">';
- else echo '<tr>';
+ if ($level>1) {
+ echo '<tr class="row_sour2">';
+ } else {
+ echo '<tr>';
+ }
echo '<td class="descriptionbox';
- if ($level>1) echo ' rela';
+ if ($level>1) {
+ echo ' rela';
+ }
echo ' ', $styleadd, ' width20">';
$factlines = explode("\n", $factrec); // 1 BIRT Y\n2 SOUR ...
$factwords = explode(" ", $factlines[0]); // 1 BIRT Y
@@ -694,7 +706,9 @@ function print_main_sources(WT_Fact $fact, $level) {
if ($can_edit) {
echo "<a onclick=\"return edit_record('$pid', '$fact_id');\" href=\"#\" title=\"", WT_I18N::translate('Edit'), '">';
if ($SHOW_FACT_ICONS) {
- if ($level==1) echo '<i class="icon-source"></i> ';
+ if ($level==1) {
+ echo '<i class="icon-source"></i> ';
+ }
}
echo WT_Gedcom_Tag::getLabel($factname, $parent), '</a>';
echo '<div class="editfacts">';
@@ -749,7 +763,9 @@ function print_main_sources(WT_Fact $fact, $level) {
if ($cs>0) {
echo '<br><span class="label">', WT_Gedcom_Tag::getLabel('EVEN'), ' </span><span class="field">', $cmatch[1], '</span>';
$cs = preg_match("/".($nlevel+1)." ROLE (.*)/", $srec, $cmatch);
- if ($cs>0) echo '<br>&nbsp;&nbsp;&nbsp;&nbsp;<span class="label">', WT_Gedcom_Tag::getLabel('ROLE'), ' </span><span class="field">', $cmatch[1], '</span>';
+ if ($cs>0) {
+ echo '<br>&nbsp;&nbsp;&nbsp;&nbsp;<span class="label">', WT_Gedcom_Tag::getLabel('ROLE'), ' </span><span class="field">', $cmatch[1], '</span>';
+ }
}
echo printSourceStructure(getSourceStructure($srec));
echo '<div class="indent">';
@@ -850,7 +866,9 @@ function getSourceStructure($srec) {
$i--;
break;
}
- if ($nextTag=='CONT') $text .= "\n";
+ if ($nextTag=='CONT') {
+ $text .= "\n";
+ }
$text .= rtrim(substr($subrecords[$i], 7));
}
if ($tag=='TEXT') {
@@ -1085,7 +1103,9 @@ function print_main_media(WT_Fact $fact, $level) {
}
echo '<em>';
foreach ($media->getAllNames() as $name) {
- if ($name['type']!='TITL') echo '<br>';
+ if ($name['type']!='TITL') {
+ echo '<br>';
+ }
echo $name['full'];
}
echo '</em>';
diff --git a/includes/functions/functions_print_lists.php b/includes/functions/functions_print_lists.php
index a2523dc5a7..8675530d56 100644
--- a/includes/functions/functions_print_lists.php
+++ b/includes/functions/functions_print_lists.php
@@ -296,7 +296,7 @@ function format_indi_table($datalist, $option = '') {
</tfoot>
<tbody>';
- $d100y = new WT_Date(date('Y') - 100); // 100 years ago
+ $d100y = new WT_Date(date('Y') - 100); // 100 years ago
$unique_indis = array(); // Don't double-count indis with multiple names.
foreach ($datalist as $key => $person) {
if (!$person->canShowName()) {
@@ -355,7 +355,7 @@ function format_indi_table($datalist, $option = '') {
$html .= $birth_date->Display(!$SEARCH_SPIDER);
}
if ($birth_dates[0]->gregorianYear() >= 1550 && $birth_dates[0]->gregorianYear() < 2030 && !isset($unique_indis[$person->getXref()])) {
- $birt_by_decade[(int)($birth_dates[0]->gregorianYear() / 10) * 10] .= $person->getSex();
+ $birt_by_decade[(int) ($birth_dates[0]->gregorianYear() / 10) * 10] .= $person->getSex();
}
} else {
$birth_date = $person->getEstimatedBirthDate();
@@ -399,7 +399,7 @@ function format_indi_table($datalist, $option = '') {
$html .= $death_date->Display(!$SEARCH_SPIDER);
}
if ($death_dates[0]->gregorianYear() >= 1550 && $death_dates[0]->gregorianYear() < 2030 && !isset($unique_indis[$person->getXref()])) {
- $deat_by_decade[(int)($death_dates[0]->gregorianYear() / 10) * 10] .= $person->getSex();
+ $deat_by_decade[(int) ($death_dates[0]->gregorianYear() / 10) * 10] .= $person->getSex();
}
} else {
$death_date = $person->getEstimatedDeathDate();
@@ -776,7 +776,7 @@ function format_fam_table($datalist) {
</tfoot>
<tbody>';
- $d100y = new WT_Date(date('Y') - 100); // 100 years ago
+ $d100y = new WT_Date(date('Y') - 100); // 100 years ago
foreach ($datalist as $family) {
//-- Retrieve husband and wife
$husb = $family->getHusband();
@@ -835,7 +835,7 @@ function format_fam_table($datalist) {
$hdate = $husb->getBirthDate();
if ($hdate->isOK() && $mdate->isOK()) {
if ($hdate->gregorianYear() >= 1550 && $hdate->gregorianYear() < 2030) {
- $birt_by_decade[(int)($hdate->gregorianYear() / 10) * 10] .= $husb->getSex();
+ $birt_by_decade[(int) ($hdate->gregorianYear() / 10) * 10] .= $husb->getSex();
}
$hage = WT_Date::getAge($hdate, $mdate, 0);
if ($hage >= 0 && $hage <= $max_age) {
@@ -881,7 +881,7 @@ function format_fam_table($datalist) {
$wdate = $wife->getBirthDate();
if ($wdate->isOK() && $mdate->isOK()) {
if ($wdate->gregorianYear() >= 1550 && $wdate->gregorianYear() < 2030) {
- $birt_by_decade[(int)($wdate->gregorianYear() / 10) * 10] .= $wife->getSex();
+ $birt_by_decade[(int) ($wdate->gregorianYear() / 10) * 10] .= $wife->getSex();
}
$wage = WT_Date::getAge($wdate, $mdate, 0);
if ($wage >= 0 && $wage <= $max_age) {
@@ -899,7 +899,7 @@ function format_fam_table($datalist) {
$html .= '<div>' . $marriage_date->Display(!$SEARCH_SPIDER) . '</div>';
}
if ($marriage_dates[0]->gregorianYear() >= 1550 && $marriage_dates[0]->gregorianYear() < 2030) {
- $marr_by_decade[(int)($marriage_dates[0]->gregorianYear() / 10) * 10] .= $husb->getSex() . $wife->getSex();
+ $marr_by_decade[(int) ($marriage_dates[0]->gregorianYear() / 10) * 10] .= $husb->getSex() . $wife->getSex();
}
} elseif ($family->getFacts('_NMR')) {
$html .= WT_I18N::translate('no');
@@ -1092,7 +1092,7 @@ function format_sour_table($datalist) {
$html .= '<th>#NOTE</th>';
$html .= '<th' . ($SHOW_LAST_CHANGE ? '' : '') . '>' . WT_Gedcom_Tag::getLabel('CHAN') . '</th>';
$html .= '<th' . ($SHOW_LAST_CHANGE ? '' : '') . '>CHAN</th>';
- $html .= '<th></th>';//delete
+ $html .= '<th></th>'; //delete
$html .= '</tr></thead>';
//-- table body
$html .= '<tbody>';
@@ -1228,7 +1228,7 @@ function format_note_table($datalist) {
$html .= '<th>#SOUR</th>';
$html .= '<th' . ($SHOW_LAST_CHANGE ? '' : '') . '>' . WT_Gedcom_Tag::getLabel('CHAN') . '</th>';
$html .= '<th' . ($SHOW_LAST_CHANGE ? '' : '') . '>CHAN</th>';
- $html .= '<th></th>';//delete
+ $html .= '<th></th>'; //delete
$html .= '</tr></thead>';
//-- table body
$html .= '<tbody>';
@@ -1331,7 +1331,7 @@ function format_repo_table($repositories) {
$html .= '<th>#SOUR</th>';
$html .= '<th' . ($SHOW_LAST_CHANGE ? '' : '') . '>' . WT_Gedcom_Tag::getLabel('CHAN') . '</th>';
$html .= '<th' . ($SHOW_LAST_CHANGE ? '' : '') . '>CHAN</th>';
- $html .= '<th></th>';//delete
+ $html .= '<th></th>'; //delete
$html .= '</tr></thead>';
//-- table body
$html .= '<tbody>';
@@ -1630,14 +1630,13 @@ function format_surname_tagcloud($surnames, $script, $totals) {
'weight' => count($indis),
'params' => array(
'url' => $surn ?
- $script . '?surname=' . urlencode($surn) . '&amp;ged=' . WT_GEDURL :
- $script . '?alpha=,&amp;ged=' . WT_GEDURL
+ $script . '?surname=' . urlencode($surn) . '&amp;ged=' . WT_GEDURL : $script . '?alpha=,&amp;ged=' . WT_GEDURL
)
));
}
}
- return (string)$cloud;
+ return (string) $cloud;
}
/**
@@ -1828,7 +1827,7 @@ function print_changes_table($change_ids, $sort) {
$html .= '<th>' . WT_I18N::translate('Record') . '</th>';
$html .= '<th>' . WT_Gedcom_Tag::getLabel('CHAN') . '</th>';
$html .= '<th>' . WT_Gedcom_Tag::getLabel('_WT_USER') . '</th>';
- $html .= '<th>DATE</th>'; //hidden by datatables code
+ $html .= '<th>DATE</th>'; //hidden by datatables code
$html .= '<th>SORTNAME</th>'; //hidden by datatables code
$html .= '</tr></thead><tbody>';
@@ -2090,7 +2089,7 @@ function print_events_list($startjd, $endjd, $events = 'BIRT MARR DEAT', $only_l
// Data is already sorted by anniversary date
break;
case 'alpha':
- uasort($filtered_events, function (WT_Fact $x, WT_Fact $y) {
+ uasort($filtered_events, function(WT_Fact $x, WT_Fact $y) {
return WT_GedcomRecord::compare($x->getParent(), $y->getParent());
});
break;
@@ -2211,11 +2210,11 @@ function print_chart_by_age($data, $title) {
$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 .= ",";
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">';
@@ -2275,11 +2274,11 @@ function print_chart_by_decade($data, $title) {
$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 .= ",";
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/includes/hitcount.php b/includes/hitcount.php
index 12065227a2..597f6aaa24 100644
--- a/includes/hitcount.php
+++ b/includes/hitcount.php
@@ -67,13 +67,13 @@ default:
}
if ($page_parameter) {
$hitCount = WT_DB::prepare(
- "SELECT page_count FROM `##hit_counter`".
+ "SELECT page_count FROM `##hit_counter`" .
" WHERE gedcom_id=? AND page_name=? AND page_parameter=?"
)->execute(array(WT_GED_ID, WT_SCRIPT_NAME, $page_parameter))->fetchOne();
// Only record one hit per session
if ($page_parameter && empty($WT_SESSION->SESSION_PAGE_HITS[WT_SCRIPT_NAME . $page_parameter])) {
- $WT_SESSION->SESSION_PAGE_HITS[WT_SCRIPT_NAME.$page_parameter]=true;
+ $WT_SESSION->SESSION_PAGE_HITS[WT_SCRIPT_NAME . $page_parameter] = true;
if (is_null($hitCount)) {
$hitCount = 1;
WT_DB::prepare(
@@ -82,7 +82,7 @@ if ($page_parameter) {
} else {
$hitCount++;
WT_DB::prepare(
- "UPDATE `##hit_counter` SET page_count=?".
+ "UPDATE `##hit_counter` SET page_count=?" .
" WHERE gedcom_id=? AND page_name=? AND page_parameter=?"
)->execute(array($hitCount, WT_GED_ID, WT_SCRIPT_NAME, $page_parameter));
}
diff --git a/index_edit.php b/index_edit.php
index 5cd3dd2913..99a4d53a9c 100644
--- a/index_edit.php
+++ b/index_edit.php
@@ -259,11 +259,11 @@ $controller
// Load Block Description array for use by javascript
foreach ($all_blocks as $block_name => $block) {
$controller->addInlineJavascript(
- 'block_descr["'.$block_name.'"] = "'.WT_Filter::escapeJs($block->getDescription()).'";'
+ 'block_descr["' . $block_name . '"] = "' . WT_Filter::escapeJs($block->getDescription()) . '";'
);
}
$controller->addInlineJavascript(
- 'block_descr["advice1"] = "'.WT_I18N::translate('Highlight a block name and then click on one of the arrow icons to move that highlighted block in the indicated direction.').'";'
+ 'block_descr["advice1"] = "' . WT_I18N::translate('Highlight a block name and then click on one of the arrow icons to move that highlighted block in the indicated direction.') . '";'
);
?>
diff --git a/indilist.php b/indilist.php
index 2d5af30bf7..6f7b0bfb30 100644
--- a/indilist.php
+++ b/indilist.php
@@ -34,7 +34,7 @@ $controller = new WT_Controller_Page;
// We show three different lists: initials, surnames and individuals
// Note that the data may contain special chars, such as surname="<unknown>",
-$alpha = WT_Filter::get('alpha'); // All surnames beginning with this letter where "@"=unknown and ","=none
+$alpha = WT_Filter::get('alpha'); // All surnames beginning with this letter where "@"=unknown and ","=none
$surname = WT_Filter::get('surname'); // All indis with this surname
$show_all = WT_Filter::get('show_all', 'no|yes', 'no'); // All indis
// Long lists can be broken down by given name
diff --git a/individual.php b/individual.php
index 1d8818db51..a7d174e372 100644
--- a/individual.php
+++ b/individual.php
@@ -32,13 +32,13 @@ $controller
->addExternalJavascript(WT_JQUERY_COOKIE_URL); // We use this to record the sidebar state
if ($controller->record && $controller->record->canShow()) {
- if (WT_Filter::get('action')=='ajax') {
+ if (WT_Filter::get('action') == 'ajax') {
$controller->ajaxRequest();
exit;
}
// Generate the sidebar content *before* we display the page header,
// as the clippings cart needs to have write access to the session.
- $sidebar_html=$controller->getSideBarContent();
+ $sidebar_html = $controller->getSideBarContent();
$controller->pageHeader();
if ($controller->record->isPendingDeletion()) {
@@ -47,8 +47,8 @@ if ($controller->record && $controller->record->canShow()) {
'<p class="ui-state-highlight">',
/* I18N: %1$s is “accept”, %2$s is “reject”. These are links. */ WT_I18N::translate(
'This individual has been deleted. You should review the deletion and then %1$s or %2$s it.',
- '<a href="#" onclick="accept_changes(\''.$controller->record->getXref().'\');">' . WT_I18N::translate_c('You should review the deletion and then accept or reject it.', 'accept') . '</a>',
- '<a href="#" onclick="reject_changes(\''.$controller->record->getXref().'\');">' . WT_I18N::translate_c('You should review the deletion and then accept or reject it.', 'reject') . '</a>'
+ '<a href="#" onclick="accept_changes(\'' . $controller->record->getXref() . '\');">' . WT_I18N::translate_c('You should review the deletion and then accept or reject it.', 'accept') . '</a>',
+ '<a href="#" onclick="reject_changes(\'' . $controller->record->getXref() . '\');">' . WT_I18N::translate_c('You should review the deletion and then accept or reject it.', 'reject') . '</a>'
),
' ', help_link('pending_changes'),
'</p>';
@@ -65,8 +65,8 @@ if ($controller->record && $controller->record->canShow()) {
'<p class="ui-state-highlight">',
/* I18N: %1$s is “accept”, %2$s is “reject”. These are links. */ WT_I18N::translate(
'This individual has been edited. You should review the changes and then %1$s or %2$s them.',
- '<a href="#" onclick="accept_changes(\''.$controller->record->getXref().'\');">' . WT_I18N::translate_c('You should review the changes and then accept or reject them.', 'accept') . '</a>',
- '<a href="#" onclick="reject_changes(\''.$controller->record->getXref().'\');">' . WT_I18N::translate_c('You should review the changes and then accept or reject them.', 'reject') . '</a>'
+ '<a href="#" onclick="accept_changes(\'' . $controller->record->getXref() . '\');">' . WT_I18N::translate_c('You should review the changes and then accept or reject them.', 'accept') . '</a>',
+ '<a href="#" onclick="reject_changes(\'' . $controller->record->getXref() . '\');">' . WT_I18N::translate_c('You should review the changes and then accept or reject them.', 'reject') . '</a>'
),
' ', help_link('pending_changes'),
'</p>';
@@ -85,7 +85,7 @@ if ($controller->record && $controller->record->canShow()) {
echo '<p class="ui-state-highlight">', WT_I18N::translate('The details of this individual are private.'), '</p>';
exit;
} else {
- header($_SERVER['SERVER_PROTOCOL'].' 404 Not Found');
+ header($_SERVER['SERVER_PROTOCOL'] . ' 404 Not Found');
$controller->pageHeader();
echo '<p class="ui-state-error">', WT_I18N::translate('This individual does not exist or you do not have permission to view it.'), '</p>';
exit;
@@ -171,8 +171,8 @@ if ($controller->record->canShow()) {
echo '<div id="indi_mainimage">', $controller->record->displayImage(), '</div>';
echo '<div id="header_accordion1">'; // contain accordions for names
echo '<h3 class="name_one ', $controller->getPersonStyle($controller->record), '"><span>', $controller->record->getFullName(), '</span>'; // First name accordion header
- $bdate=$controller->record->getBirthDate();
- $ddate=$controller->record->getDeathDate();
+ $bdate = $controller->record->getBirthDate();
+ $ddate = $controller->record->getDeathDate();
echo '<span class="header_age">';
if ($bdate->isOK() && !$controller->record->isDead()) {
// If living display age
@@ -202,7 +202,7 @@ if ($controller->record->canShow()) {
echo '</div>'; // close header_accordion1
}
-echo '</div>';// close #indi_header
+echo '</div>'; // close #indi_header
// ===================================== main content tabs
foreach ($controller->tabs as $tab) {
echo $tab->getPreLoadContent();
@@ -211,15 +211,15 @@ echo '<div id="tabs">';
echo '<ul>';
foreach ($controller->tabs as $tab) {
if ($tab->isGrayedOut()) {
- $greyed_out='rela';
+ $greyed_out = 'rela';
} else {
- $greyed_out='';
+ $greyed_out = '';
}
if ($tab->hasTabContent()) {
- echo '<li class="'.$greyed_out.'"><a href="';
+ echo '<li class="' . $greyed_out . '"><a href="';
if ($tab->canLoadAjax()) {
// AJAX tabs load only when selected
- echo $controller->record->getHtmlUrl(),'&amp;action=ajax&amp;module=', $tab->getName();
+ echo $controller->record->getHtmlUrl(), '&amp;action=ajax&amp;module=', $tab->getName();
} else {
// Non-AJAX tabs load immediately
echo '#', $tab->getName();
diff --git a/library/WT/Report/HTML.php b/library/WT/Report/HTML.php
index 5db42daf0a..f155b6bdaa 100644
--- a/library/WT/Report/HTML.php
+++ b/library/WT/Report/HTML.php
@@ -147,7 +147,7 @@ class WT_Report_HTML extends WT_Report_Base {
$this->pageh = $tmpw;
}
// Store the pagewidth without margins
- $this->noMarginWidth = (int)($this->pagew - $this->leftmargin - $this->rightmargin);
+ $this->noMarginWidth = (int) ($this->pagew - $this->leftmargin - $this->rightmargin);
// If RTL
if ($this->rtl) {
$this->alignRTL = "right";
@@ -663,7 +663,7 @@ class WT_Report_HTML extends WT_Report_Base {
*/
function textWrap($str, $width) {
// Calculate the line width
- $lw = (int)($width / ($this->getCurrentStyleHeight() / 2));
+ $lw = (int) ($width / ($this->getCurrentStyleHeight() / 2));
// Wordwrap each line
$lines = explode("\n", $str);
// Line Feed counter
diff --git a/library/WT/Report/PDF_Footnote.php b/library/WT/Report/PDF_Footnote.php
index e78599bbcc..7be2966392 100644
--- a/library/WT/Report/PDF_Footnote.php
+++ b/library/WT/Report/PDF_Footnote.php
@@ -105,7 +105,7 @@ class WT_Report_PDF_Footnote extends WT_Report_Base_Footnote {
if ($this->wrapWidthRemaining > 0) {
// Check with line counter too!
// but floor the $wrapWidthRemaining first to keep it bugfree!
- $wrapWidthRemaining = (int)($this->wrapWidthRemaining);
+ $wrapWidthRemaining = (int) ($this->wrapWidthRemaining);
if (($lw >= $wrapWidthRemaining) or ($lfct > 1)) {
$newtext = "";
$lines = explode("\n", $this->numText);
diff --git a/library/WT/Report/PDF_Text.php b/library/WT/Report/PDF_Text.php
index 750c19facf..2ddda1517e 100644
--- a/library/WT/Report/PDF_Text.php
+++ b/library/WT/Report/PDF_Text.php
@@ -107,7 +107,7 @@ class WT_Report_PDF_Text extends WT_Report_Base_Text {
if ($this->wrapWidthRemaining > 0) {
// Check with line counter too!
// but floor the $wrapWidthRemaining first to keep it bugfree!
- $wrapWidthRemaining = (int)($this->wrapWidthRemaining);
+ $wrapWidthRemaining = (int) ($this->wrapWidthRemaining);
if (($lw >= ($wrapWidthRemaining)) or ($lfct > 1)) {
$newtext = "";
$lines = explode("\n", $this->text);
diff --git a/library/WT/Soundex.php b/library/WT/Soundex.php
index 1b8c2baae3..c259ff81e8 100644
--- a/library/WT/Soundex.php
+++ b/library/WT/Soundex.php
@@ -147,20 +147,20 @@ class WT_Soundex {
*/
private static $transformNameTable = array(
// Force Yiddish ligatures to be treated as separate letters
- array('װ', 'וו'),
- array('ײ', 'יי'),
- array('ױ', 'וי'),
- array('בו', 'בע'),
- array('פו', 'פע'),
- array('ומ', 'עמ'),
- array('ום', 'עם'),
- array('ונ', 'ענ'),
- array('ון', 'ען'),
- array('וו', 'ב'),
+ array('װ', 'וו'),
+ array('ײ', 'יי'),
+ array('ױ', 'וי'),
+ array('בו', 'בע'),
+ array('פו', 'פע'),
+ array('ומ', 'עמ'),
+ array('ום', 'עם'),
+ array('ונ', 'ענ'),
+ array('ון', 'ען'),
+ array('וו', 'ב'),
array("\x01", ''),
array('ייה$', "\x01ה"),
array('ייע$', "\x01ע"),
- array('יי', 'ע'),
+ array('יי', 'ע'),
array("\x01", 'יי'),
);
diff --git a/library/WT/Theme/BaseTheme.php b/library/WT/Theme/BaseTheme.php
index 7def57d94e..e9b1bde218 100644
--- a/library/WT/Theme/BaseTheme.php
+++ b/library/WT/Theme/BaseTheme.php
@@ -523,11 +523,11 @@ abstract class BaseTheme {
'</div>' .
'<div class="chart_textbox" style="max-height:' . $this->parameter('chart-box-y') . 'px;">' .
$thumbnail .
- '<a href="' . $individual->getHtmlUrl() . '">'.
+ '<a href="' . $individual->getHtmlUrl() . '">' .
'<span class="namedef name1">' . $individual->getFullName() . '</span>' .
'</a>' .
'<div class="namedef name1">' . $individual->getAddName() . '</div>' .
- '<div class="inout2 details1">' . $this->individualBoxFacts($individual) .'</div>' .
+ '<div class="inout2 details1">' . $this->individualBoxFacts($individual) . '</div>' .
'</div>' .
'<div class="inout"></div>' .
'</div>';
@@ -568,11 +568,11 @@ abstract class BaseTheme {
'</div>' .
'<div class="chart_textbox" style="max-height:' . $this->parameter('chart-box-y') . 'px;">' .
$thumbnail .
- '<a href="' . $individual->getHtmlUrl() . '">'.
+ '<a href="' . $individual->getHtmlUrl() . '">' .
'<span class="namedef name2">' . $individual->getFullName() . '</span>' .
'</a>' .
'<div class="namedef name2">' . $individual->getAddName() . '</div>' .
- '<div class="inout2 details2">' . $this->individualBoxFacts($individual) .'</div>' .
+ '<div class="inout2 details2">' . $this->individualBoxFacts($individual) . '</div>' .
'</div>' .
'<div class="inout"></div>' .
'</div>';
@@ -598,10 +598,10 @@ abstract class BaseTheme {
'<div data-pid="' . $individual->getXref() . '" class="person_box_template ' . $personBoxClass . ' box-style0" style="width: ' . $this->parameter('compact-chart-box-x') . 'px; min-height: ' . $this->parameter('compact-chart-box-y') . 'px">' .
'<div class="compact_view">' .
$thumbnail .
- '<a href="' . $individual->getHtmlUrl() . '">'.
+ '<a href="' . $individual->getHtmlUrl() . '">' .
'<span class="namedef name0">' . $individual->getFullName() . '</span>' .
'</a>' .
- '<div class="inout2 details0">' . $individual->getLifeSpan() .'</div>' .
+ '<div class="inout2 details0">' . $individual->getLifeSpan() . '</div>' .
'</div>' .
'<div class="inout"></div>' .
'</div>';
@@ -732,7 +732,7 @@ abstract class BaseTheme {
$this->menuChartTimeline($individual),
));
- usort($menus, function (WT_Menu $x, WT_Menu $y) {
+ usort($menus, function(WT_Menu $x, WT_Menu $y) {
return WT_I18N::strcasecmp($x->getLabel(), $y->getLabel());
});
@@ -882,7 +882,7 @@ abstract class BaseTheme {
$this->menuChartTimeline($individual),
));
- usort($submenus, function (WT_Menu $x, WT_Menu $y) {
+ usort($submenus, function(WT_Menu $x, WT_Menu $y) {
return WT_I18N::strcasecmp($x->getLabel(), $y->getLabel());
});
@@ -1197,7 +1197,7 @@ abstract class BaseTheme {
$menulist[] = new WT_Menu(WT_I18N::translate('Shared notes'), 'notelist.php?' . $this->tree_url, 'menu-list-note');
}
}
- uasort($menulist, function (WT_Menu $x, WT_Menu $y) {
+ uasort($menulist, function(WT_Menu $x, WT_Menu $y) {
return WT_I18N::strcasecmp($x->getLabel(), $y->getLabel());
});
diff --git a/library/WT/Tree.php b/library/WT/Tree.php
index 35eb7fb40f..0db9a64ec4 100644
--- a/library/WT/Tree.php
+++ b/library/WT/Tree.php
@@ -196,11 +196,11 @@ class WT_Tree {
" LEFT JOIN `##gedcom_setting` gs3 ON (g.gedcom_id=gs3.gedcom_id AND gs3.setting_name='REQUIRE_AUTHENTICATION')" .
" LEFT JOIN `##user_gedcom_setting` ugs ON (g.gedcom_id=ugs.gedcom_id AND ugs.setting_name='canedit' AND ugs.user_id=?)" .
" WHERE " .
- " g.gedcom_id>0 AND (". // exclude the "template" tree
+ " g.gedcom_id>0 AND (" . // exclude the "template" tree
" EXISTS (SELECT 1 FROM `##user_setting` WHERE user_id=? AND setting_name='canadmin' AND setting_value=1)" . // Admin sees all
" ) OR (" .
- " gs2.setting_value = 1 AND (". // Allow imported trees, with either:
- " gs3.setting_value <> 1 OR" . // visitor access
+ " gs2.setting_value = 1 AND (" . // Allow imported trees, with either:
+ " gs3.setting_value <> 1 OR" . // visitor access
" IFNULL(ugs.setting_value, 'none')<>'none'" . // explicit access
" )" .
" )" .
@@ -422,7 +422,7 @@ class WT_Tree {
$tree->setPreference('WEBTREES_EMAIL', '');
$tree->setPreference('WORD_WRAPPED_NOTES', '0');
$tree->setPreference('imported', '0');
- $tree->setPreference('title', /* I18N: Default title for new family trees */ WT_I18N::translate('My family tree'));
+ $tree->setPreference('title', /* I18N: Default title for new family trees */ WT_I18N::translate('My family tree'));
// Default restriction settings
$statement = WT_DB::prepare(
@@ -436,7 +436,7 @@ class WT_Tree {
// Genealogy data
// It is simpler to create a temporary/unimported GEDCOM than to populate all the tables...
- $john_doe =/* I18N: This should be a common/default/placeholder name of an individual. Put slashes around the surname. */
+ $john_doe = /* I18N: This should be a common/default/placeholder name of an individual. Put slashes around the surname. */
WT_I18N::translate('John /DOE/');
$note = WT_I18N::translate('Edit this individual and replace their details with your own');
WT_DB::prepare("INSERT INTO `##gedcom_chunk` (gedcom_id, chunk_data) VALUES (?, ?)")->execute(array(
diff --git a/lifespan.php b/lifespan.php
index 75adc4afd3..95abb9539c 100644
--- a/lifespan.php
+++ b/lifespan.php
@@ -178,10 +178,10 @@ $people = count($controller->people);
</select>
</td>
<td>
- <input type="text" name="beginYear" size="5" value="<?php echo $controller->beginYear==0 ? '' : $controller->beginYear; ?>">
+ <input type="text" name="beginYear" size="5" value="<?php echo $controller->beginYear == 0 ? '' : $controller->beginYear; ?>">
</td>
<td>
- <input type="text" name="endYear" size="5" value="<?php echo $controller->endYear==0 ? '' : $controller->endYear; ?>">
+ <input type="text" name="endYear" size="5" value="<?php echo $controller->endYear == 0 ? '' : $controller->endYear; ?>">
</td>
<td>
<input data-autocomplete-type="PLAC" type="text" name="place" size="15" value="<?php echo WT_Filter::escapeHtml($controller->place); ?>">
@@ -201,7 +201,7 @@ $people = count($controller->people);
</table>
<div dir="ltr" id="lifespan_chart" class="lifespan_outer">
<div dir="ltr" id="topInner" class="lifespan_timeline" onmousedown="pandiv(); return false;">';
- <?php $controller->printTimeline($controller->timelineMinYear,$controller->timelineMaxYear); ?>
+ <?php $controller->printTimeline($controller->timelineMinYear, $controller->timelineMaxYear); ?>
</div>
<div id="inner" class="lifespan_people" onmousedown="pandiv(); return false;">
<?php $maxY = $controller->fillTimeline($controller->people, $controller->YrowLoc); ?>
@@ -233,4 +233,4 @@ $people = count($controller->people);
// Sets the boundaries for how far the timeline can move in the up direction
$controller->addInlineJavascript('var maxY = 80-' . $maxY . ';');
// Sets the boundaries for how far the timeline can move in the left direction
-$controller->addInlineJavascript('var maxX = ' . (isset($maxX)?$maxX:0) . ';');
+$controller->addInlineJavascript('var maxX = ' . (isset($maxX) ? $maxX : 0) . ';');
diff --git a/mediafirewall.php b/mediafirewall.php
index 707585a64f..357d38bfbc 100644
--- a/mediafirewall.php
+++ b/mediafirewall.php
@@ -38,7 +38,7 @@ function send404AndExit() {
$width = (mb_strlen($error)) * 6.5 + 50;
$height = 60;
- $im = imagecreatetruecolor($width, $height); /* Create a black image */
+ $im = imagecreatetruecolor($width, $height); /* Create a black image */
$bgc = imagecolorallocate($im, 255, 255, 255); /* set background color */
imagefilledrectangle($im, 2, 2, $width - 4, $height - 4, $bgc); /* create a rectangle, leaving 2 px border */
@@ -288,10 +288,10 @@ if (!file_exists($serverFilename)) {
$mimetype = $media->mimeType();
$imgsize = $media->getImageAttributes($which);
-$protocol = $_SERVER['SERVER_PROTOCOL']; // determine if we are using HTTP/1.0 or HTTP/1.1
+$protocol = $_SERVER['SERVER_PROTOCOL']; // determine if we are using HTTP/1.0 or HTTP/1.1
$filetime = $media->getFiletime($which);
$filetimeHeader = gmdate('D, d M Y H:i:s', $filetime) . ' GMT';
-$expireOffset = 3600 * 24; // tell browser to cache this image for 24 hours
+$expireOffset = 3600 * 24; // tell browser to cache this image for 24 hours
if (WT_Filter::get('cb')) {
$expireOffset = $expireOffset * 7;
} // if cb parameter was sent, cache for 7 days
diff --git a/mediaviewer.php b/mediaviewer.php
index f0ce28d83b..c5a2f54136 100644
--- a/mediaviewer.php
+++ b/mediaviewer.php
@@ -25,7 +25,7 @@
define('WT_SCRIPT_NAME', 'mediaviewer.php');
require './includes/session.php';
-require_once WT_ROOT.'includes/functions/functions_print_lists.php';
+require_once WT_ROOT . 'includes/functions/functions_print_lists.php';
$controller = new WT_Controller_Media;
@@ -37,8 +37,8 @@ if ($controller->record && $controller->record->canShow()) {
'<p class="ui-state-highlight">',
/* I18N: %1$s is “accept”, %2$s is “reject”. These are links. */ WT_I18N::translate(
'This media object has been deleted. You should review the deletion and then %1$s or %2$s it.',
- '<a href="#" onclick="accept_changes(\''.$controller->record->getXref().'\');">' . WT_I18N::translate_c('You should review the deletion and then accept or reject it.', 'accept') . '</a>',
- '<a href="#" onclick="reject_changes(\''.$controller->record->getXref().'\');">' . WT_I18N::translate_c('You should review the deletion and then accept or reject it.', 'reject') . '</a>'
+ '<a href="#" onclick="accept_changes(\'' . $controller->record->getXref() . '\');">' . WT_I18N::translate_c('You should review the deletion and then accept or reject it.', 'accept') . '</a>',
+ '<a href="#" onclick="reject_changes(\'' . $controller->record->getXref() . '\');">' . WT_I18N::translate_c('You should review the deletion and then accept or reject it.', 'reject') . '</a>'
),
' ', help_link('pending_changes'),
'</p>';
@@ -55,8 +55,8 @@ if ($controller->record && $controller->record->canShow()) {
'<p class="ui-state-highlight">',
/* I18N: %1$s is “accept”, %2$s is “reject”. These are links. */ WT_I18N::translate(
'This media object has been edited. You should review the changes and then %1$s or %2$s them.',
- '<a href="#" onclick="accept_changes(\''.$controller->record->getXref().'\');">' . WT_I18N::translate_c('You should review the changes and then accept or reject them.', 'accept') . '</a>',
- '<a href="#" onclick="reject_changes(\''.$controller->record->getXref().'\');">' . WT_I18N::translate_c('You should review the changes and then accept or reject them.', 'reject') . '</a>'
+ '<a href="#" onclick="accept_changes(\'' . $controller->record->getXref() . '\');">' . WT_I18N::translate_c('You should review the changes and then accept or reject them.', 'accept') . '</a>',
+ '<a href="#" onclick="reject_changes(\'' . $controller->record->getXref() . '\');">' . WT_I18N::translate_c('You should review the changes and then accept or reject them.', 'reject') . '</a>'
),
' ', help_link('pending_changes'),
'</p>';
@@ -69,7 +69,7 @@ if ($controller->record && $controller->record->canShow()) {
}
}
} else {
- header($_SERVER['SERVER_PROTOCOL'].' 404 Not Found');
+ header($_SERVER['SERVER_PROTOCOL'] . ' 404 Not Found');
$controller->pageHeader();
echo '<p class="ui-state-error">', WT_I18N::translate('This media object does not exist or you do not have permission to view it.'), '</p>';
exit;
@@ -88,7 +88,7 @@ $linked_indi = $controller->record->linkedIndividuals('OBJE');
$linked_fam = $controller->record->linkedFamilies('OBJE');
$linked_sour = $controller->record->linkedSources('OBJE');
$linked_repo = $controller->record->linkedRepositories('OBJE'); // Invalid GEDCOM - you cannot link a REPO to an OBJE
-$linked_note = $controller->record->linkedNotes('OBJE'); // Invalid GEDCOM - you cannot link a NOTE to an OBJE
+$linked_note = $controller->record->linkedNotes('OBJE'); // Invalid GEDCOM - you cannot link a NOTE to an OBJE
echo '<div id="media-details">';
echo '<h2>', $controller->record->getFullName(), ' ', $controller->record->getAddName(), '</h2>';
@@ -105,7 +105,7 @@ echo '<div id="media-tabs">';
if (!$tmp->isExternal()) {
if ($tmp->fileExists('main')) {
if ($SHOW_MEDIA_DOWNLOAD) {
- echo '<p><a href="' . $tmp->getHtmlUrlDirect('main', true).'">' . WT_I18N::translate('Download file') . '</a></p>';
+ echo '<p><a href="' . $tmp->getHtmlUrlDirect('main', true) . '">' . WT_I18N::translate('Download file') . '</a></p>';
}
} else {
echo '<p class="ui-state-error">' . WT_I18N::translate('The file “%s” does not exist.', $tmp->getFilename()) . '</p>';
diff --git a/message.php b/message.php
index 1dca23d76b..462715276d 100644
--- a/message.php
+++ b/message.php
@@ -140,7 +140,7 @@ case 'compose':
echo WT_I18N::translate('When you send this message you will receive a copy sent via email to the address you provided.');
}
echo
- '<br><br><br><br>', // TODO use margin-bottom instead of this
+ '<br><br><br><br>', // TODO use margin-bottom instead of this
'<p id="save-cancel">',
'<input type="button" class="cancel" value="', WT_I18N::translate('close'), '" onclick="window.close();">',
'</p>';
diff --git a/modules_v3/GEDFact_assistant/CENS_ctrl.php b/modules_v3/GEDFact_assistant/CENS_ctrl.php
index 0f9475eb26..44569fa6dc 100644
--- a/modules_v3/GEDFact_assistant/CENS_ctrl.php
+++ b/modules_v3/GEDFact_assistant/CENS_ctrl.php
@@ -65,18 +65,18 @@ global $tabno, $linkToID, $SEARCH_SPIDER;
global $SHOW_AGE_DIFF, $GEDCOM;
global $show_full, $famid;
-$summary=$person->format_first_major_fact(WT_EVENTS_BIRT, 2);
+$summary = $person->format_first_major_fact(WT_EVENTS_BIRT, 2);
if (!($person->isDead())) {
// If alive display age
- $bdate=$person->getBirthDate();
+ $bdate = $person->getBirthDate();
$age = WT_Date::GetAgeGedcom($bdate);
- if ($age!="") {
- $summary.= "<span class=\"label\">".WT_I18N::translate('Age').":</span><span class=\"field\"> ".get_age_at_event($age, true)."</span>";
+ if ($age != "") {
+ $summary .= "<span class=\"label\">" . WT_I18N::translate('Age') . ":</span><span class=\"field\"> " . get_age_at_event($age, true) . "</span>";
}
}
-$summary.=$person->format_first_major_fact(WT_EVENTS_DEAT, 2);
+$summary .= $person->format_first_major_fact(WT_EVENTS_DEAT, 2);
-require WT_ROOT.WT_MODULES_DIR.'GEDFact_assistant/_CENS/census_1_ctrl.php';
+require WT_ROOT . WT_MODULES_DIR . 'GEDFact_assistant/_CENS/census_1_ctrl.php';
?>
</form>
diff --git a/modules_v3/GEDFact_assistant/MEDIA_ctrl.php b/modules_v3/GEDFact_assistant/MEDIA_ctrl.php
index 15348a1fe1..56ca50ccd5 100644
--- a/modules_v3/GEDFact_assistant/MEDIA_ctrl.php
+++ b/modules_v3/GEDFact_assistant/MEDIA_ctrl.php
@@ -25,7 +25,7 @@
$controller = new WT_Controller_Individual;
-echo '<link href="'.WT_STATIC_URL.WT_MODULES_DIR.'GEDFact_assistant/css/gf_styles.css" rel="stylesheet" type="text/css" media="screen">';
+echo '<link href="' . WT_STATIC_URL . WT_MODULES_DIR . 'GEDFact_assistant/css/gf_styles.css" rel="stylesheet" type="text/css" media="screen">';
global $tabno, $linkToID, $SEARCH_SPIDER;
global $SHOW_AGE_DIFF;
@@ -33,8 +33,8 @@ global $GEDCOM;
global $show_full;
global $famid, $censyear, $censdate;
-$summary=
- $controller->record->format_first_major_fact(WT_EVENTS_BIRT, 2).
+$summary =
+ $controller->record->format_first_major_fact(WT_EVENTS_BIRT, 2) .
$controller->record->format_first_major_fact(WT_EVENTS_DEAT, 2);
-require WT_ROOT.WT_MODULES_DIR.'GEDFact_assistant/_MEDIA/media_1_ctrl.php';
+require WT_ROOT . WT_MODULES_DIR . 'GEDFact_assistant/_MEDIA/media_1_ctrl.php';
diff --git a/modules_v3/ahnentafel_report/module.php b/modules_v3/ahnentafel_report/module.php
index cb207720e3..01caeca753 100644
--- a/modules_v3/ahnentafel_report/module.php
+++ b/modules_v3/ahnentafel_report/module.php
@@ -44,13 +44,13 @@ class ahnentafel_report_WT_Module extends WT_Module implements WT_Module_Report
public function getReportMenus() {
global $controller;
- $menus=array();
- $menu=new WT_Menu(
+ $menus = array();
+ $menu = new WT_Menu(
$this->getTitle(),
- 'reportengine.php?ged='.WT_GEDURL.'&amp;action=setup&amp;report='.WT_MODULES_DIR.$this->getName().'/report.xml&amp;pid='.$controller->getSignificantIndividual()->getXref(),
- 'menu-report-'.$this->getName()
+ 'reportengine.php?ged=' . WT_GEDURL . '&amp;action=setup&amp;report=' . WT_MODULES_DIR . $this->getName() . '/report.xml&amp;pid=' . $controller->getSignificantIndividual()->getXref(),
+ 'menu-report-' . $this->getName()
);
- $menus[]=$menu;
+ $menus[] = $menu;
return $menus;
}
diff --git a/modules_v3/batch_update/module.php b/modules_v3/batch_update/module.php
index c7bd27426d..b2715ae39e 100644
--- a/modules_v3/batch_update/module.php
+++ b/modules_v3/batch_update/module.php
@@ -21,7 +21,7 @@ use WT\Auth;
/**
* Class batch_update_WT_Module
*/
-class batch_update_WT_Module extends WT_Module implements WT_Module_Config{
+class batch_update_WT_Module extends WT_Module implements WT_Module_Config {
/** {@inheritdoc} */
public function getTitle() {
return /* I18N: Name of a module */ WT_I18N::translate('Batch update');
@@ -34,7 +34,7 @@ class batch_update_WT_Module extends WT_Module implements WT_Module_Config{
/** {@inheritdoc} */
public function modAction($mod_action) {
- switch($mod_action) {
+ switch ($mod_action) {
case 'admin_batch_update':
$controller = new WT_Controller_Page;
$controller
@@ -43,8 +43,8 @@ class batch_update_WT_Module extends WT_Module implements WT_Module_Config{
->pageHeader();
// TODO: these files should be methods in this class
- require WT_ROOT.WT_MODULES_DIR.$this->getName().'/'.$mod_action.'.php';
- $mod=new batch_update;
+ require WT_ROOT . WT_MODULES_DIR . $this->getName() . '/' . $mod_action . '.php';
+ $mod = new batch_update;
echo $mod->main();
break;
default:
@@ -54,6 +54,6 @@ class batch_update_WT_Module extends WT_Module implements WT_Module_Config{
/** {@inheritdoc} */
public function getConfigLink() {
- return 'module.php?mod='.$this->getName().'&amp;mod_action=admin_batch_update';
+ return 'module.php?mod=' . $this->getName() . '&amp;mod_action=admin_batch_update';
}
}
diff --git a/modules_v3/batch_update/plugins/death_y.php b/modules_v3/batch_update/plugins/death_y.php
index 5d7fd2716e..a961075939 100644
--- a/modules_v3/batch_update/plugins/death_y.php
+++ b/modules_v3/batch_update/plugins/death_y.php
@@ -47,7 +47,7 @@ class death_y_bu_plugin extends base_plugin {
* @return boolean
*/
public function doesRecordNeedUpdate($xref, $gedrec) {
- return !preg_match('/\n1 ('.WT_EVENTS_DEAT.')/', $gedrec) && WT_Individual::getInstance($xref)->isDead();
+ return !preg_match('/\n1 (' . WT_EVENTS_DEAT . ')/', $gedrec) && WT_Individual::getInstance($xref)->isDead();
}
/**
@@ -59,6 +59,6 @@ class death_y_bu_plugin extends base_plugin {
* @return string
*/
public function updateRecord($xref, $gedrec) {
- return $gedrec."\n1 DEAT Y";
+ return $gedrec . "\n1 DEAT Y";
}
}
diff --git a/modules_v3/batch_update/plugins/search_replace.php b/modules_v3/batch_update/plugins/search_replace.php
index 7f47a24c6a..d02296682f 100644
--- a/modules_v3/batch_update/plugins/search_replace.php
+++ b/modules_v3/batch_update/plugins/search_replace.php
@@ -20,12 +20,12 @@
* Class search_replace_bu_plugin Batch Update plugin: search/replace
*/
class search_replace_bu_plugin extends base_plugin {
- var $search =null; // Search string
- var $replace=null; // Replace string
- var $method =null; // simple/wildcards/regex
- var $regex =null; // Search string, converted to a regex
- var $case =null; // "i" for case insensitive, "" for case sensitive
- var $error =null; // Message for bad user parameters
+ var $search = null; // Search string
+ var $replace = null; // Replace string
+ var $method = null; // simple/wildcards/regex
+ var $regex = null; // Search string, converted to a regex
+ var $case = null; // "i" for case insensitive, "" for case sensitive
+ var $error = null; // Message for bad user parameters
/**
* User-friendly name for this plugin.
@@ -63,7 +63,7 @@ class search_replace_bu_plugin extends base_plugin {
* @return boolean
*/
public function doesRecordNeedUpdate($xref, $gedrec) {
- return !$this->error && preg_match('/(?:'.$this->regex.')/mu'.$this->case, $gedrec);
+ return !$this->error && preg_match('/(?:' . $this->regex . ')/mu' . $this->case, $gedrec);
}
/**
@@ -77,7 +77,7 @@ class search_replace_bu_plugin extends base_plugin {
public function updateRecord($xref, $gedrec) {
// Allow "\n" to indicate a line-feed in replacement text.
// Back-references such as $1, $2 are handled automatically.
- return preg_replace('/'.$this->regex.'/mu'.$this->case, str_replace('\n', "\n", $this->replace), $gedrec);
+ return preg_replace('/' . $this->regex . '/mu' . $this->case, str_replace('\n', "\n", $this->replace), $gedrec);
}
/**
@@ -90,24 +90,24 @@ class search_replace_bu_plugin extends base_plugin {
$this->method = WT_Filter::get('method', 'exact|words|wildcards|regex', 'exact');
$this->case = WT_Filter::get('case', 'i');
- $this->error='';
+ $this->error = '';
switch ($this->method) {
case 'exact':
- $this->regex=preg_quote($this->search, '/');
+ $this->regex = preg_quote($this->search, '/');
break;
case 'words':
- $this->regex='\b'.preg_quote($this->search, '/').'\b';
+ $this->regex = '\b' . preg_quote($this->search, '/') . '\b';
break;
case 'wildcards':
- $this->regex='\b'.str_replace(array('\*', '\?'), array('.*', '.'), preg_quote($this->search, '/')).'\b';
+ $this->regex = '\b' . str_replace(array('\*', '\?'), array('.*', '.'), preg_quote($this->search, '/')) . '\b';
break;
case 'regex':
- $this->regex=$this->search;
+ $this->regex = $this->search;
// Check for invalid regular expressions.
// A valid regex on a null string returns zero.
// An invalid regex on a null string returns false (and throws a warning).
- if (@preg_match('/'.$this->search.'/', null) === false) {
- $this->error='<br><span class="error">'.WT_I18N::translate('The regex appears to contain an error. It can’t be used.').'</span>';
+ if (@preg_match('/' . $this->search . '/', null) === false) {
+ $this->error = '<br><span class="error">' . WT_I18N::translate('The regex appears to contain an error. It can’t be used.') . '</span>';
}
break;
}
@@ -119,7 +119,7 @@ class search_replace_bu_plugin extends base_plugin {
* @return string
*/
public function getOptionsForm() {
- $descriptions=array(
+ $descriptions = array(
'exact' => WT_I18N::translate('Match the exact text, even if it occurs in the middle of a word.'),
'words' => WT_I18N::translate('Match the exact text, unless it occurs in the middle of a word.'),
'wildcards' => WT_I18N::translate('Use a “?” to match a single character, use “*” to match zero or more characters.'),
diff --git a/modules_v3/bdm_report/module.php b/modules_v3/bdm_report/module.php
index 54b465fed7..128cf06ea5 100644
--- a/modules_v3/bdm_report/module.php
+++ b/modules_v3/bdm_report/module.php
@@ -42,13 +42,13 @@ class bdm_report_WT_Module extends WT_Module implements WT_Module_Report {
/** {@inheritdoc} */
public function getReportMenus() {
- $menus=array();
- $menu=new WT_Menu(
+ $menus = array();
+ $menu = new WT_Menu(
$this->getTitle(),
- 'reportengine.php?ged='.WT_GEDURL.'&amp;action=setup&amp;report='.WT_MODULES_DIR.$this->getName().'/report.xml',
- 'menu-report-'.$this->getName()
+ 'reportengine.php?ged=' . WT_GEDURL . '&amp;action=setup&amp;report=' . WT_MODULES_DIR . $this->getName() . '/report.xml',
+ 'menu-report-' . $this->getName()
);
- $menus[]=$menu;
+ $menus[] = $menu;
return $menus;
}
diff --git a/modules_v3/birth_report/module.php b/modules_v3/birth_report/module.php
index b8694ae301..9b6912a503 100644
--- a/modules_v3/birth_report/module.php
+++ b/modules_v3/birth_report/module.php
@@ -42,13 +42,13 @@ class birth_report_WT_Module extends WT_Module implements WT_Module_Report {
/** {@inheritdoc} */
public function getReportMenus() {
- $menus=array();
- $menu=new WT_Menu(
+ $menus = array();
+ $menu = new WT_Menu(
$this->getTitle(),
- 'reportengine.php?ged='.WT_GEDURL.'&amp;action=setup&amp;report='.WT_MODULES_DIR.$this->getName().'/report.xml',
- 'menu-report-'.$this->getName()
+ 'reportengine.php?ged=' . WT_GEDURL . '&amp;action=setup&amp;report=' . WT_MODULES_DIR . $this->getName() . '/report.xml',
+ 'menu-report-' . $this->getName()
);
- $menus[]=$menu;
+ $menus[] = $menu;
return $menus;
}
diff --git a/modules_v3/cemetery_report/module.php b/modules_v3/cemetery_report/module.php
index dc0aefbc32..fab4576e5e 100644
--- a/modules_v3/cemetery_report/module.php
+++ b/modules_v3/cemetery_report/module.php
@@ -42,13 +42,13 @@ class cemetery_report_WT_Module extends WT_Module implements WT_Module_Report {
/** {@inheritdoc} */
public function getReportMenus() {
- $menus=array();
- $menu=new WT_Menu(
+ $menus = array();
+ $menu = new WT_Menu(
$this->getTitle(),
- 'reportengine.php?ged='.WT_GEDURL.'&amp;action=setup&amp;report='.WT_MODULES_DIR.$this->getName().'/report.xml',
- 'menu-report-'.$this->getName()
+ 'reportengine.php?ged=' . WT_GEDURL . '&amp;action=setup&amp;report=' . WT_MODULES_DIR . $this->getName() . '/report.xml',
+ 'menu-report-' . $this->getName()
);
- $menus[]=$menu;
+ $menus[] = $menu;
return $menus;
}
diff --git a/modules_v3/change_report/module.php b/modules_v3/change_report/module.php
index 81c4201225..eee0c40d8b 100644
--- a/modules_v3/change_report/module.php
+++ b/modules_v3/change_report/module.php
@@ -42,13 +42,13 @@ class change_report_WT_Module extends WT_Module implements WT_Module_Report {
/** {@inheritdoc} */
public function getReportMenus() {
- $menus=array();
- $menu=new WT_Menu(
+ $menus = array();
+ $menu = new WT_Menu(
$this->getTitle(),
- 'reportengine.php?ged='.WT_GEDURL.'&amp;action=setup&amp;report='.WT_MODULES_DIR.$this->getName().'/report.xml',
- 'menu-report-'.$this->getName()
+ 'reportengine.php?ged=' . WT_GEDURL . '&amp;action=setup&amp;report=' . WT_MODULES_DIR . $this->getName() . '/report.xml',
+ 'menu-report-' . $this->getName()
);
- $menus[]=$menu;
+ $menus[] = $menu;
return $menus;
}
diff --git a/modules_v3/charts/help_text.php b/modules_v3/charts/help_text.php
index 412f1fc2fd..ae9b6a03d8 100644
--- a/modules_v3/charts/help_text.php
+++ b/modules_v3/charts/help_text.php
@@ -21,14 +21,14 @@
// along with this program; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-if (!defined('WT_WEBTREES') || !defined('WT_SCRIPT_NAME') || WT_SCRIPT_NAME!='help_text.php') {
+if (!defined('WT_WEBTREES') || !defined('WT_SCRIPT_NAME') || WT_SCRIPT_NAME != 'help_text.php') {
header('HTTP/1.0 403 Forbidden');
exit;
}
switch ($help) {
case 'index_charts':
- $title=WT_I18N::translate('Charts');
- $text=WT_I18N::translate('This block allows a pedigree, descendancy, or hourglass chart to appear on your “My page” or the “Home page”. Because of space limitations, the charts should be placed only on the left side of the page.<br><br>When this block appears on the “Home page”, the root individual and the type of chart to be displayed are determined by the administrator. When this block appears on the user’s “My page”, these options are determined by the user.<br><br>The behavior of these charts is identical to their behavior when they are called up from the menus. Click on the box of an individual to see more details about them.');
+ $title = WT_I18N::translate('Charts');
+ $text = WT_I18N::translate('This block allows a pedigree, descendancy, or hourglass chart to appear on your “My page” or the “Home page”. Because of space limitations, the charts should be placed only on the left side of the page.<br><br>When this block appears on the “Home page”, the root individual and the type of chart to be displayed are determined by the administrator. When this block appears on the user’s “My page”, these options are determined by the user.<br><br>The behavior of these charts is identical to their behavior when they are called up from the menus. Click on the box of an individual to see more details about them.');
break;
}
diff --git a/modules_v3/ckeditor/module.php b/modules_v3/ckeditor/module.php
index 11570f37c1..9b3ee497fd 100644
--- a/modules_v3/ckeditor/module.php
+++ b/modules_v3/ckeditor/module.php
@@ -56,7 +56,7 @@ class ckeditor_WT_Module extends WT_Module {
)
// Activate the editor
->addInlineJavascript('jQuery(".html-edit").ckeditor(function(){}, {
- language: "' . str_replace('_','-',strtolower(WT_LOCALE)) . '"
+ language: "' . str_replace('_', '-', strtolower(WT_LOCALE)) . '"
});');
}
}
diff --git a/modules_v3/clippings/help_text.php b/modules_v3/clippings/help_text.php
index fa0f20ca47..dd07257290 100644
--- a/modules_v3/clippings/help_text.php
+++ b/modules_v3/clippings/help_text.php
@@ -21,19 +21,19 @@
// along with this program; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-if (!defined('WT_WEBTREES') || !defined('WT_SCRIPT_NAME') || WT_SCRIPT_NAME!='help_text.php') {
+if (!defined('WT_WEBTREES') || !defined('WT_SCRIPT_NAME') || WT_SCRIPT_NAME != 'help_text.php') {
header('HTTP/1.0 403 Forbidden');
exit;
}
switch ($help) {
case 'add_by_id':
- $title=WT_I18N::translate('Add by ID');
- $text=WT_I18N::translate('This input box lets you enter an individual’s ID number so he can be added to the clippings cart. Once added you’ll be offered options to link that individual’s relations to your clippings cart.<br><br>If you do not know an individual’s ID number, you can perform a search by name by pressing the individual icon next to the “Add” button.');
+ $title = WT_I18N::translate('Add by ID');
+ $text = WT_I18N::translate('This input box lets you enter an individual’s ID number so he can be added to the clippings cart. Once added you’ll be offered options to link that individual’s relations to your clippings cart.<br><br>If you do not know an individual’s ID number, you can perform a search by name by pressing the individual icon next to the “Add” button.');
break;
case 'empty_cart':
- $title=WT_I18N::translate('Empty the clippings cart');
- $text=WT_I18N::translate('When you click this link your clippings cart will be totally emptied.<br><br>If you don’t want to remove all individuals, families, etc. from the clippings cart, you can remove items individually by clicking the <b>Remove</b> link in the name boxes. There is <u>no</u> confirmation dialog when you click either of these links; the requested deletion takes place immediately.');
+ $title = WT_I18N::translate('Empty the clippings cart');
+ $text = WT_I18N::translate('When you click this link your clippings cart will be totally emptied.<br><br>If you don’t want to remove all individuals, families, etc. from the clippings cart, you can remove items individually by clicking the <b>Remove</b> link in the name boxes. There is <u>no</u> confirmation dialog when you click either of these links; the requested deletion takes place immediately.');
break;
}
diff --git a/modules_v3/death_report/module.php b/modules_v3/death_report/module.php
index d33554f85b..360b29d10b 100644
--- a/modules_v3/death_report/module.php
+++ b/modules_v3/death_report/module.php
@@ -44,13 +44,13 @@ class death_report_WT_Module extends WT_Module implements WT_Module_Report {
/** {@inheritdoc} */
public function getReportMenus() {
- $menus=array();
- $menu=new WT_Menu(
+ $menus = array();
+ $menu = new WT_Menu(
$this->getTitle(),
- 'reportengine.php?ged='.WT_GEDURL.'&amp;action=setup&amp;report='.WT_MODULES_DIR.$this->getName().'/report.xml',
- 'menu-report-'.$this->getName()
+ 'reportengine.php?ged=' . WT_GEDURL . '&amp;action=setup&amp;report=' . WT_MODULES_DIR . $this->getName() . '/report.xml',
+ 'menu-report-' . $this->getName()
);
- $menus[]=$menu;
+ $menus[] = $menu;
return $menus;
}
diff --git a/modules_v3/descendancy_report/module.php b/modules_v3/descendancy_report/module.php
index f68720f97d..19a3cfe4bb 100644
--- a/modules_v3/descendancy_report/module.php
+++ b/modules_v3/descendancy_report/module.php
@@ -44,13 +44,13 @@ class descendancy_report_WT_Module extends WT_Module implements WT_Module_Report
public function getReportMenus() {
global $controller;
- $menus=array();
- $menu=new WT_Menu(
+ $menus = array();
+ $menu = new WT_Menu(
$this->getTitle(),
- 'reportengine.php?ged='.WT_GEDURL.'&amp;action=setup&amp;report='.WT_MODULES_DIR.$this->getName().'/report.xml&amp;pid='.$controller->getSignificantIndividual()->getXref(),
- 'menu-report-'.$this->getName()
+ 'reportengine.php?ged=' . WT_GEDURL . '&amp;action=setup&amp;report=' . WT_MODULES_DIR . $this->getName() . '/report.xml&amp;pid=' . $controller->getSignificantIndividual()->getXref(),
+ 'menu-report-' . $this->getName()
);
- $menus[]=$menu;
+ $menus[] = $menu;
return $menus;
}
diff --git a/modules_v3/fact_sources/module.php b/modules_v3/fact_sources/module.php
index 0102ed802a..fa5bd08361 100644
--- a/modules_v3/fact_sources/module.php
+++ b/modules_v3/fact_sources/module.php
@@ -42,13 +42,13 @@ class fact_sources_WT_Module extends WT_Module implements WT_Module_Report {
/** {@inheritdoc} */
public function getReportMenus() {
- $menus=array();
- $menu=new WT_Menu(
+ $menus = array();
+ $menu = new WT_Menu(
$this->getTitle(),
- 'reportengine.php?ged='.WT_GEDURL.'&amp;action=setup&amp;report='.WT_MODULES_DIR.$this->getName().'/report.xml',
- 'menu-report-'.$this->getName()
+ 'reportengine.php?ged=' . WT_GEDURL . '&amp;action=setup&amp;report=' . WT_MODULES_DIR . $this->getName() . '/report.xml',
+ 'menu-report-' . $this->getName()
);
- $menus[]=$menu;
+ $menus[] = $menu;
return $menus;
}
diff --git a/modules_v3/family_group_report/module.php b/modules_v3/family_group_report/module.php
index 54f6efc41e..e4ebba8bb6 100644
--- a/modules_v3/family_group_report/module.php
+++ b/modules_v3/family_group_report/module.php
@@ -44,13 +44,13 @@ class family_group_report_WT_Module extends WT_Module implements WT_Module_Repor
public function getReportMenus() {
global $controller;
- $menus=array();
- $menu=new WT_Menu(
+ $menus = array();
+ $menu = new WT_Menu(
$this->getTitle(),
- 'reportengine.php?ged='.WT_GEDURL.'&amp;action=setup&amp;report='.WT_MODULES_DIR.$this->getName().'/report.xml&amp;famid='.$controller->getSignificantFamily()->getXref(),
- 'menu-report-'.$this->getName()
+ 'reportengine.php?ged=' . WT_GEDURL . '&amp;action=setup&amp;report=' . WT_MODULES_DIR . $this->getName() . '/report.xml&amp;famid=' . $controller->getSignificantFamily()->getXref(),
+ 'menu-report-' . $this->getName()
);
- $menus[]=$menu;
+ $menus[] = $menu;
return $menus;
}
diff --git a/modules_v3/family_nav/module.php b/modules_v3/family_nav/module.php
index 1a25477986..992cc7c87e 100644
--- a/modules_v3/family_nav/module.php
+++ b/modules_v3/family_nav/module.php
@@ -128,7 +128,7 @@ class family_nav_WT_Module extends WT_Module implements WT_Module_Sidebar {
<?php
$access_level = $SHOW_PRIVATE_RELATIONSHIPS ? WT_PRIV_HIDE : WT_USER_ACCESS_LEVEL;
$facts = array_merge($family->getFacts('HUSB', false, $access_level), $family->getFacts('WIFE', false, $access_level));
- foreach($facts as $fact) {
+ foreach ($facts as $fact) {
$spouse = $fact->getTarget();
if ($this->isPerson($spouse)) {
$menu = new WT_Menu(get_close_relationship_name($controller->record, $spouse));
@@ -183,7 +183,7 @@ class family_nav_WT_Module extends WT_Module implements WT_Module_Sidebar {
*
* @return string
*/
- private function getHTML($person, $showUnknown=false) {
+ private function getHTML($person, $showUnknown = false) {
if ($this->isPerson($person)) {
return sprintf(self::LNK, $person->getHtmlUrl(), $person->getFullName());
} elseif ($showUnknown) {
@@ -221,15 +221,14 @@ class family_nav_WT_Module extends WT_Module implements WT_Module_Sidebar {
$stepParents .= $this->getHTML($family->getWife());
}
}
- if($stepParents) {
+ if ($stepParents) {
$relationship = $this->isPerson($father) ?
- WT_I18N::translate_c("father’s wife", "step-mother") :
- WT_I18N::translate_c("mother’s husband", "step-father");
+ WT_I18N::translate_c("father’s wife", "step-mother") : WT_I18N::translate_c("mother’s husband", "step-father");
$html .= sprintf(self::TTL, $relationship) . $stepParents;
}
}
}
- if(!($this->isPerson($father) || $this->isPerson($mother))) {
+ if (!($this->isPerson($father) || $this->isPerson($mother))) {
$html .= sprintf(self::MSG, WT_I18N::translate_c('unknown family', 'unknown'));
}
return $html;
diff --git a/modules_v3/faq/module.php b/modules_v3/faq/module.php
index 712673d95e..b111994df5 100644
--- a/modules_v3/faq/module.php
+++ b/modules_v3/faq/module.php
@@ -193,11 +193,11 @@ class faq_WT_Module extends WT_Module implements WT_Module_Menu, WT_Module_Confi
)->execute(array($block_id))->fetchOne();
$swap_block = WT_DB::prepare(
- "SELECT block_order, block_id".
- " FROM `##block`".
- " WHERE block_order=(".
- " SELECT MAX(block_order) FROM `##block` WHERE block_order < ? AND module_name=?".
- " ) AND module_name=?".
+ "SELECT block_order, block_id" .
+ " FROM `##block`" .
+ " WHERE block_order=(" .
+ " SELECT MAX(block_order) FROM `##block` WHERE block_order < ? AND module_name=?" .
+ " ) AND module_name=?" .
" LIMIT 1"
)->execute(array($block_order, $this->getName(), $this->getName()))->fetchOneRow();
if ($swap_block) {
@@ -221,11 +221,11 @@ class faq_WT_Module extends WT_Module implements WT_Module_Menu, WT_Module_Confi
)->execute(array($block_id))->fetchOne();
$swap_block = WT_DB::prepare(
- "SELECT block_order, block_id".
- " FROM `##block`".
- " WHERE block_order=(".
- " SELECT MIN(block_order) FROM `##block` WHERE block_order>? AND module_name=?".
- " ) AND module_name=?".
+ "SELECT block_order, block_id" .
+ " FROM `##block`" .
+ " WHERE block_order=(" .
+ " SELECT MIN(block_order) FROM `##block` WHERE block_order>? AND module_name=?" .
+ " ) AND module_name=?" .
" LIMIT 1"
)->execute(array($block_order, $this->getName(), $this->getName()))->fetchOneRow();
if ($swap_block) {
@@ -330,7 +330,7 @@ class faq_WT_Module extends WT_Module implements WT_Module_Menu, WT_Module_Confi
)->execute(array($this->getName()))->fetchOne();
echo
- '<p><form method="get" action="', WT_SCRIPT_NAME ,'">',
+ '<p><form method="get" action="', WT_SCRIPT_NAME, '">',
WT_I18N::translate('Family tree'), ' ',
'<input type="hidden" name="mod", value="', $this->getName(), '">',
'<input type="hidden" name="mod_action", value="admin_config">',
diff --git a/modules_v3/gedcom_block/module.php b/modules_v3/gedcom_block/module.php
index 77f2fe9b31..d498877f98 100644
--- a/modules_v3/gedcom_block/module.php
+++ b/modules_v3/gedcom_block/module.php
@@ -37,18 +37,18 @@ class gedcom_block_WT_Module extends WT_Module implements WT_Module_Block {
}
/** {@inheritdoc} */
- public function getBlock($block_id, $template=true, $cfg=null) {
+ public function getBlock($block_id, $template = true, $cfg = null) {
global $controller;
- $indi_xref=$controller->getSignificantIndividual()->getXref();
- $id=$this->getName().$block_id;
- $class=$this->getName().'_block';
- $title='<span dir="auto">'.WT_TREE_TITLE.'</span>';
+ $indi_xref = $controller->getSignificantIndividual()->getXref();
+ $id = $this->getName() . $block_id;
+ $class = $this->getName() . '_block';
+ $title = '<span dir="auto">' . WT_TREE_TITLE . '</span>';
$content = '<table><tr>';
- $content .= '<td><a href="pedigree.php?rootid='.$indi_xref.'&amp;ged='.WT_GEDURL.'"><i class="icon-pedigree"></i><br>'.WT_I18N::translate('Default chart').'</a></td>';
- $content .= '<td><a href="individual.php?pid='.$indi_xref.'&amp;ged='.WT_GEDURL.'"><i class="icon-indis"></i><br>'.WT_I18N::translate('Default individual').'</a></td>';
+ $content .= '<td><a href="pedigree.php?rootid=' . $indi_xref . '&amp;ged=' . WT_GEDURL . '"><i class="icon-pedigree"></i><br>' . WT_I18N::translate('Default chart') . '</a></td>';
+ $content .= '<td><a href="individual.php?pid=' . $indi_xref . '&amp;ged=' . WT_GEDURL . '"><i class="icon-indis"></i><br>' . WT_I18N::translate('Default individual') . '</a></td>';
if (WT_Site::getPreference('USE_REGISTRATION_MODULE') && !Auth::check()) {
- $content .= '<td><a href="'.WT_LOGIN_URL.'?action=register"><i class="icon-user_add"></i><br>'.WT_I18N::translate('Request new user account').'</a></td>';
+ $content .= '<td><a href="' . WT_LOGIN_URL . '?action=register"><i class="icon-user_add"></i><br>' . WT_I18N::translate('Request new user account') . '</a></td>';
}
$content .= "</tr>";
$content .= "</table>";
diff --git a/modules_v3/gedcom_favorites/db_schema/db_schema_0_1.php b/modules_v3/gedcom_favorites/db_schema/db_schema_0_1.php
index 82dacab5f7..067ed16519 100644
--- a/modules_v3/gedcom_favorites/db_schema/db_schema_0_1.php
+++ b/modules_v3/gedcom_favorites/db_schema/db_schema_0_1.php
@@ -32,17 +32,17 @@
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
WT_DB::exec(
- "CREATE TABLE IF NOT EXISTS `##favorites` (".
- " fv_id INTEGER AUTO_INCREMENT NOT NULL,".
- " fv_username VARCHAR(32) NOT NULL,".
- " fv_gid VARCHAR(20) NULL,".
- " fv_type VARCHAR(15) NULL,".
- " fv_file VARCHAR(100) NULL,".
- " fv_url VARCHAR(255) NULL,".
- " fv_title VARCHAR(255) NULL,".
- " fv_note TEXT NULL,".
- " PRIMARY KEY (fv_id),".
- " KEY ix1 (fv_username)".
+ "CREATE TABLE IF NOT EXISTS `##favorites` (" .
+ " fv_id INTEGER AUTO_INCREMENT NOT NULL," .
+ " fv_username VARCHAR(32) NOT NULL," .
+ " fv_gid VARCHAR(20) NULL," .
+ " fv_type VARCHAR(15) NULL," .
+ " fv_file VARCHAR(100) NULL," .
+ " fv_url VARCHAR(255) NULL," .
+ " fv_title VARCHAR(255) NULL," .
+ " fv_note TEXT NULL," .
+ " PRIMARY KEY (fv_id)," .
+ " KEY ix1 (fv_username)" .
") COLLATE utf8_unicode_ci ENGINE=InnoDB"
);
diff --git a/modules_v3/gedcom_favorites/db_schema/db_schema_1_2.php b/modules_v3/gedcom_favorites/db_schema/db_schema_1_2.php
index 5706534f21..7cb8f54c7f 100644
--- a/modules_v3/gedcom_favorites/db_schema/db_schema_1_2.php
+++ b/modules_v3/gedcom_favorites/db_schema/db_schema_1_2.php
@@ -28,16 +28,16 @@
// Add the new columns
try {
WT_DB::exec(
- "ALTER TABLE `##favorites`".
- " CHANGE fv_id favorite_id INTEGER AUTO_INCREMENT NOT NULL,".
- " CHANGE fv_gid xref VARCHAR(20) NULL,".
- " CHANGE fv_type favorite_type ENUM('INDI', 'FAM', 'SOUR', 'REPO', 'OBJE', 'NOTE', 'URL') NOT NULL,".
- " CHANGE fv_url url VARCHAR(255) NULL,".
- " CHANGE fv_title title VARCHAR(255) NULL,".
- " CHANGE fv_note note VARCHAR(1000) NULL,".
- " ADD user_id INTEGER NULL AFTER favorite_id,".
- " ADD gedcom_id INTEGER NOT NULL AFTER user_id,".
- " DROP KEY ix1,".
+ "ALTER TABLE `##favorites`" .
+ " CHANGE fv_id favorite_id INTEGER AUTO_INCREMENT NOT NULL," .
+ " CHANGE fv_gid xref VARCHAR(20) NULL," .
+ " CHANGE fv_type favorite_type ENUM('INDI', 'FAM', 'SOUR', 'REPO', 'OBJE', 'NOTE', 'URL') NOT NULL," .
+ " CHANGE fv_url url VARCHAR(255) NULL," .
+ " CHANGE fv_title title VARCHAR(255) NULL," .
+ " CHANGE fv_note note VARCHAR(1000) NULL," .
+ " ADD user_id INTEGER NULL AFTER favorite_id," .
+ " ADD gedcom_id INTEGER NOT NULL AFTER user_id," .
+ " DROP KEY ix1," .
" ADD KEY news_ix1 (gedcom_id, user_id)"
);
} catch (PDOException $ex) {
@@ -47,9 +47,9 @@ try {
// Migrate data from the old columns to the new ones
try {
WT_DB::exec(
- "UPDATE `##favorites` f".
- " LEFT JOIN `##gedcom` g ON (f.fv_file =g.gedcom_name)".
- " LEFT JOIN `##user` u ON (f.fv_username=u.user_name)".
+ "UPDATE `##favorites` f" .
+ " LEFT JOIN `##gedcom` g ON (f.fv_file =g.gedcom_name)" .
+ " LEFT JOIN `##user` u ON (f.fv_username=u.user_name)" .
" SET f.gedcom_id=g.gedcom_id, f.user_id=u.user_id"
);
} catch (PDOException $ex) {
diff --git a/modules_v3/gedcom_favorites/db_schema/db_schema_2_3.php b/modules_v3/gedcom_favorites/db_schema/db_schema_2_3.php
index a86d1f4447..3ecfe21b95 100644
--- a/modules_v3/gedcom_favorites/db_schema/db_schema_2_3.php
+++ b/modules_v3/gedcom_favorites/db_schema/db_schema_2_3.php
@@ -28,16 +28,16 @@
// Delete any data that might violate the new constraints
WT_DB::exec(
- "DELETE FROM `##favorite`".
- " WHERE user_id NOT IN (SELECT user_id FROM `##user` )".
+ "DELETE FROM `##favorite`" .
+ " WHERE user_id NOT IN (SELECT user_id FROM `##user` )" .
" OR gedcom_id NOT IN (SELECT gedcom_id FROM `##gedcom`)"
);
// Add the new constraints
try {
WT_DB::exec(
- "ALTER TABLE `##favorite`".
- " ADD FOREIGN KEY favorite_fk1 (user_id ) REFERENCES `##user` (user_id) ON DELETE CASCADE,".
+ "ALTER TABLE `##favorite`" .
+ " ADD FOREIGN KEY favorite_fk1 (user_id ) REFERENCES `##user` (user_id) ON DELETE CASCADE," .
" ADD FOREIGN KEY favorite_fk2 (gedcom_id) REFERENCES `##gedcom` (gedcom_id) ON DELETE CASCADE"
);
} catch (PDOException $ex) {
diff --git a/modules_v3/gedcom_news/db_schema/db_schema_0_1.php b/modules_v3/gedcom_news/db_schema/db_schema_0_1.php
index 873ce7f8fa..22ad81f088 100644
--- a/modules_v3/gedcom_news/db_schema/db_schema_0_1.php
+++ b/modules_v3/gedcom_news/db_schema/db_schema_0_1.php
@@ -29,14 +29,14 @@
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
WT_DB::exec(
- "CREATE TABLE IF NOT EXISTS `##news` (".
- " n_id INTEGER AUTO_INCREMENT NOT NULL,".
- " n_username VARCHAR(100) NOT NULL,".
- " n_date INTEGER NOT NULL,".
- " n_title VARCHAR(255) NOT NULL,".
- " n_text TEXT NOT NULL,".
- " PRIMARY KEY (n_id),".
- " KEY ix1 (n_username)".
+ "CREATE TABLE IF NOT EXISTS `##news` (" .
+ " n_id INTEGER AUTO_INCREMENT NOT NULL," .
+ " n_username VARCHAR(100) NOT NULL," .
+ " n_date INTEGER NOT NULL," .
+ " n_title VARCHAR(255) NOT NULL," .
+ " n_text TEXT NOT NULL," .
+ " PRIMARY KEY (n_id)," .
+ " KEY ix1 (n_username)" .
") COLLATE utf8_unicode_ci ENGINE=InnoDB"
);
diff --git a/modules_v3/gedcom_news/db_schema/db_schema_1_2.php b/modules_v3/gedcom_news/db_schema/db_schema_1_2.php
index ce0ed30d8b..c90e6d845b 100644
--- a/modules_v3/gedcom_news/db_schema/db_schema_1_2.php
+++ b/modules_v3/gedcom_news/db_schema/db_schema_1_2.php
@@ -28,11 +28,11 @@
// Add new columns
try {
WT_DB::exec(
- "ALTER TABLE `##news`".
- " ADD user_id INTEGER NULL AFTER n_id,".
- " ADD gedcom_id INTEGER NULL AFTER user_id,".
- " ADD updated TIMESTAMP ON UPDATE CURRENT_TIMESTAMP DEFAULT CURRENT_TIMESTAMP,".
- " ADD KEY news_ix1 (user_id, updated),".
+ "ALTER TABLE `##news`" .
+ " ADD user_id INTEGER NULL AFTER n_id," .
+ " ADD gedcom_id INTEGER NULL AFTER user_id," .
+ " ADD updated TIMESTAMP ON UPDATE CURRENT_TIMESTAMP DEFAULT CURRENT_TIMESTAMP," .
+ " ADD KEY news_ix1 (user_id, updated)," .
" ADD KEY news_ix2 (gedcom_id, updated)"
);
} catch (PDOException $ex) {
@@ -42,9 +42,9 @@ try {
// Migrate data from the old columns to the new ones
try {
WT_DB::exec(
- "UPDATE `##news` n".
- " LEFT JOIN `##gedcom` g ON (n.n_username=g.gedcom_name)".
- " LEFT JOIN `##user` u ON (n.n_username=u.user_name)".
+ "UPDATE `##news` n" .
+ " LEFT JOIN `##gedcom` g ON (n.n_username=g.gedcom_name)" .
+ " LEFT JOIN `##user` u ON (n.n_username=u.user_name)" .
" SET n.gedcom_id=g.gedcom_id, n.user_id=u.user_id, updated=FROM_UNIXTIME(n_date)"
);
} catch (PDOException $ex) {
@@ -63,10 +63,10 @@ try {
// Delete/rename old columns
try {
WT_DB::exec(
- "ALTER TABLE `##news`".
- " DROP n_username, DROP n_date,".
- " CHANGE n_id news_id INTEGER NOT NULL AUTO_INCREMENT,".
- " CHANGE n_title subject VARCHAR(255) COLLATE utf8_unicode_ci,".
+ "ALTER TABLE `##news`" .
+ " DROP n_username, DROP n_date," .
+ " CHANGE n_id news_id INTEGER NOT NULL AUTO_INCREMENT," .
+ " CHANGE n_title subject VARCHAR(255) COLLATE utf8_unicode_ci," .
" CHANGE n_text body TEXT COLLATE utf8_unicode_ci"
);
} catch (PDOException $ex) {
diff --git a/modules_v3/gedcom_news/db_schema/db_schema_2_3.php b/modules_v3/gedcom_news/db_schema/db_schema_2_3.php
index ac0162503f..8136ba7661 100644
--- a/modules_v3/gedcom_news/db_schema/db_schema_2_3.php
+++ b/modules_v3/gedcom_news/db_schema/db_schema_2_3.php
@@ -28,16 +28,16 @@
// Delete any data that might violate the new constraints
WT_DB::exec(
- "DELETE FROM `##news`".
- " WHERE user_id NOT IN (SELECT user_id FROM `##user` )".
+ "DELETE FROM `##news`" .
+ " WHERE user_id NOT IN (SELECT user_id FROM `##user` )" .
" OR gedcom_id NOT IN (SELECT gedcom_id FROM `##gedcom`)"
);
// Add the new constraints
try {
WT_DB::exec(
- "ALTER TABLE `##news`".
- " ADD FOREIGN KEY news_fk1 (user_id ) REFERENCES `##user` (user_id) ON DELETE CASCADE,".
+ "ALTER TABLE `##news`" .
+ " ADD FOREIGN KEY news_fk1 (user_id ) REFERENCES `##user` (user_id) ON DELETE CASCADE," .
" ADD FOREIGN KEY news_fk2 (gedcom_id) REFERENCES `##gedcom` (gedcom_id) ON DELETE CASCADE"
);
} catch (PDOException $ex) {
diff --git a/modules_v3/gedcom_news/module.php b/modules_v3/gedcom_news/module.php
index a7626a4a88..1d99e9ea8a 100644
--- a/modules_v3/gedcom_news/module.php
+++ b/modules_v3/gedcom_news/module.php
@@ -101,7 +101,7 @@ class gedcom_news_WT_Module extends WT_Module implements WT_Module_Block {
$c++;
}
if ($limit == 'date') {
- if ((int)((WT_TIMESTAMP - $news->updated) / 86400) > $flag) {
+ if ((int) ((WT_TIMESTAMP - $news->updated) / 86400) > $flag) {
break;
}
}
@@ -114,7 +114,7 @@ class gedcom_news_WT_Module extends WT_Module implements WT_Module_Block {
$content .= $news->body;
// Print Admin options for this News item
if (WT_USER_GEDCOM_ADMIN) {
- $content .= '<hr>' . '<a href="#" onclick="window.open(\'editnews.php?news_id=\'+' . $news->news_id . ', \'_blank\', news_window_specs); return false;">' . WT_I18N::translate('Edit') . '</a> | ' . '<a href="index.php?action=deletenews&amp;news_id=' . $news->news_id . '&amp;ctype=' . $ctype .'" onclick="return confirm(\'' . WT_I18N::translate('Are you sure you want to delete this news article?') . "');\">" . WT_I18N::translate('Delete') . '</a><br>';
+ $content .= '<hr>' . '<a href="#" onclick="window.open(\'editnews.php?news_id=\'+' . $news->news_id . ', \'_blank\', news_window_specs); return false;">' . WT_I18N::translate('Edit') . '</a> | ' . '<a href="index.php?action=deletenews&amp;news_id=' . $news->news_id . '&amp;ctype=' . $ctype . '" onclick="return confirm(\'' . WT_I18N::translate('Are you sure you want to delete this news article?') . "');\">" . WT_I18N::translate('Delete') . '</a><br>';
}
$content .= '</div>';
}
@@ -127,7 +127,7 @@ class gedcom_news_WT_Module extends WT_Module implements WT_Module_Block {
if ($printedAddLink) {
$content .= '&nbsp;&nbsp;|&nbsp;&nbsp;';
}
- $content .= '<a href="index.php?gedcom_news_archive=yes&amp;ctype=' . $ctype .'">' . WT_I18N::translate('View archive') . "</a>";
+ $content .= '<a href="index.php?gedcom_news_archive=yes&amp;ctype=' . $ctype . '">' . WT_I18N::translate('View archive') . "</a>";
$content .= help_link('gedcom_news_archive') . '<br>';
}