summaryrefslogtreecommitdiff
path: root/includes/controllers
diff options
context:
space:
mode:
Diffstat (limited to 'includes/controllers')
-rw-r--r--includes/controllers/advancedsearch_ctrl.php12
-rw-r--r--includes/controllers/ancestry_ctrl.php3
-rw-r--r--includes/controllers/descendancy_ctrl.php3
-rw-r--r--includes/controllers/hourglass_ctrl.php56
-rw-r--r--includes/controllers/individual_ctrl.php23
-rw-r--r--includes/controllers/media_ctrl.php4
-rw-r--r--includes/controllers/pedigree_ctrl.php16
-rw-r--r--includes/controllers/remotelink_ctrl.php2
-rw-r--r--includes/controllers/search_ctrl.php34
9 files changed, 72 insertions, 81 deletions
diff --git a/includes/controllers/advancedsearch_ctrl.php b/includes/controllers/advancedsearch_ctrl.php
index c877ebb999..3c84a11bc1 100644
--- a/includes/controllers/advancedsearch_ctrl.php
+++ b/includes/controllers/advancedsearch_ctrl.php
@@ -5,7 +5,7 @@
// Copyright (C) 2010 webtrees development team.
//
// Derived from PhpGedView
-// Copyright (C) 2002 to 2009 PGV Development Team. All rights reserved.
+// Copyright (C) 2002 to 2009 PGV Development Team. All rights reserved.
//
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
@@ -405,17 +405,17 @@ class AdvancedSearchController extends SearchController {
$liketmp='';
for($j=0; $j<$ct; $j++) {
$liketmp.= "%".($j+1)." ".$parts[$j]." %";
-// if ($j<$ct-1) {
-// $sqlwhere .= "%";
-// } else {
+ //if ($j<$ct-1) {
+ //$sqlwhere .= "%";
+ //} else {
$liketmp .= "%{$value}%";
-// }
+ //}
}
$sqlwhere .= WT_DB::quote($liketmp);
}
}
$sql = $sqlfields.$sqltables.$sqlwhere;
-// print $sql;
+ //print $sql;
if ($justSql) return $sql;
$rows=WT_DB::prepare($sql)->fetchAll(PDO::FETCH_ASSOC);
foreach ($rows as $row){
diff --git a/includes/controllers/ancestry_ctrl.php b/includes/controllers/ancestry_ctrl.php
index 9514c5f06b..c587a349d8 100644
--- a/includes/controllers/ancestry_ctrl.php
+++ b/includes/controllers/ancestry_ctrl.php
@@ -5,7 +5,7 @@
// Copyright (C) 2010 webtrees development team.
//
// Derived from PhpGedView
-// Copyright (C) 2002 to 2009 PGV Development Team. All rights reserved.
+// Copyright (C) 2002 to 2009 PGV Development Team. All rights reserved.
//
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
@@ -167,5 +167,4 @@ class AncestryController extends BaseController {
}
print "</li>\r\n";
}
-
}
diff --git a/includes/controllers/descendancy_ctrl.php b/includes/controllers/descendancy_ctrl.php
index f2d5822d83..757086f455 100644
--- a/includes/controllers/descendancy_ctrl.php
+++ b/includes/controllers/descendancy_ctrl.php
@@ -5,7 +5,7 @@
// Copyright (C) 2010 webtrees development team.
//
// Derived from PhpGedView
-// Copyright (C) 2002 to 2009 PGV Development Team. All rights reserved.
+// Copyright (C) 2002 to 2009 PGV Development Team. All rights reserved.
//
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
@@ -288,5 +288,4 @@ function print_family_descendancy(&$person, &$family, $depth) {
print "</li>\r\n";
}
}
-
}
diff --git a/includes/controllers/hourglass_ctrl.php b/includes/controllers/hourglass_ctrl.php
index 6ba4df078c..fddef1a811 100644
--- a/includes/controllers/hourglass_ctrl.php
+++ b/includes/controllers/hourglass_ctrl.php
@@ -202,7 +202,6 @@ class HourglassController extends BaseController {
$tablealign = "left";
$otablealign = "right";
}
- // print $this->dgenerations;
print "<!-- print_descendency for $pid -->";
//-- put a space between families on the last generation
if ($count==$this->dgenerations-1) {
@@ -494,37 +493,37 @@ class HourglassController extends BaseController {
}
// Hourglass control..... Ajax arrows at the end of chart
- function ChangeDiv(div_id, ARID, full, spouse, width) {
- var divelement = document.getElementById(div_id);
- var oXmlHttp = createXMLHttp();
- oXmlHttp.open("get", "hourglass_ajax.php?show_full="+full+"&pid="+ ARID + "&generations=1&box_width="+width+"&show_spouse="+spouse, true);
- oXmlHttp.onreadystatechange=function()
- {
- if (oXmlHttp.readyState==4)
- {
- divelement.innerHTML = oXmlHttp.responseText;
- sizeLines();
- }
- };
- oXmlHttp.send(null);
- return false;
+ function ChangeDiv(div_id, ARID, full, spouse, width) {
+ var divelement = document.getElementById(div_id);
+ var oXmlHttp = createXMLHttp();
+ oXmlHttp.open("get", "hourglass_ajax.php?show_full="+full+"&pid="+ ARID + "&generations=1&box_width="+width+"&show_spouse="+spouse, true);
+ oXmlHttp.onreadystatechange=function()
+ {
+ if (oXmlHttp.readyState==4)
+ {
+ divelement.innerHTML = oXmlHttp.responseText;
+ sizeLines();
+ }
+ };
+ oXmlHttp.send(null);
+ return false;
}
// Hourglass control..... Ajax arrows at the end of descendants chart
function ChangeDis(div_id, ARID, full, spouse, width) {
- var divelement = document.getElementById(div_id);
- var oXmlHttp = createXMLHttp();
- oXmlHttp.open("get", "hourglass_ajax.php?type=desc&show_full="+full+"&pid="+ ARID + "&generations=1&box_width="+width+"&show_spouse="+spouse, true);
- oXmlHttp.onreadystatechange=function()
- {
- if (oXmlHttp.readyState==4)
- {
- divelement.innerHTML = oXmlHttp.responseText;
- sizeLines();
- }
- };
- oXmlHttp.send(null);
- return false;
+ var divelement = document.getElementById(div_id);
+ var oXmlHttp = createXMLHttp();
+ oXmlHttp.open("get", "hourglass_ajax.php?type=desc&show_full="+full+"&pid="+ ARID + "&generations=1&box_width="+width+"&show_spouse="+spouse, true);
+ oXmlHttp.onreadystatechange=function()
+ {
+ if (oXmlHttp.readyState==4)
+ {
+ divelement.innerHTML = oXmlHttp.responseText;
+ sizeLines();
+ }
+ };
+ oXmlHttp.send(null);
+ return false;
}
function sizeLines() {
@@ -557,5 +556,4 @@ class HourglassController extends BaseController {
</script>
<?php
}
-
}
diff --git a/includes/controllers/individual_ctrl.php b/includes/controllers/individual_ctrl.php
index ca5879f983..8119715905 100644
--- a/includes/controllers/individual_ctrl.php
+++ b/includes/controllers/individual_ctrl.php
@@ -300,7 +300,7 @@ class IndividualController extends BaseController {
if ($this->canShowHighlightedObject()) {
$firstmediarec = $this->indi->findHighlightedMedia();
if (!empty($firstmediarec)) {
- $filename = thumb_or_main($firstmediarec); // Do we send the main image or a thumbnail?
+ $filename = thumb_or_main($firstmediarec); // Do we send the main image or a thumbnail?
if (!$USE_THUMBS_MAIN || $firstmediarec["_THUM"]=='Y') {
$class = "image";
} else {
@@ -464,10 +464,8 @@ class IndividualController extends BaseController {
echo '</dd>';
echo '</dl>';
// -- find sources
- // print "&nbsp;&nbsp;&nbsp;";
print_fact_sources($event->getGedComRecord(), 2);
//-- find the notes
- // print "&nbsp;&nbsp;&nbsp;";
print_fact_notes($event->getGedComRecord(), 2);
echo '</div>';
}
@@ -854,9 +852,9 @@ class IndividualController extends BaseController {
$famcrec = get_sub_record(1, "1 FAMC @".$family->getXref()."@", $children[$i]->getGedcomRecord());
$pedi = get_gedcom_value("PEDI", 2, $famcrec, '', false);
if ($pedi) {
- if ($sex=="F" && isset($PEDI_CODES[$pedi])) $label .= "<br />(".$PEDI_CODES_F[$pedi].")";
- else if ($sex=="M" && isset($PEDI_CODES[$pedi])) $label .= "<br />(".$PEDI_CODES_M[$pedi].")";
- else if (isset($PEDI_CODES[$pedi])) $label .= "<br />(".$PEDI_CODES[$pedi].")";
+ if ($sex=="F" && isset($PEDI_CODES[$pedi])) $label .= "<br />(".$PEDI_CODES_F[$pedi].")";
+ else if ($sex=="M" && isset($PEDI_CODES[$pedi])) $label .= "<br />(".$PEDI_CODES_M[$pedi].")";
+ else if (isset($PEDI_CODES[$pedi])) $label .= "<br />(".$PEDI_CODES[$pedi].")";
}
$children[$i]->setLabel($label);
}
@@ -873,9 +871,9 @@ class IndividualController extends BaseController {
}
if ($newchildren[$i]->getXref()==$this->pid) $label = "<img src=\"". $WT_IMAGES["selected"]. "\" alt=\"\" />";
$pedi = $newchildren[$i]->getChildFamilyPedigree($family->getXref());
- if ($sex=="F" && isset($PEDI_CODES[$pedi])) $label .= "<br />(".$PEDI_CODES_F[$pedi].")";
- else if ($sex=="M" && isset($PEDI_CODES[$pedi])) $label .= "<br />(".$PEDI_CODES_M[$pedi].")";
- else if (isset($PEDI_CODES[$pedi])) $label .= "<br />(".$PEDI_CODES[$pedi].")";
+ if ($sex=="F" && isset($PEDI_CODES[$pedi])) $label .= "<br />(".$PEDI_CODES_F[$pedi].")";
+ else if ($sex=="M" && isset($PEDI_CODES[$pedi])) $label .= "<br />(".$PEDI_CODES_M[$pedi].")";
+ else if (isset($PEDI_CODES[$pedi])) $label .= "<br />(".$PEDI_CODES[$pedi].")";
$newchildren[$i]->setLabel($label);
}
$num = count($delchildren);
@@ -890,9 +888,9 @@ class IndividualController extends BaseController {
}
if ($delchildren[$i]->getXref()==$this->pid) $label = "<img src=\"". $WT_IMAGES["selected"]. "\" alt=\"\" />";
$pedi = $delchildren[$i]->getChildFamilyPedigree($family->getXref());
- if ($sex=="F" && isset($PEDI_CODES[$pedi])) $label .= "<br />(".$PEDI_CODES_F[$pedi].")";
- else if ($sex=="M" && isset($PEDI_CODES[$pedi])) $label .= "<br />(".$PEDI_CODES_M[$pedi].")";
- else if (isset($PEDI_CODES[$pedi])) $label .= "<br />(".$PEDI_CODES[$pedi].")";
+ if ($sex=="F" && isset($PEDI_CODES[$pedi])) $label .= "<br />(".$PEDI_CODES_F[$pedi].")";
+ else if ($sex=="M" && isset($PEDI_CODES[$pedi])) $label .= "<br />(".$PEDI_CODES_M[$pedi].")";
+ else if (isset($PEDI_CODES[$pedi])) $label .= "<br />(".$PEDI_CODES[$pedi].")";
$delchildren[$i]->setLabel($label);
}
if (!is_null($newhusb)) $people['newhusb'] = $newhusb;
@@ -920,5 +918,4 @@ class IndividualController extends BaseController {
// -----------------------------------------------------------------------------
// End GedFact Assistant Functions
// -----------------------------------------------------------------------------
-
}
diff --git a/includes/controllers/media_ctrl.php b/includes/controllers/media_ctrl.php
index e3efe0c9b4..cbb26c989f 100644
--- a/includes/controllers/media_ctrl.php
+++ b/includes/controllers/media_ctrl.php
@@ -323,7 +323,7 @@ class MediaController extends BaseController{
$facts = $this->mediaobject->getFacts($ignore);
sort_facts($facts);
-// if ($includeFileName) $facts[] = new Event("1 FILE ".$this->mediaobject->getFilename());
+ //if ($includeFileName) $facts[] = new Event("1 FILE ".$this->mediaobject->getFilename());
$mediaType = $this->mediaobject->getMediatype();
if (array_key_exists($mediaType, $MEDIA_TYPES)) $facts[] = new Event("1 TYPE ".$MEDIA_TYPES[$mediaType]);
else $facts[] = new Event("1 TYPE ".i18n::translate('Other'));
@@ -398,6 +398,4 @@ class MediaController extends BaseController{
function getServerFilename() {
return $this->mediaobject->getServerFilename();
}
-
}
-
diff --git a/includes/controllers/pedigree_ctrl.php b/includes/controllers/pedigree_ctrl.php
index 740282040a..8e4af5c92f 100644
--- a/includes/controllers/pedigree_ctrl.php
+++ b/includes/controllers/pedigree_ctrl.php
@@ -68,7 +68,7 @@ class PedigreeController extends BaseController {
$this->talloffset=safe_GET('talloffset', array('0', '1', '2', '3'), $PEDIGREE_LAYOUT);
$this->PEDIGREE_GENERATIONS=safe_GET_integer('PEDIGREE_GENERATIONS', 2, $MAX_PEDIGREE_GENERATIONS, $DEFAULT_PEDIGREE_GENERATIONS);
- if ($this->talloffset==1) $this->talloffset=1; // Make SURE this is an integer
+ if ($this->talloffset==1) $this->talloffset=1; // Make SURE this is an integer
if ($this->talloffset>1 && $this->PEDIGREE_GENERATIONS>8) $this->PEDIGREE_GENERATIONS=8;
// TODO: some library functions expect this as a global.
@@ -77,7 +77,7 @@ class PedigreeController extends BaseController {
$PEDIGREE_GENERATIONS=$this->PEDIGREE_GENERATIONS;
// This is passed as a global. A parameter would be better...
- $this->show_full = ($this->show_full) ? 1 : 0; // Make SURE this is an integer
+ $this->show_full = ($this->show_full) ? 1 : 0; // Make SURE this is an integer
if ($this->talloffset>3) {
$this->talloffset=3;
} elseif ($this->talloffset<0) {
@@ -148,10 +148,10 @@ class PedigreeController extends BaseController {
}
}
// -- this next section will create and position the DIV layers for the pedigree tree
- $this->curgen = 1; // -- variable to track which generation the algorithm is currently working on
- $this->yoffset=0; // -- used to offset the position of each box as it is generated
+ $this->curgen = 1; // -- variable to track which generation the algorithm is currently working on
+ $this->yoffset=0; // -- used to offset the position of each box as it is generated
$this->xoffset=0;
- $this->prevyoffset=0; // -- used to track the y position of the previous box
+ $this->prevyoffset=0; // -- used to track the y position of the previous box
$this->offsetarray = array();
$this->minyoffset = 0;
if ($this->treesize<3) $this->treesize=3;
@@ -173,7 +173,7 @@ class PedigreeController extends BaseController {
$genoffset = pow(2, $this->curgen-1);
$boxspacing = $this->pbwidth+$byspacing;
}
- // -- calculate the yoffset Position in the generation Spacing between boxes put child between parents
+ // -- calculate the yoffset Position in the generation Spacing between boxes put child between parents
$this->yoffset = $baseyoffset+($boxpos * ($boxspacing * $genoffset))+(($boxspacing/2)*$genoffset)+($boxspacing * $genoffset);
// -- calculate the xoffset
if ($this->talloffset==0) {
@@ -216,7 +216,7 @@ class PedigreeController extends BaseController {
else if ($this->talloffset==1) {
$this->xoffset = 10 + $basexoffset + (($this->PEDIGREE_GENERATIONS - $this->curgen) * ($this->pbwidth+$bxspacing));
if ($this->curgen == $this->PEDIGREE_GENERATIONS) $this->xoffset += 10;
- if ($this->PEDIGREE_GENERATIONS<4) $this->xoffset += 60;
+ if ($this->PEDIGREE_GENERATIONS<4) $this->xoffset += 60;
}
else if ($this->talloffset==2) {
if ($this->show_full) $this->xoffset = ($this->curgen) * (($this->pbwidth+$bxspacing) / 2)+($this->curgen)*10+136.5;
@@ -252,7 +252,7 @@ class PedigreeController extends BaseController {
/**
* return the title of this page
- * @return string the title of the page to go in the <title> tags
+ * @return string the title of the page to go in the <title> tags
*/
function getPageTitle() {
return $this->getPersonName()." ".i18n::translate('Pedigree Tree');
diff --git a/includes/controllers/remotelink_ctrl.php b/includes/controllers/remotelink_ctrl.php
index 3111e8933b..8f2c68d08f 100644
--- a/includes/controllers/remotelink_ctrl.php
+++ b/includes/controllers/remotelink_ctrl.php
@@ -142,7 +142,7 @@ class RemoteLinkController extends BaseController {
if (!$sid) {
echo '<span class="error">failed to authenticate to remote site</span>';
$serverID=null;
- } else {
+ } else {
if (!$title) {
$title=$service->getServiceTitle();
}
diff --git a/includes/controllers/search_ctrl.php b/includes/controllers/search_ctrl.php
index 18deead47d..35e126cde8 100644
--- a/includes/controllers/search_ctrl.php
+++ b/includes/controllers/search_ctrl.php
@@ -5,7 +5,7 @@
// Copyright (C) 2010 webtrees development team.
//
// Derived from PhpGedView
-// Copyright (C) 2002 to 2009 PGV Development Team. All rights reserved.
+// Copyright (C) 2002 to 2009 PGV Development Team. All rights reserved.
//
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
@@ -51,7 +51,7 @@ class SearchController extends BaseController {
var $multiTotalResults = -1;
var $query;
var $myquery = "";
-// var $soundex = "Russell";
+ //var $soundex = "Russell";
var $soundex = "DaitchM";
var $subaction = "";
var $nameprt = "";
@@ -364,7 +364,7 @@ class SearchController extends BaseController {
}
/**
- * Gathers results for a general search
+ * Gathers results for a general search
*/
function GeneralSearch() {
global $GEDCOM;
@@ -500,12 +500,12 @@ class SearchController extends BaseController {
} else {
if($this->replaceNames) {
foreach($name_tags as $f=>$tag) {
- $newRecord = preg_replace("~(\d) ".$tag." (.*)".$oldquery."(.*)~i", "$1 ".$tag." $2".$this->replace."$3", $newRecord);
+ $newRecord = preg_replace("~(\d) ".$tag." (.*)".$oldquery."(.*)~i", "$1 ".$tag." $2".$this->replace."$3", $newRecord);
}
}
if($this->replacePlaces) {
- if ($this->replacePlacesWord) $newRecord = preg_replace('~(\d) PLAC (.*)([,\W\s])'.$oldquery.'([,\W\s])~i', "$1 PLAC $2$3".$this->replace."$4",$newRecord);
- else $newRecord = preg_replace("~(\d) PLAC (.*)".$oldquery."(.*)~i", "$1 PLAC $2".$this->replace."$3",$newRecord);
+ if ($this->replacePlacesWord) $newRecord = preg_replace('~(\d) PLAC (.*)([,\W\s])'.$oldquery.'([,\W\s])~i', "$1 PLAC $2$3".$this->replace."$4",$newRecord);
+ else $newRecord = preg_replace("~(\d) PLAC (.*)".$oldquery."(.*)~i", "$1 PLAC $2".$this->replace."$3",$newRecord);
}
}
//-- if the record changed replace the record otherwise remove it from the search results
@@ -526,8 +526,8 @@ class SearchController extends BaseController {
}
else {
if($this->replacePlaces) {
- if ($this->replacePlacesWord) $newRecord = preg_replace('~(\d) PLAC (.*)([,\W\s])'.$oldquery.'([,\W\s])~i', "$1 PLAC $2$3".$this->replace."$4",$newRecord);
- else $newRecord = preg_replace("~(\d) PLAC (.*)".$oldquery."(.*)~i", "$1 PLAC $2".$this->replace."$3",$newRecord);
+ if ($this->replacePlacesWord) $newRecord = preg_replace('~(\d) PLAC (.*)([,\W\s])'.$oldquery.'([,\W\s])~i', "$1 PLAC $2$3".$this->replace."$4",$newRecord);
+ else $newRecord = preg_replace("~(\d) PLAC (.*)".$oldquery."(.*)~i", "$1 PLAC $2".$this->replace."$3",$newRecord);
}
}
//-- if the record changed replace the record otherwise remove it from the search results
@@ -547,18 +547,18 @@ class SearchController extends BaseController {
$newRecord = preg_replace("~".$oldquery."~i", $this->replace, $newRecord);
} else {
if($this->replaceNames) {
- $newRecord = preg_replace("~(\d) TITL (.*)".$oldquery."(.*)~i", "$1 TITL $2".$this->replace."$3", $newRecord);
- $newRecord = preg_replace("~(\d) ABBR (.*)".$oldquery."(.*)~i", "$1 ABBR $2".$this->replace."$3", $newRecord);
+ $newRecord = preg_replace("~(\d) TITL (.*)".$oldquery."(.*)~i", "$1 TITL $2".$this->replace."$3", $newRecord);
+ $newRecord = preg_replace("~(\d) ABBR (.*)".$oldquery."(.*)~i", "$1 ABBR $2".$this->replace."$3", $newRecord);
}
if($this->replacePlaces) {
- if ($this->replacePlacesWord) $newRecord = preg_replace('~(\d) PLAC (.*)([,\W\s])'.$oldquery.'([,\W\s])~i', "$1 PLAC $2$3".$this->replace."$4",$newRecord);
- else $newRecord = preg_replace("~(\d) PLAC (.*)".$oldquery."(.*)~i", "$1 PLAC $2".$this->replace."$3",$newRecord);
+ if ($this->replacePlacesWord) $newRecord = preg_replace('~(\d) PLAC (.*)([,\W\s])'.$oldquery.'([,\W\s])~i', "$1 PLAC $2$3".$this->replace."$4",$newRecord);
+ else $newRecord = preg_replace("~(\d) PLAC (.*)".$oldquery."(.*)~i", "$1 PLAC $2".$this->replace."$3",$newRecord);
}
}
//-- if the record changed replace the record otherwise remove it from the search results
if($newRecord != $oldRecord) {
replace_gedrec($source->getXref(), WT_GED_ID, $newRecord);
- } else {
+ } else {
unset($this->mysourcelist[$id]);
}
}
@@ -574,14 +574,14 @@ class SearchController extends BaseController {
//-- if the record changed replace the record otherwise remove it from the search results
if($newRecord != $oldRecord) {
replace_gedrec($note->getXref(), WT_GED_ID, $newRecord);
- } else {
+ } else {
unset($this->mynotelist[$id]);
}
}
}
/**
- * Gathers results for a soundex search
+ * Gathers results for a soundex search
*
* TODO
* ====
@@ -718,7 +718,7 @@ class SearchController extends BaseController {
require_once WT_ROOT.'includes/functions/functions_print_lists.php';
global $GEDCOM, $TEXT_DIRECTION, $WT_IMAGES;
- $somethingPrinted = false; // whether anything printed
+ $somethingPrinted = false; // whether anything printed
// ---- section to search and display results on a general keyword search
if ($this->action=="general" || $this->action=="soundex" || $this->action=="replace") {
if ($this->myindilist || $this->myfamlist || $this->mysourcelist || $this->mynotelist) {
@@ -917,7 +917,7 @@ class SearchController extends BaseController {
$this->printPageResultsLinks($this->inputFieldNames, $this->totalResults, $this->multiResultsPerPage);
}
}
- return $somethingPrinted; // whether anything printed
+ return $somethingPrinted; // whether anything printed
}
/************************************************ Helper Methods ****************************************************************/