diff options
Diffstat (limited to 'library/WT')
79 files changed, 380 insertions, 324 deletions
diff --git a/library/WT/Controller/AdvancedSearch.php b/library/WT/Controller/AdvancedSearch.php index 767c8524a0..1bbbe02047 100644 --- a/library/WT/Controller/AdvancedSearch.php +++ b/library/WT/Controller/AdvancedSearch.php @@ -2,7 +2,7 @@ // Controller for the advanced search page // // webtrees: Web based Family History software -// Copyright (C) 2013 webtrees development team. +// Copyright (C) 2014 webtrees development team. // // Derived from PhpGedView // Copyright (C) 2002 to 2009 PGV Development Team. All rights reserved. @@ -19,7 +19,7 @@ // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA if (!defined('WT_WEBTREES')) { header('HTTP/1.0 403 Forbidden'); diff --git a/library/WT/Controller/Ajax.php b/library/WT/Controller/Ajax.php index 1864c0de5d..70fce74b6a 100644 --- a/library/WT/Controller/Ajax.php +++ b/library/WT/Controller/Ajax.php @@ -2,7 +2,7 @@ // Base controller for all popup pages // // webtrees: Web based Family History software -// Copyright (C) 2013 webtrees development team. +// Copyright (C) 2014 webtrees development team. // // 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 @@ -16,7 +16,7 @@ // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA if (!defined('WT_WEBTREES')) { header('HTTP/1.0 403 Forbidden'); diff --git a/library/WT/Controller/Ancestry.php b/library/WT/Controller/Ancestry.php index 25ee93af34..75e7dc41d5 100644 --- a/library/WT/Controller/Ancestry.php +++ b/library/WT/Controller/Ancestry.php @@ -2,7 +2,7 @@ // Controller for the ancestry chart // // webtrees: Web based Family History software -// Copyright (C) 2013 webtrees development team. +// Copyright (C) 2014 webtrees development team. // // Derived from PhpGedView // Copyright (C) 2002 to 2009 PGV Development Team. All rights reserved. @@ -19,7 +19,7 @@ // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA if (!defined('WT_WEBTREES')) { header('HTTP/1.0 403 Forbidden'); diff --git a/library/WT/Controller/Base.php b/library/WT/Controller/Base.php index eafcbf1814..1493c16f19 100644 --- a/library/WT/Controller/Base.php +++ b/library/WT/Controller/Base.php @@ -2,7 +2,7 @@ // Base controller for all other controllers // // webtrees: Web based Family History software -// Copyright (C) 2013 webtrees development team. +// Copyright (C) 2014 webtrees development team. // // 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 @@ -16,7 +16,7 @@ // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA if (!defined('WT_WEBTREES')) { header('HTTP/1.0 403 Forbidden'); diff --git a/library/WT/Controller/Branches.php b/library/WT/Controller/Branches.php index 5fc674fb43..05896b9350 100644 --- a/library/WT/Controller/Branches.php +++ b/library/WT/Controller/Branches.php @@ -2,7 +2,7 @@ // Controller for the branches list // // webtrees: Web based Family History software -// Copyright (C) 2013 webtrees development team. +// Copyright (C) 2014 webtrees development team. // // 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 @@ -16,7 +16,7 @@ // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA if (!defined('WT_WEBTREES')) { header('HTTP/1.0 403 Forbidden'); diff --git a/library/WT/Controller/Chart.php b/library/WT/Controller/Chart.php index 8d22af0385..bc114a3844 100644 --- a/library/WT/Controller/Chart.php +++ b/library/WT/Controller/Chart.php @@ -2,7 +2,7 @@ // Base controller for all chart pages // // webtrees: Web based Family History software -// Copyright (C) 2013 webtrees development team. +// Copyright (C) 2014 webtrees development team. // // 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 @@ -16,7 +16,7 @@ // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA if (!defined('WT_WEBTREES')) { header('HTTP/1.0 403 Forbidden'); diff --git a/library/WT/Controller/Compact.php b/library/WT/Controller/Compact.php index 2f61fbc488..3bac03fd23 100644 --- a/library/WT/Controller/Compact.php +++ b/library/WT/Controller/Compact.php @@ -2,7 +2,7 @@ // Controller for the compact chart // // webtrees: Web based Family History software -// Copyright (C) 2013 webtrees development team. +// Copyright (C) 2014 webtrees development team. // // Derived from PhpGedView // Copyright (C) 2002 to 2009 PGV Development Team. All rights reserved. @@ -19,7 +19,7 @@ // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA if (!defined('WT_WEBTREES')) { header('HTTP/1.0 403 Forbidden'); @@ -124,4 +124,4 @@ class WT_Controller_Compact extends WT_Controller_Chart { return $text; } -}
\ No newline at end of file +} diff --git a/library/WT/Controller/Descendancy.php b/library/WT/Controller/Descendancy.php index 0b4de75735..d553734040 100644 --- a/library/WT/Controller/Descendancy.php +++ b/library/WT/Controller/Descendancy.php @@ -2,7 +2,7 @@ // Controller for the descendancy chart // // webtrees: Web based Family History software -// Copyright (C) 2013 webtrees development team. +// Copyright (C) 2014 webtrees development team. // // Derived from PhpGedView // Copyright (C) 2002 to 2009 PGV Development Team. All rights reserved. @@ -19,7 +19,7 @@ // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA if (!defined('WT_WEBTREES')) { header('HTTP/1.0 403 Forbidden'); diff --git a/library/WT/Controller/Family.php b/library/WT/Controller/Family.php index a0307ee9a9..1e298009c6 100644 --- a/library/WT/Controller/Family.php +++ b/library/WT/Controller/Family.php @@ -2,7 +2,7 @@ // Controller for the family page // // webtrees: Web based Family History software -// Copyright (C) 2013 webtrees development team. +// Copyright (C) 2014 webtrees development team. // // Derived from PhpGedView // Copyright (C) 2002 to 2010 PGV Development Team. All rights reserved. @@ -19,7 +19,7 @@ // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA if (!defined('WT_WEBTREES')) { header('HTTP/1.0 403 Forbidden'); diff --git a/library/WT/Controller/Familybook.php b/library/WT/Controller/Familybook.php index db9041750c..bbf9c49487 100644 --- a/library/WT/Controller/Familybook.php +++ b/library/WT/Controller/Familybook.php @@ -2,7 +2,7 @@ // Controller for the familybook chart // // webtrees: Web based Family History software -// Copyright (C) 2013 webtrees development team. +// Copyright (C) 2014 webtrees development team. // // Derived from PhpGedView // Copyright (C) 2002 to 2009 PGV Development Team. All rights reserved. @@ -19,7 +19,7 @@ // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA if (!defined('WT_WEBTREES')) { header('HTTP/1.0 403 Forbidden'); diff --git a/library/WT/Controller/Fanchart.php b/library/WT/Controller/Fanchart.php index b76829e382..b8d1eaa572 100644 --- a/library/WT/Controller/Fanchart.php +++ b/library/WT/Controller/Fanchart.php @@ -2,7 +2,7 @@ // Controller for the fan chart // // webtrees: Web based Family History software -// Copyright (C) 2013 webtrees development team. +// Copyright (C) 2014 webtrees development team. // // Derived from PhpGedView // Copyright (C) 2002 to 2009 PGV Development Team. All rights reserved. @@ -19,7 +19,7 @@ // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA if (!defined('WT_WEBTREES')) { header('HTTP/1.0 403 Forbidden'); @@ -334,7 +334,7 @@ class WT_Controller_Fanchart extends WT_Controller_Chart { $html.= '<br><span class="name1">'.WT_I18N::translate('Sibling').'</span>'; } foreach ($children as $sibling) { - if ($sibling === $person) { + if ($sibling !== $person) { $html.= '<br> <a href="'.$sibling->getHtmlUrl().'" class="name1"> '.$sibling->getFullName().'</a>'; } } diff --git a/library/WT/Controller/GedcomRecord.php b/library/WT/Controller/GedcomRecord.php index ceefa594e0..fe41254d86 100644 --- a/library/WT/Controller/GedcomRecord.php +++ b/library/WT/Controller/GedcomRecord.php @@ -2,7 +2,7 @@ // Base controller for all GedcomRecord controllers // // webtrees: Web based Family History software -// Copyright (C) 2013 webtrees development team. +// Copyright (C) 2014 webtrees development team. // // 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 @@ -16,7 +16,7 @@ // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA if (!defined('WT_WEBTREES')) { header('HTTP/1.0 403 Forbidden'); diff --git a/library/WT/Controller/Hourglass.php b/library/WT/Controller/Hourglass.php index 4d0cf5f149..903f06abd4 100644 --- a/library/WT/Controller/Hourglass.php +++ b/library/WT/Controller/Hourglass.php @@ -2,7 +2,7 @@ // Controller for the hourglass chart // // webtrees: Web based Family History software -// Copyright (C) 2013 webtrees development team. +// Copyright (C) 2014 webtrees development team. // // Derived from PhpGedView // Copyright (C) 2002 to 2009 PGV Development Team. All rights reserved. @@ -19,7 +19,7 @@ // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA if (!defined('WT_WEBTREES')) { header('HTTP/1.0 403 Forbidden'); diff --git a/library/WT/Controller/Individual.php b/library/WT/Controller/Individual.php index b678a7d362..f47f332733 100644 --- a/library/WT/Controller/Individual.php +++ b/library/WT/Controller/Individual.php @@ -2,7 +2,7 @@ // Controller for the individual page // // webtrees: Web based Family History software -// Copyright (C) 2013 webtrees development team. +// Copyright (C) 2014 webtrees development team. // // Derived from PhpGedView // Copyright (C) 2002 to 2010 PGV Development Team. All rights reserved. @@ -19,7 +19,7 @@ // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA if (!defined('WT_WEBTREES')) { header('HTTP/1.0 403 Forbidden'); @@ -179,10 +179,11 @@ class WT_Controller_Individual extends WT_Controller_GedcomRecord { case 'SURN': // The SURN field is not necessarily the surname. // Where it is not a substring of the real surname, show it after the real surname. - if (strpos($primary_name['surname'], str_replace(',', ' ', $name))!==false) { - echo $primary_name['surname']; + $surname = WT_Filter::escapeHtml($primary_name['surname']); + if (strpos($primary_name['surname'], str_replace(',', ' ', $nmatch[$i][2]))!==false) { + echo $surname; } else { - echo WT_I18N::translate('%1$s (%2$s)', $primary_name['surname'], $name); + echo WT_I18N::translate('%1$s (%2$s)', $surname, $name); } break; default: diff --git a/library/WT/Controller/Lifespan.php b/library/WT/Controller/Lifespan.php index 53d3fc8da0..8716df4d07 100644 --- a/library/WT/Controller/Lifespan.php +++ b/library/WT/Controller/Lifespan.php @@ -2,7 +2,7 @@ // Controller for the timeline chart // // webtrees: Web based Family History software -// Copyright (C) 2013 webtrees development team. +// Copyright (C) 2014 webtrees development team. // // Derived from PhpGedView // Copyright (C) 2002 to 2010 PGV Development Team. All rights reserved. @@ -19,7 +19,7 @@ // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA if (!defined('WT_WEBTREES')) { header('HTTP/1.0 403 Forbidden'); diff --git a/library/WT/Controller/Media.php b/library/WT/Controller/Media.php index 0797692a9e..169bf749e0 100644 --- a/library/WT/Controller/Media.php +++ b/library/WT/Controller/Media.php @@ -2,7 +2,7 @@ // Controller for the media page // // webtrees: Web based Family History software -// Copyright (C) 2013 webtrees development team. +// Copyright (C) 2014 webtrees development team. // // Derived from PhpGedView // Copyright (C) 2002 to 2009 PGV Development Team. All rights reserved. @@ -19,7 +19,7 @@ // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA if (!defined('WT_WEBTREES')) { header('HTTP/1.0 403 Forbidden'); @@ -134,14 +134,16 @@ class WT_Controller_Media extends WT_Controller_GedcomRecord { } /** - * edit menu items used in album tab and media list + * edit menu items used in media list */ static function getMediaListMenu($mediaobject) { - $html='<div id="lightbox-menu"><ul class="makeMenu lb-menu">'; - $menu = new WT_Menu(WT_I18N::translate('Edit details'), '#', 'lb-image_edit'); + $html='<div class="lightbox-menu"><ul class="makeMenu lb-menu">'; + $menu = new WT_Menu(WT_I18N::translate('Edit details')); + $menu->addClass('', '', 'lb-image_edit'); $menu->addOnclick("return window.open('addmedia.php?action=editmedia&pid=".$mediaobject->getXref()."', '_blank', edit_window_specs);"); - $html.=$menu->getMenuAsList().'</ul><ul class="makeMenu lb-menu">'; - $menu = new WT_Menu(WT_I18N::translate('Set link'), '#', 'lb-image_link'); + $html.=$menu->getMenuAsList(); + $menu = new WT_Menu(WT_I18N::translate('Set link')); + $menu->addClass('', '', 'lb-image_link'); $menu->addOnclick("return ilinkitem('".$mediaobject->getXref()."','person')"); $submenu = new WT_Menu(WT_I18N::translate('To individual'), '#'); $submenu->addOnclick("return ilinkitem('".$mediaobject->getXref()."','person')"); @@ -152,8 +154,9 @@ class WT_Controller_Media extends WT_Controller_GedcomRecord { $submenu = new WT_Menu(WT_I18N::translate('To source'), '#'); $submenu->addOnclick("return ilinkitem('".$mediaobject->getXref()."','source')"); $menu->addSubMenu($submenu); - $html.=$menu->getMenuAsList().'</ul><ul class="makeMenu lb-menu">'; - $menu = new WT_Menu(WT_I18N::translate('View details'), $mediaobject->getHtmlUrl(), 'lb-image_view'); + $html.=$menu->getMenuAsList(); + $menu = new WT_Menu(WT_I18N::translate('View details'), $mediaobject->getHtmlUrl()); + $menu->addClass('', '', 'lb-image_view'); $html.=$menu->getMenuAsList(); $html.='</ul></div>'; return $html; diff --git a/library/WT/Controller/Note.php b/library/WT/Controller/Note.php index e6e2c4fcc8..37fca6fd6e 100644 --- a/library/WT/Controller/Note.php +++ b/library/WT/Controller/Note.php @@ -2,7 +2,7 @@ // Controller for the shared note page // // webtrees: Web based Family History software -// Copyright (C) 2013 webtrees development team. +// Copyright (C) 2014 webtrees development team. // // Derived from PhpGedView // Copyright (C) 2009 PGV Development Team. All rights reserved. @@ -19,7 +19,7 @@ // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA if (!defined('WT_WEBTREES')) { header('HTTP/1.0 403 Forbidden'); diff --git a/library/WT/Controller/Page.php b/library/WT/Controller/Page.php index ec28cd3dad..3c654b1605 100644 --- a/library/WT/Controller/Page.php +++ b/library/WT/Controller/Page.php @@ -2,7 +2,7 @@ // Controller for full-page, themed HTML responses // // webtrees: Web based Family History software -// Copyright (C) 2013 webtrees development team. +// Copyright (C) 2014 webtrees development team. // // 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 @@ -16,7 +16,7 @@ // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA if (!defined('WT_WEBTREES')) { header('HTTP/1.0 403 Forbidden'); @@ -137,7 +137,7 @@ class WT_Controller_Page extends WT_Controller_Base { $META_ROBOTS = $this->meta_robots; $META_DESCRIPTION = WT_GED_ID ? get_gedcom_setting(WT_GED_ID, 'META_DESCRIPTION') : ''; if (!$META_DESCRIPTION) { - $META_DESCRIPTION = WT_TREE_TITLE; + $META_DESCRIPTION = strip_tags(WT_TREE_TITLE); } $META_GENERATOR = WT_WEBTREES . ' ' . WT_VERSION . ' - ' . WT_WEBTREES_URL; $META_TITLE = WT_GED_ID ? get_gedcom_setting(WT_GED_ID, 'META_TITLE') : ''; diff --git a/library/WT/Controller/Pedigree.php b/library/WT/Controller/Pedigree.php index e6233fed0b..19c80232dc 100644 --- a/library/WT/Controller/Pedigree.php +++ b/library/WT/Controller/Pedigree.php @@ -2,7 +2,7 @@ // Controller for the pedigree chart // // webtrees: Web based Family History software -// Copyright (C) 2013 webtrees development team. +// Copyright (C) 2014 webtrees development team. // // Derived from PhpGedView // Copyright (C) 2002 to 2009 PGV Development Team. All rights reserved. @@ -19,7 +19,7 @@ // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA if (!defined('WT_WEBTREES')) { header('HTTP/1.0 403 Forbidden'); diff --git a/library/WT/Controller/Repository.php b/library/WT/Controller/Repository.php index 84357b5e7f..2ce5a45204 100644 --- a/library/WT/Controller/Repository.php +++ b/library/WT/Controller/Repository.php @@ -2,7 +2,7 @@ // Controller for the repository page // // webtrees: Web based Family History software -// Copyright (C) 2013 webtrees development team. +// Copyright (C) 2014 webtrees development team. // // Derived from PhpGedView // Copyright (C) 2002 to 2010 PGV Development Team. All rights reserved. @@ -19,7 +19,7 @@ // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA if (!defined('WT_WEBTREES')) { header('HTTP/1.0 403 Forbidden'); @@ -53,7 +53,13 @@ class WT_Controller_Repository extends WT_Controller_GedcomRecord { if (WT_USER_CAN_EDIT) { $fact = $this->record->getFirstFact('NAME'); $submenu = new WT_Menu(WT_I18N::translate('Edit repository'), '#', 'menu-repo-edit'); - $submenu->addOnclick('return edit_record(\'' . $this->record->getXref() . '\', \'' . $fact->getFactId() . '\');'); + if ($fact) { + // Edit existing name + $submenu->addOnclick('return edit_record(\'' . $this->record->getXref() . '\', \'' . $fact->getFactId() . '\');'); + } else { + // Add new name + $submenu->addOnclick('return add_fact(\'' . $this->record->getXref() . '\', \'NAME\');'); + } $menu->addSubmenu($submenu); } diff --git a/library/WT/Controller/Search.php b/library/WT/Controller/Search.php index 44456b0699..ebab5ffa55 100644 --- a/library/WT/Controller/Search.php +++ b/library/WT/Controller/Search.php @@ -2,7 +2,7 @@ // Controller for the search page // // webtrees: Web based Family History software -// Copyright (C) 2013 webtrees development team. +// Copyright (C) 2014 webtrees development team. // // Derived from PhpGedView // Copyright (C) 2002 to 2009 PGV Development Team. All rights reserved. @@ -19,7 +19,7 @@ // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA if (!defined('WT_WEBTREES')) { header('HTTP/1.0 403 Forbidden'); diff --git a/library/WT/Controller/Simple.php b/library/WT/Controller/Simple.php index 1afc367d52..896494896c 100644 --- a/library/WT/Controller/Simple.php +++ b/library/WT/Controller/Simple.php @@ -2,7 +2,7 @@ // Controller for all popup pages // // webtrees: Web based Family History software -// Copyright (C) 2013 webtrees development team. +// Copyright (C) 2014 webtrees development team. // // 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 @@ -16,7 +16,7 @@ // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA if (!defined('WT_WEBTREES')) { header('HTTP/1.0 403 Forbidden'); diff --git a/library/WT/Controller/Source.php b/library/WT/Controller/Source.php index e4a73c3dc3..2fca4cf32d 100644 --- a/library/WT/Controller/Source.php +++ b/library/WT/Controller/Source.php @@ -2,7 +2,7 @@ // Controller for the source page // // webtrees: Web based Family History software -// Copyright (C) 2013 webtrees development team. +// Copyright (C) 2014 webtrees development team. // // Derived from PhpGedView // Copyright (C) 2002 to 2010 PGV Development Team. All rights reserved. @@ -19,7 +19,7 @@ // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA if (!defined('WT_WEBTREES')) { header('HTTP/1.0 403 Forbidden'); @@ -53,7 +53,13 @@ class WT_Controller_Source extends WT_Controller_GedcomRecord { if (WT_USER_CAN_EDIT) { $fact = $this->record->getFirstFact('TITL'); $submenu = new WT_Menu(WT_I18N::translate('Edit source'), '#', 'menu-sour-edit'); - $submenu->addOnclick('return edit_record(\''.$this->record->getXref().'\', \'' . $fact->getFactId() . '\');'); + if ($fact) { + // Edit existing name + $submenu->addOnclick('return edit_record(\''.$this->record->getXref().'\', \'' . $fact->getFactId() . '\');'); + } else { + // Add new name + $submenu->addOnclick('return add_fact(\''.$this->record->getXref().'\', \'TITL\');'); + } $menu->addSubmenu($submenu); } diff --git a/library/WT/Controller/Timeline.php b/library/WT/Controller/Timeline.php index 70c29da68e..1d08d2701e 100644 --- a/library/WT/Controller/Timeline.php +++ b/library/WT/Controller/Timeline.php @@ -2,7 +2,7 @@ // Controller for the timeline chart // // webtrees: Web based Family History software -// Copyright (C) 2013 webtrees development team. +// Copyright (C) 2014 webtrees development team. // // Derived from PhpGedView // Copyright (C) 2002 to 2009 PGV Development Team. All rights reserved. @@ -19,7 +19,7 @@ // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA if (!defined('WT_WEBTREES')) { header('HTTP/1.0 403 Forbidden'); diff --git a/library/WT/DB.php b/library/WT/DB.php index bd30bdd4f7..5d273a7147 100644 --- a/library/WT/DB.php +++ b/library/WT/DB.php @@ -4,7 +4,7 @@ // PDOStatement classes to provide database access with logging, etc. // // webtrees: Web based Family History software -// Copyright (C) 2013 webtrees development team. +// Copyright (C) 2014 webtrees development team. // // Derived from PhpGedView // Copyright (c) 2009-2010 Greg Roach @@ -21,7 +21,7 @@ // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA if (!defined('WT_WEBTREES')) { header('HTTP/1.0 403 Forbidden'); diff --git a/library/WT/DBStatement.php b/library/WT/DBStatement.php index e50a477527..a3bc0f6b18 100644 --- a/library/WT/DBStatement.php +++ b/library/WT/DBStatement.php @@ -3,7 +3,7 @@ // PDOStatement classes to provide database access with logging, etc. // // webtrees: Web based Family History software -// Copyright (C) 2013 webtrees development team. +// Copyright (C) 2014 webtrees development team. // // 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 @@ -17,7 +17,7 @@ // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA if (!defined('WT_WEBTREES')) { header('HTTP/1.0 403 Forbidden'); diff --git a/library/WT/Date.php b/library/WT/Date.php index 121c2f1a36..ed28a4d58d 100644 --- a/library/WT/Date.php +++ b/library/WT/Date.php @@ -15,7 +15,7 @@ // are all for internal use only. // // webtrees: Web based Family History software -// Copyright (C) 2013 webtrees development team. +// Copyright (C) 2014 Greg Roach // // 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 @@ -29,7 +29,7 @@ // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA if (!defined('WT_WEBTREES')) { header('HTTP/1.0 403 Forbidden'); diff --git a/library/WT/Date/Calendar.php b/library/WT/Date/Calendar.php index d988d4c5b2..43e3819d91 100644 --- a/library/WT/Date/Calendar.php +++ b/library/WT/Date/Calendar.php @@ -12,7 +12,7 @@ // midday. // // webtrees: Web based Family History software -// Copyright (C) 2013 webtrees development team. +// Copyright (C) 2014 Greg Roach // // 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 @@ -26,7 +26,7 @@ // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA if (!defined('WT_WEBTREES')) { header('HTTP/1.0 403 Forbidden'); diff --git a/library/WT/Date/French.php b/library/WT/Date/French.php index 52e2ee7caf..58de618ca6 100644 --- a/library/WT/Date/French.php +++ b/library/WT/Date/French.php @@ -8,7 +8,7 @@ // midday. // // webtrees: Web based Family History software -// Copyright (C) 2013 webtrees development team. +// Copyright (C) 2014 Greg Roach // // 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 @@ -22,7 +22,7 @@ // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA if (!defined('WT_WEBTREES')) { header('HTTP/1.0 403 Forbidden'); diff --git a/library/WT/Date/Gregorian.php b/library/WT/Date/Gregorian.php index 10aea14713..702f16e49d 100644 --- a/library/WT/Date/Gregorian.php +++ b/library/WT/Date/Gregorian.php @@ -8,7 +8,7 @@ // midday. // // webtrees: Web based Family History software -// Copyright (C) 2013 webtrees development team. +// Copyright (C) 2014 Greg Roach // // 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 @@ -22,7 +22,7 @@ // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA if (!defined('WT_WEBTREES')) { header('HTTP/1.0 403 Forbidden'); diff --git a/library/WT/Date/Hijri.php b/library/WT/Date/Hijri.php index 8de71444d6..057f9e0b88 100644 --- a/library/WT/Date/Hijri.php +++ b/library/WT/Date/Hijri.php @@ -9,7 +9,7 @@ // midday. // // webtrees: Web based Family History software -// Copyright (C) 2013 webtrees development team. +// Copyright (C) 2014 Greg Roach // // 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 @@ -23,7 +23,7 @@ // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA if (!defined('WT_WEBTREES')) { header('HTTP/1.0 403 Forbidden'); diff --git a/library/WT/Date/Jalali.php b/library/WT/Date/Jalali.php index 7faaf02459..ece91ba74e 100644 --- a/library/WT/Date/Jalali.php +++ b/library/WT/Date/Jalali.php @@ -8,7 +8,7 @@ // midday. // // webtrees: Web based Family History software -// Copyright (C) 2013 webtrees development team. +// Copyright (C) 2014 Greg Roach // // 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 @@ -22,7 +22,7 @@ // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA if (!defined('WT_WEBTREES')) { header('HTTP/1.0 403 Forbidden'); diff --git a/library/WT/Date/Jewish.php b/library/WT/Date/Jewish.php index 1be5e7be0b..39ea46bea6 100644 --- a/library/WT/Date/Jewish.php +++ b/library/WT/Date/Jewish.php @@ -8,7 +8,7 @@ // midday. // // webtrees: Web based Family History software -// Copyright (C) 2013 webtrees development team. +// Copyright (C) 2014 Greg Roach // // 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 @@ -22,7 +22,7 @@ // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA if (!defined('WT_WEBTREES')) { header('HTTP/1.0 403 Forbidden'); diff --git a/library/WT/Date/Julian.php b/library/WT/Date/Julian.php index b4f95fd5a4..2f1980b902 100644 --- a/library/WT/Date/Julian.php +++ b/library/WT/Date/Julian.php @@ -9,7 +9,7 @@ // midday. // // webtrees: Web based Family History software -// Copyright (C) 2013 webtrees development team. +// Copyright (C) 2014 Greg Roach // // 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 @@ -23,7 +23,7 @@ // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA if (!defined('WT_WEBTREES')) { header('HTTP/1.0 403 Forbidden'); diff --git a/library/WT/Date/Roman.php b/library/WT/Date/Roman.php index 8df74dbf15..4c74ee09f8 100644 --- a/library/WT/Date/Roman.php +++ b/library/WT/Date/Roman.php @@ -11,7 +11,7 @@ // midday. // // webtrees: Web based Family History software -// Copyright (C) 2013 webtrees development team. +// Copyright (C) 2014 Greg Roach // // 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 @@ -25,7 +25,7 @@ // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA if (!defined('WT_WEBTREES')) { header('HTTP/1.0 403 Forbidden'); diff --git a/library/WT/Debug.php b/library/WT/Debug.php index 46e587f017..d80c29d85b 100644 --- a/library/WT/Debug.php +++ b/library/WT/Debug.php @@ -1,7 +1,7 @@ <?php // Debug functions. // -// Copyright (C) 2013 webtrees development team +// Copyright (C) 2014 Greg Roach // // 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 @@ -15,7 +15,7 @@ // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA if (!defined('WT_WEBTREES')) { header('HTTP/1.0 403 Forbidden'); diff --git a/library/WT/Fact.php b/library/WT/Fact.php index c73f7f6307..f1e23256e8 100644 --- a/library/WT/Fact.php +++ b/library/WT/Fact.php @@ -2,7 +2,7 @@ // Class that defines an event details object // // webtrees: Web based Family History software -// Copyright (C) 2013 webtrees development team. +// Copyright (C) 2014 webtrees development team. // // Derived from PhpGedView // Copyright (C) 2008 PGV Development Team. All rights reserved. @@ -19,7 +19,7 @@ // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA if (!defined('WT_WEBTREES')) { header('HTTP/1.0 403 Forbidden'); @@ -333,7 +333,6 @@ class WT_Fact { if (empty($factsort)) $factsort=array_flip(array( - 'OBJE', 'NOTE', 'SOUR', // On the individual tabs, show 1 OBJE before 1 XXXX/2 OBJE 'BIRT', '_HNM', 'ALIA', '_AKA', '_AKAN', @@ -386,7 +385,9 @@ class WT_Fact { 'TEMP', 'SLGC', 'BAPL', 'CONL', 'ENDL', 'SLGS', 'ADDR', 'PHON', 'EMAIL', '_EMAIL', 'EMAL', 'FAX', 'WWW', 'URL', '_URL', + 'FILE', // For media objects 'AFN', 'REFN', '_PRMN', 'REF', 'RIN', '_UID', + 'OBJE', 'NOTE', 'SOUR', 'CHAN', '_TODO', )); diff --git a/library/WT/Family.php b/library/WT/Family.php index 31d06db044..f92b4080e5 100644 --- a/library/WT/Family.php +++ b/library/WT/Family.php @@ -2,7 +2,7 @@ // Class file for a Family // // webtrees: Web based Family History software -// Copyright (C) 2013 webtrees development team. +// Copyright (C) 2014 webtrees development team. // // Derived from PhpGedView // Copyright (C) 2002 to 2009 PGV Development Team. All rights reserved. @@ -19,7 +19,7 @@ // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA if (!defined('WT_WEBTREES')) { header('HTTP/1.0 403 Forbidden'); @@ -139,19 +139,15 @@ class WT_Family extends WT_GedcomRecord { return $spouses; } - /** - * get the children - * @return array array of children Persons - */ + // Get a list of this family’s children function getChildren($access_level=WT_USER_ACCESS_LEVEL) { global $SHOW_PRIVATE_RELATIONSHIPS; - $children=array(); - preg_match_all('/\n1 CHIL @('.WT_REGEX_XREF.')@/', $this->gedcom, $match); - foreach ($match[1] as $pid) { - $child=WT_Individual::getInstance($pid); + $children = array(); + foreach ($this->getFacts('CHIL', false, $access_level, $SHOW_PRIVATE_RELATIONSHIPS) as $fact) { + $child = $fact->getTarget(); if ($child && ($SHOW_PRIVATE_RELATIONSHIPS || $child->canShowName($access_level))) { - $children[]=$child; + $children[] = $child; } } return $children; diff --git a/library/WT/File.php b/library/WT/File.php index a0af30c373..d86862ef3c 100644 --- a/library/WT/File.php +++ b/library/WT/File.php @@ -2,7 +2,7 @@ // File manipulation utilities // // webtrees: Web based Family History software -// Copyright (c) 2013 webtrees development team +// Copyright (c) 2014 webtrees development team // // 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 @@ -16,7 +16,7 @@ // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA if (!defined('WT_WEBTREES')) { header('HTTP/1.0 403 Forbidden'); diff --git a/library/WT/Filter.php b/library/WT/Filter.php index 5fd5d138d5..ef854165e1 100644 --- a/library/WT/Filter.php +++ b/library/WT/Filter.php @@ -2,7 +2,7 @@ // Filter/escape/validate input and output // // webtrees: Web based Family History software -// Copyright (c) 2013 webtrees development team +// Copyright (c) 2014 webtrees development team // // 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 @@ -16,12 +16,9 @@ // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA -if (!defined('WT_WEBTREES')) { - header('HTTP/1.0 403 Forbidden'); - exit; -} +use Michelf\MarkdownExtra; class WT_Filter { // REGEX to match a URL @@ -76,13 +73,26 @@ class WT_Filter { } ////////////////////////////////////////////////////////////////////////////// - // Escape a string for use in HTML, and additionally: - // Convert URLs to links, inserting soft-hyphens at word boundaries so that - // the browser can word-wrap. + // Format block-level text such as notes or transcripts, etc. + ////////////////////////////////////////////////////////////////////////////// + public static function formatText($text, WT_Tree $WT_TREE) { + switch ($WT_TREE->preference('FORMAT_TEXT')) { + case 'markdown': + return '<div class="markdown" dir="auto">' . WT_Filter::markdown($text) . '</div>'; + break; + case '': + default: + return '<div style="white-space: pre-wrap;" dir="auto">' . WT_Filter::expandUrls($text) . '</div>'; + break; + } + } + + ////////////////////////////////////////////////////////////////////////////// + // Escape a string for use in HTML, and additionally convert URLs to links. ////////////////////////////////////////////////////////////////////////////// public static function expandUrls($text) { return preg_replace_callback( - '/' . addcslashes('(?!>)' . self::URL_REGEX . '(?!</a>)', '/') . '/i', + '/' . addcslashes('(?!>)' . WT_Filter::URL_REGEX . '(?!</a>)', '/') . '/i', function ($m) { return '<a href="' . $m[0] . '" target="_blank">' . $m[0] . '</a>'; }, @@ -91,6 +101,33 @@ class WT_Filter { } ////////////////////////////////////////////////////////////////////////////// + // Format a block of text, using "Markdown". + ////////////////////////////////////////////////////////////////////////////// + public static function markdown($text) { + $parser = new MarkdownExtra; + $parser->empty_element_suffix = '>'; + $parser->no_markup = true; + $text = $parser->transform($text); + + // HTMLPurifier needs its own autoloader + require_once WT_ROOT . 'library/htmlpurifier-4.6.0/library/HTMLPurifier.auto.php'; + + // HTMLPurifier needs somewhere to write temporary files + $HTML_PURIFIER_CACHE_DIR = WT_DATA_DIR . 'html_purifier_cache'; + + if (!is_dir($HTML_PURIFIER_CACHE_DIR)) { + mkdir($HTML_PURIFIER_CACHE_DIR); + } + + $config = HTMLPurifier_Config::createDefault(); + $config->set('Cache.SerializerPath', $HTML_PURIFIER_CACHE_DIR); + $purifier = new HTMLPurifier($config); + $text = $purifier->purify($text); + + return $text; + } + + ////////////////////////////////////////////////////////////////////////////// // Validate INPUT requests ////////////////////////////////////////////////////////////////////////////// private static function _input($source, $variable, $regexp=null, $default=null) { diff --git a/library/WT/FlashMessages.php b/library/WT/FlashMessages.php index bd836dea43..d90864751e 100644 --- a/library/WT/FlashMessages.php +++ b/library/WT/FlashMessages.php @@ -3,7 +3,7 @@ // display them in another. // // webtrees: Web based Family History software -// Copyright (C) 2013 webtrees development team. +// Copyright (C) 2014 Greg Roach // // 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 @@ -17,7 +17,7 @@ // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA if (!defined('WT_WEBTREES')) { header('HTTP/1.0 403 Forbidden'); diff --git a/library/WT/Gedcom/Code/Adop.php b/library/WT/Gedcom/Code/Adop.php index 904bc3c912..03a669b1a1 100644 --- a/library/WT/Gedcom/Code/Adop.php +++ b/library/WT/Gedcom/Code/Adop.php @@ -2,7 +2,7 @@ // Functions and logic for GEDCOM "PEDI" codes // // webtrees: Web based Family History software -// Copyright (C) 2013 webtrees development team. +// Copyright (C) 2014 Greg Roach // // 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 @@ -16,7 +16,7 @@ // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA if (!defined('WT_WEBTREES')) { header('HTTP/1.0 403 Forbidden'); diff --git a/library/WT/Gedcom/Code/Name.php b/library/WT/Gedcom/Code/Name.php index cd3e5854ba..6eef73752c 100644 --- a/library/WT/Gedcom/Code/Name.php +++ b/library/WT/Gedcom/Code/Name.php @@ -2,7 +2,7 @@ // Functions and logic for GEDCOM "NAME" codes // // webtrees: Web based Family History software -// Copyright (C) 2013 webtrees development team. +// Copyright (C) 2014 Greg Roach // // 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 @@ -16,7 +16,7 @@ // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA if (!defined('WT_WEBTREES')) { header('HTTP/1.0 403 Forbidden'); diff --git a/library/WT/Gedcom/Code/Pedi.php b/library/WT/Gedcom/Code/Pedi.php index d9b316536b..3a5f29295c 100644 --- a/library/WT/Gedcom/Code/Pedi.php +++ b/library/WT/Gedcom/Code/Pedi.php @@ -2,7 +2,7 @@ // Functions and logic for GEDCOM "PEDI" codes // // webtrees: Web based Family History software -// Copyright (C) 2013 webtrees development team. +// Copyright (C) 2014 Greg Roach // // 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 @@ -16,7 +16,7 @@ // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA if (!defined('WT_WEBTREES')) { header('HTTP/1.0 403 Forbidden'); diff --git a/library/WT/Gedcom/Code/Quay.php b/library/WT/Gedcom/Code/Quay.php index f05c5291f8..be993175b0 100644 --- a/library/WT/Gedcom/Code/Quay.php +++ b/library/WT/Gedcom/Code/Quay.php @@ -1,8 +1,8 @@ <?php -// Functions and logic for GEDCOM "UAY" codes +// Functions and logic for GEDCOM "QUAY" codes // // webtrees: Web based Family History software -// Copyright (C) 2013 webtrees development team. +// Copyright (C) 2014 Greg Roach // // 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 @@ -16,7 +16,7 @@ // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA if (!defined('WT_WEBTREES')) { header('HTTP/1.0 403 Forbidden'); diff --git a/library/WT/Gedcom/Code/Rela.php b/library/WT/Gedcom/Code/Rela.php index f0dc612f65..20a37c9a1b 100644 --- a/library/WT/Gedcom/Code/Rela.php +++ b/library/WT/Gedcom/Code/Rela.php @@ -2,7 +2,7 @@ // Functions and logic for GEDCOM "RELA" codes // // webtrees: Web based Family History software -// Copyright (C) 2013 webtrees development team. +// Copyright (C) 2014 Greg Roach // // 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 @@ -16,7 +16,7 @@ // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA if (!defined('WT_WEBTREES')) { header('HTTP/1.0 403 Forbidden'); diff --git a/library/WT/Gedcom/Code/Stat.php b/library/WT/Gedcom/Code/Stat.php index 94f6aed147..790853d378 100644 --- a/library/WT/Gedcom/Code/Stat.php +++ b/library/WT/Gedcom/Code/Stat.php @@ -2,7 +2,7 @@ // Functions and logic for GEDCOM "STAT" codes // // webtrees: Web based Family History software -// Copyright (C) 2013 webtrees development team. +// Copyright (C) 2014 Greg Roach // // 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 @@ -16,7 +16,7 @@ // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA if (!defined('WT_WEBTREES')) { header('HTTP/1.0 403 Forbidden'); diff --git a/library/WT/Gedcom/Code/Temp.php b/library/WT/Gedcom/Code/Temp.php index 8374fc452a..f79bf01130 100644 --- a/library/WT/Gedcom/Code/Temp.php +++ b/library/WT/Gedcom/Code/Temp.php @@ -2,7 +2,7 @@ // Functions and logic for GEDCOM "TEMP" codes // // webtrees: Web based Family History software -// Copyright (C) 2013 webtrees development team. +// Copyright (C) 2014 Greg Roach // // 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 @@ -16,7 +16,7 @@ // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA if (!defined('WT_WEBTREES')) { header('HTTP/1.0 403 Forbidden'); diff --git a/library/WT/Gedcom/Tag.php b/library/WT/Gedcom/Tag.php index e9c6eca97b..8b813ede65 100644 --- a/library/WT/Gedcom/Tag.php +++ b/library/WT/Gedcom/Tag.php @@ -2,7 +2,7 @@ // Static GEDCOM data for Tags // // webtrees: Web based Family History software -// Copyright (C) 2013 webtrees development team. +// Copyright (C) 2014 Greg Roach // // 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 @@ -16,7 +16,7 @@ // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA if (!defined('WT_WEBTREES')) { header('HTTP/1.0 403 Forbidden'); diff --git a/library/WT/GedcomRecord.php b/library/WT/GedcomRecord.php index 06000a7f6f..24240873a1 100755 --- a/library/WT/GedcomRecord.php +++ b/library/WT/GedcomRecord.php @@ -2,7 +2,7 @@ // Base class for all gedcom records // // webtrees: Web based Family History software -// Copyright (C) 2013 webtrees development team. +// Copyright (C) 2014 webtrees development team. // // Derived from PhpGedView // Copyright (C) 2002 to 2009 PGV Development Team. All rights reserved. @@ -19,7 +19,7 @@ // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA if (!defined('WT_WEBTREES')) { header('HTTP/1.0 403 Forbidden'); @@ -423,41 +423,49 @@ class WT_GedcomRecord { // ['type'] = the gedcom fact, e.g. NAME, TITL, FONE, _HEB, etc. // ['full'] = the name as specified in the record, e.g. 'Vincent van Gogh' or 'John Unknown' // ['sort'] = a sortable version of the name (not for display), e.g. 'Gogh, Vincent' or '@N.N., John' - protected function _getAllNames($fact='!', $level=1) { - global $WORD_WRAPPED_NOTES; - - if (is_null($this->_getAllNames)) { - $this->_getAllNames=array(); - if ($this->canShowName()) { - $sublevel=$level+1; - $subsublevel=$sublevel+1; - if (preg_match_all("/^{$level} ({$fact}) (.+)((\n[{$sublevel}-9].+)*)/m", $this->getGedcom(), $matches, PREG_SET_ORDER)) { - foreach ($matches as $match) { - // Treat 1 NAME / 2 TYPE married the same as _MARNM - if ($match[1]=='NAME' && strpos($match[3], "\n2 TYPE married")!==false) { - $this->_addName('_MARNM', $match[2] ? $match[2] : $this->getFallBackName(), $match[0]); - } else { - $this->_addName($match[1], $match[2] ? $match[2] : $this->getFallBackName(), $match[0]); - } - if ($match[3] && preg_match_all("/^{$sublevel} (ROMN|FONE|_\w+) (.+)((\n[{$subsublevel}-9].+)*)/m", $match[3], $submatches, PREG_SET_ORDER)) { - foreach ($submatches as $submatch) { - $this->_addName($submatch[1], $submatch[2] ? $submatch[2] : $this->getFallBackName(), $submatch[0]); - } + protected function _extractNames($level, $fact_type, $facts) { + $sublevel = $level + 1; + $subsublevel = $sublevel + 1; + foreach ($facts as $fact) { + if (preg_match_all("/^{$level} ({$fact_type}) (.+)((\n[{$sublevel}-9].+)*)/m", $fact->getGedcom(), $matches, PREG_SET_ORDER)) { + foreach ($matches as $match) { + // Treat 1 NAME / 2 TYPE married the same as _MARNM + if ($match[1]=='NAME' && strpos($match[3], "\n2 TYPE married")!==false) { + $this->_addName('_MARNM', $match[2], $fact->getGedcom()); + } else { + $this->_addName($match[1], $match[2], $fact->getGedcom()); + } + if ($match[3] && preg_match_all("/^{$sublevel} (ROMN|FONE|_\w+) (.+)((\n[{$subsublevel}-9].+)*)/m", $match[3], $submatches, PREG_SET_ORDER)) { + foreach ($submatches as $submatch) { + $this->_addName($submatch[1], $submatch[2], $match[3]); } } - } else { - $this->_addName(static::RECORD_TYPE, $this->getFallBackName(), null); } - } else { - $this->_addName(static::RECORD_TYPE, WT_I18N::translate('Private'), null); } } - return $this->_getAllNames; + } + + // Default for "other" object types + public function extractNames() { + $this->_addName(static::RECORD_TYPE, $this->getFallBackName(), null); } // Derived classes should redefine this function, otherwise the object will have no name public function getAllNames() { - return $this->_getAllNames('!', 1); + if ($this->_getAllNames === null) { + $this->_getAllNames = array(); + if ($this->canShowName()) { + // Ask the record to extract its names + $this->extractNames(); + // No name found? Use a fallback. + if (!$this->_getAllNames) { + $this->_addName(static::RECORD_TYPE, $this->getFallBackName(), null); + } + } else { + $this->_addName(static::RECORD_TYPE, WT_I18N::translate('Private'), null); + } + } + return $this->_getAllNames; } // If this object has no name, what do we call it? @@ -785,9 +793,11 @@ class WT_GedcomRecord { } // The facts and events for this record - public function getFacts($filter=null, $sort=false, $access_level=WT_USER_ACCESS_LEVEL) { + // $override allows us to implement $SHOW_PRIVATE_RELATIONSHIPS and $SHOW_LIVING_NAMES, by giving + // access to otherwise private records. + public function getFacts($filter=null, $sort=false, $access_level=WT_USER_ACCESS_LEVEL, $override=false) { $facts=array(); - if ($this->canShow($access_level)) { + if ($this->canShow($access_level) || $override) { foreach ($this->facts as $fact) { if (($filter==null || preg_match('/^' . $filter . '$/', $fact->getTag())) && $fact->canShow($access_level)) { $facts[] = $fact; diff --git a/library/WT/I18N.php b/library/WT/I18N.php index aeb7a24b35..050dda342d 100644 --- a/library/WT/I18N.php +++ b/library/WT/I18N.php @@ -9,7 +9,7 @@ // We wrap the Zend_Translate gettext library, to allow us to add extra // functionality, such as mixed RTL and LTR text. // -// Copyright (C) 2013 Greg Roach +// Copyright (C) 2014 Greg Roach // // 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 @@ -23,7 +23,7 @@ // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA if (!defined('WT_WEBTREES')) { header('HTTP/1.0 403 Forbidden'); @@ -133,22 +133,22 @@ class WT_I18N { self::$translation_adapter = new Zend_Translate('gettext', WT_ROOT.'language/'.$locale.'.mo', $locale); // Deprecated - some custom modules use this to add translations - Zend_Registry::set('Zend_Translate', self::$translation_adapter); + Zend_Registry::set('Zend_Translate', WT_I18N::$translation_adapter); // Load any local user translations if (is_dir(WT_DATA_DIR.'language')) { if (file_exists(WT_DATA_DIR.'language/'.$locale.'.mo')) { - self::$translation_adapter->addTranslation( + WT_I18N::addTranslation( new Zend_Translate('gettext', WT_DATA_DIR.'language/'.$locale.'.mo', $locale) ); } if (file_exists(WT_DATA_DIR.'language/'.$locale.'.php')) { - self::$translation_adapter->addTranslation( + WT_I18N::addTranslation( new Zend_Translate('array', WT_DATA_DIR.'language/'.$locale.'.php', $locale) ); } if (file_exists(WT_DATA_DIR.'language/'.$locale.'.csv')) { - self::$translation_adapter->addTranslation( + WT_I18N::addTranslation( new Zend_Translate('csv', WT_DATA_DIR.'language/'.$locale.'.csv', $locale) ); } @@ -187,6 +187,11 @@ class WT_I18N { return $locale; } + // Add a translation file + public static function addTranslation(Zend_Translate $translation) { + WT_I18N::$translation_adapter->addTranslation($translation); + } + // Check which languages are installed public static function installed_languages() { $mo_files=glob(WT_ROOT.'language'.DIRECTORY_SEPARATOR.'*.mo'); diff --git a/library/WT/Individual.php b/library/WT/Individual.php index 626e6a1aac..8887f4022f 100644 --- a/library/WT/Individual.php +++ b/library/WT/Individual.php @@ -2,7 +2,7 @@ // Class file for an individual // // webtrees: Web based Family History software -// Copyright (C) 2013 webtrees development team. +// Copyright (C) 2014 webtrees development team. // // Derived from PhpGedView // Copyright (C) 2002 to 2009 PGV Development Team. All rights reserved. @@ -19,7 +19,7 @@ // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA if (!defined('WT_WEBTREES')) { header('HTTP/1.0 403 Forbidden'); @@ -596,7 +596,7 @@ class WT_Individual extends WT_GedcomRecord { global $SHOW_PRIVATE_RELATIONSHIPS; $families = array(); - foreach ($this->getFacts('FAMS', false, $access_level) as $fact) { + foreach ($this->getFacts('FAMS', false, $access_level, $SHOW_PRIVATE_RELATIONSHIPS) as $fact) { $family = $fact->getTarget(); if ($family && ($SHOW_PRIVATE_RELATIONSHIPS || $family->canShow($access_level))) { $families[] = $family; @@ -638,7 +638,7 @@ class WT_Individual extends WT_GedcomRecord { global $SHOW_PRIVATE_RELATIONSHIPS; $families = array(); - foreach ($this->getFacts('FAMC', false, $access_level) as $fact) { + foreach ($this->getFacts('FAMC', false, $access_level, $SHOW_PRIVATE_RELATIONSHIPS) as $fact) { $family = $fact->getTarget(); if ($family && ($SHOW_PRIVATE_RELATIONSHIPS || $family->canShow($access_level))) { $families[] = $family; @@ -1016,10 +1016,11 @@ class WT_Individual extends WT_GedcomRecord { } // Get an array of structures containing all the names in the record - public function getAllNames() { - return $this->_getAllNames('NAME', 1); + public function extractNames() { + $this->_extractNames(1, 'NAME', $this->getFacts('NAME', false, WT_USER_ACCESS_LEVEL, $this->canShowName())); } + // Extra info to display when displaying this record in a list of // selection items or favorites. function format_list_details() { diff --git a/library/WT/Mail.php b/library/WT/Mail.php index 5506dd36f6..2737121dbd 100644 --- a/library/WT/Mail.php +++ b/library/WT/Mail.php @@ -2,7 +2,7 @@ // Send mail messages // // webtrees: Web based Family History software -// Copyright (c) 2013 webtrees development team +// Copyright (c) 2014 webtrees development team // // 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 @@ -16,7 +16,7 @@ // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA if (!defined('WT_WEBTREES')) { header('HTTP/1.0 403 Forbidden'); diff --git a/library/WT/Media.php b/library/WT/Media.php index b008b4f082..891d2348c2 100644 --- a/library/WT/Media.php +++ b/library/WT/Media.php @@ -2,7 +2,7 @@ // Class that defines a media object // // webtrees: Web based Family History software -// Copyright (C) 2013 webtrees development team. +// Copyright (C) 2014 webtrees development team. // // Derived from PhpGedView // Copyright (C) 2002 to 2009 PGV Development Team. All rights reserved. @@ -19,7 +19,7 @@ // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA if (!defined('WT_WEBTREES')) { header('HTTP/1.0 403 Forbidden'); @@ -434,14 +434,11 @@ class WT_Media extends WT_GedcomRecord { } // Get an array of structures containing all the names in the record - public function getAllNames() { - if (strpos($this->getGedcom(), "\n1 TITL ")) { - // Earlier gedcom versions had level 1 titles - return parent::_getAllNames('TITL', 1); - } else { - // Later gedcom versions had level 2 titles - return parent::_getAllNames('TITL', 2); - } + public function extractNames() { + // Earlier gedcom versions had level 1 titles + // Later gedcom versions had level 2 titles + $this->_extractNames(2, 'TITL', $this->getFacts('FILE')); + $this->_extractNames(1, 'TITL', $this->getFacts('TITL')); } // Extra info to display when displaying this record in a list of diff --git a/library/WT/Menu.php b/library/WT/Menu.php index a1d4bc473e..4eb68e7a40 100644 --- a/library/WT/Menu.php +++ b/library/WT/Menu.php @@ -2,7 +2,7 @@ // System for generating menus. // // webtrees: Web based Family History software -// Copyright (C) 2013 webtrees development team. +// Copyright (C) 2014 webtrees development team. // // Derived from PhpGedView // Copyright (C) 2002 to 2009 PGV Development Team. All rights reserved. @@ -19,7 +19,7 @@ // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA if (!defined('WT_WEBTREES')) { header('HTTP/1.0 403 Forbidden'); diff --git a/library/WT/MenuBar.php b/library/WT/MenuBar.php index a976bef347..d1fd96c5c5 100644 --- a/library/WT/MenuBar.php +++ b/library/WT/MenuBar.php @@ -2,13 +2,11 @@ // System for generating menus. // // webtrees: Web based Family History software -// Copyright (C) 2013 webtrees development team. +// Copyright (C) 2014 webtrees development team. // // Derived from PhpGedView // Copyright (C) 2002 to 2010 PGV Development Team. All rights reserved. // -// Modifications Copyright (c) 2010 Greg Roach -// // 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 // the Free Software Foundation; either version 2 of the License, or @@ -21,7 +19,7 @@ // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA if (!defined('WT_WEBTREES')) { header('HTTP/1.0 403 Forbidden'); diff --git a/library/WT/Module.php b/library/WT/Module.php index bd117b5193..0f433dc388 100644 --- a/library/WT/Module.php +++ b/library/WT/Module.php @@ -2,7 +2,7 @@ // Classes and libraries for module system // // webtrees: Web based Family History software -// Copyright (C) 2013 webtrees development team. +// Copyright (C) 2014 webtrees development team. // // 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 @@ -16,7 +16,7 @@ // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA abstract class WT_Module { private $_title = null; diff --git a/library/WT/Module/Block.php b/library/WT/Module/Block.php index d79c068056..3fac4917ab 100644 --- a/library/WT/Module/Block.php +++ b/library/WT/Module/Block.php @@ -2,7 +2,7 @@ // Classes and libraries for module system // // webtrees: Web based Family History software -// Copyright (C) 2013 webtrees development team. +// Copyright (C) 2014 webtrees development team. // // 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 @@ -16,7 +16,7 @@ // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA interface WT_Module_Block { public function getBlock($block_id); diff --git a/library/WT/Module/Chart.php b/library/WT/Module/Chart.php index dc16ceede5..c0d76c201d 100644 --- a/library/WT/Module/Chart.php +++ b/library/WT/Module/Chart.php @@ -2,7 +2,7 @@ // Classes and libraries for module system // // webtrees: Web based Family History software -// Copyright (C) 2013 webtrees development team. +// Copyright (C) 2014 webtrees development team. // // 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 @@ -16,7 +16,7 @@ // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA interface WT_Module_Chart { public function getChart(); diff --git a/library/WT/Module/Config.php b/library/WT/Module/Config.php index a45caecdc9..1eb2451ee4 100644 --- a/library/WT/Module/Config.php +++ b/library/WT/Module/Config.php @@ -2,7 +2,7 @@ // Classes and libraries for module system // // webtrees: Web based Family History software -// Copyright (C) 2013 webtrees development team. +// Copyright (C) 2014 webtrees development team. // // 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 @@ -16,7 +16,7 @@ // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA interface WT_Module_Config { public function getConfigLink(); diff --git a/library/WT/Module/Menu.php b/library/WT/Module/Menu.php index 9b7bc05757..796fdd7a7e 100644 --- a/library/WT/Module/Menu.php +++ b/library/WT/Module/Menu.php @@ -2,7 +2,7 @@ // Classes and libraries for module system // // webtrees: Web based Family History software -// Copyright (C) 2013 webtrees development team. +// Copyright (C) 2014 webtrees development team. // // 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 @@ -16,7 +16,7 @@ // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA interface WT_Module_Menu { public function defaultMenuOrder(); diff --git a/library/WT/Module/Report.php b/library/WT/Module/Report.php index 9eb323029b..0318c2c438 100644 --- a/library/WT/Module/Report.php +++ b/library/WT/Module/Report.php @@ -2,7 +2,7 @@ // Classes and libraries for module system // // webtrees: Web based Family History software -// Copyright (C) 2013 webtrees development team. +// Copyright (C) 2014 webtrees development team. // // 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 @@ -16,7 +16,7 @@ // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA interface WT_Module_Report { public function getReportMenus(); diff --git a/library/WT/Module/Sidebar.php b/library/WT/Module/Sidebar.php index f97b9f660d..3473e0a625 100644 --- a/library/WT/Module/Sidebar.php +++ b/library/WT/Module/Sidebar.php @@ -2,7 +2,7 @@ // Classes and libraries for module system // // webtrees: Web based Family History software -// Copyright (C) 2013 webtrees development team. +// Copyright (C) 2014 webtrees development team. // // 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 @@ -16,7 +16,7 @@ // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA interface WT_Module_Sidebar { public function defaultSidebarOrder(); diff --git a/library/WT/Module/Tab.php b/library/WT/Module/Tab.php index 54c58d2546..dfe44699a5 100644 --- a/library/WT/Module/Tab.php +++ b/library/WT/Module/Tab.php @@ -2,7 +2,7 @@ // Classes and libraries for module system // // webtrees: Web based Family History software -// Copyright (C) 2013 webtrees development team. +// Copyright (C) 2014 webtrees development team. // // 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 @@ -16,7 +16,7 @@ // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA interface WT_Module_Tab { public function defaultTabOrder(); diff --git a/library/WT/Module/Theme.php b/library/WT/Module/Theme.php index 36e80f1296..97f27f5fc5 100644 --- a/library/WT/Module/Theme.php +++ b/library/WT/Module/Theme.php @@ -2,7 +2,7 @@ // Classes and libraries for module system // // webtrees: Web based Family History software -// Copyright (C) 2013 webtrees development team. +// Copyright (C) 2014 webtrees development team. // // 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 @@ -16,7 +16,7 @@ // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA interface WT_Module_Theme { public function getTheme(); diff --git a/library/WT/Note.php b/library/WT/Note.php index 7e3c58891d..e3fa36f6ea 100644 --- a/library/WT/Note.php +++ b/library/WT/Note.php @@ -2,7 +2,7 @@ // Class file for a Shared Note (NOTE) object // // webtrees: Web based Family History software -// Copyright (C) 2013 webtrees development team. +// Copyright (C) 2014 webtrees development team. // // Derived from PhpGedView // Copyright (C) 2009 PGV Development Team. All rights reserved. @@ -19,7 +19,7 @@ // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA if (!defined('WT_WEBTREES')) { header('HTTP/1.0 403 Forbidden'); @@ -73,20 +73,17 @@ class WT_Note extends WT_GedcomRecord { return $statement->execute(array($xref, $gedcom_id))->fetchOne(); } - // The 'name' of a note record is the first line. This can be - // somewhat unwieldy if lots of CONC records are used. Limit to 100 chars - protected function _addName($type, $value, $gedrec) { - if (utf8_strlen($value)<100) { - parent::_addName($type, $value, $gedrec); - } else { - parent::_addName($type, utf8_substr($value, 0, 100).WT_I18N::translate('…'), $gedrec); - } - } - // Get an array of structures containing all the names in the record - public function getAllNames() { + public function extractNames() { // Uniquely, the NOTE objects have data in their level 0 record. - // Hence the REGEX passed in the second parameter - return parent::_getAllNames('NOTE', '0 @'.WT_REGEX_XREF.'@'); + if (preg_match('/^0 @' . WT_REGEX_XREF . '@ NOTE (.+)/', $this->getGedcom(), $match)) { + // The 'name' of a note record is the first line. This can be + // somewhat unwieldy if lots of CONC records are used. Limit to 100 chars + if (utf8_strlen($match[1])<100) { + $this->_addName('NOTE', $match[1], $this->getGedcom()); + } else { + $this->_addName('NOTE', utf8_substr($match[1], 0, 100).WT_I18N::translate('…'), $this->getGedcom()); + } + } } } diff --git a/library/WT/Place.php b/library/WT/Place.php index 65f972fc64..3f266bd92c 100644 --- a/library/WT/Place.php +++ b/library/WT/Place.php @@ -2,7 +2,7 @@ // Gedcom Place functionality. // // webtrees: Web based Family History software -// Copyright (C) 2013 webtrees development team. +// Copyright (C) 2014 webtrees development team. // // 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 @@ -16,7 +16,7 @@ // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA if (!defined('WT_WEBTREES')) { header('HTTP/1.0 403 Forbidden'); diff --git a/library/WT/Query/Admin.php b/library/WT/Query/Admin.php index db29ccf8a8..bfc80e6aba 100644 --- a/library/WT/Query/Admin.php +++ b/library/WT/Query/Admin.php @@ -2,7 +2,7 @@ // MySQL queries for the admin page // // webtrees: Web based Family History software -// Copyright (C) 2011 Greg Roach +// Copyright (C) 2014 Greg Roach // // 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 @@ -16,7 +16,7 @@ // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA if (!defined('WT_WEBTREES')) { header('HTTP/1.0 403 Forbidden'); diff --git a/library/WT/Query/Media.php b/library/WT/Query/Media.php index 813a239bf8..724975a468 100644 --- a/library/WT/Query/Media.php +++ b/library/WT/Query/Media.php @@ -2,7 +2,7 @@ // Static functions to support media lists // // webtrees: Web based Family History software -// Copyright (C) 2013 webtrees development team. +// Copyright (C) 2014 webtrees development team. // // 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 @@ -16,7 +16,7 @@ // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA if (!defined('WT_WEBTREES')) { header('HTTP/1.0 403 Forbidden'); diff --git a/library/WT/Query/Name.php b/library/WT/Query/Name.php index 28625536be..5b89444173 100644 --- a/library/WT/Query/Name.php +++ b/library/WT/Query/Name.php @@ -2,7 +2,7 @@ // MySQL queries on individual names // // webtrees: Web based Family History software -// Copyright (C) 2011 Greg Roach +// Copyright (C) 2014 Greg Roach // // 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 @@ -16,7 +16,7 @@ // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA if (!defined('WT_WEBTREES')) { header('HTTP/1.0 403 Forbidden'); diff --git a/library/WT/Report/Base.php b/library/WT/Report/Base.php index ac0787ac9d..b083122dd9 100644 --- a/library/WT/Report/Base.php +++ b/library/WT/Report/Base.php @@ -4,13 +4,11 @@ // used by the SAX parser to generate reports from the XML report file. // // webtrees: Web based Family History software -// Copyright (C) 2013 webtrees development team. +// Copyright (C) 2014 webtrees development team. // // Derived from PhpGedView // Copyright (C) 2002 to 2009 PGV Development Team. All rights reserved. // -// Modifications Copyright (c) 2010 Greg Roach -// // 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 // the Free Software Foundation; either version 2 of the License, or @@ -23,7 +21,7 @@ // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA if (!defined('WT_WEBTREES')) { header('HTTP/1.0 403 Forbidden'); @@ -31,19 +29,19 @@ if (!defined('WT_WEBTREES')) { } /** - * Enable HTML code to pass for testing - * false = use the old style, HTML disabled - * true = use the new style, HTML enabled - */ +* Enable HTML code to pass for testing +* false = use the old style, HTML disabled +* true = use the new style, HTML enabled +*/ define("WT_RNEW", false); /** - * Main Report Class - * - * Document wide functions and variable defaults that will be inherited of the report modules - * @package webtrees - * @subpackage Reports - */ +* Main Report Class +* +* Document wide functions and variable defaults that will be inherited of the report modules +* @package webtrees +* @subpackage Reports +*/ class WT_Report_Base { /** * Left Margin (expressed in points) Default: 17.99 mm, 0.7083 inch @@ -406,11 +404,11 @@ class WT_Report_Base { } /** - * Main WT Report Element class that all other page elements are extended from - * - * @package webtrees - * @subpackage Reports - */ +* Main WT Report Element class that all other page elements are extended from +* +* @package webtrees +* @subpackage Reports +*/ class Element { /** * @var string @@ -541,7 +539,7 @@ class Html extends Element { } /** - * Cell element class +* Cell element class * * @package webtrees * @subpackage Reports @@ -694,7 +692,7 @@ class Cell extends Element { } /** - * TextBox element class +* TextBox element class * * @package webtrees * @subpackage Reports @@ -839,7 +837,7 @@ class TextBox extends Element { } /** - * Text element class +* Text element class * * @package webtrees * @subpackage Reports @@ -905,7 +903,7 @@ class Text extends Element { } /** - * Footnote element class +* Footnote element class * * @package webtrees * @subpackage Reports @@ -1002,7 +1000,7 @@ class Footnote extends Element { } /** - * PageHeader element class +* PageHeader element class * * @package webtrees * @subpackage Reports @@ -1040,7 +1038,7 @@ class PageHeader extends Element { } /** - * Image element class +* Image element class * * @package webtrees * @subpackage Reports @@ -1123,7 +1121,7 @@ class Image extends Element { } /** - * Line element class +* Line element class * * @package webtrees * @subpackage Reports @@ -1184,16 +1182,16 @@ class Line extends Element { } /** - *XML start element handler - * - * This function is called whenever a starting element is reached - * The element handler will be called if found, otherwise it must be HTML - * - * @param resource $parser the resource handler for the XML parser - * @param string $name the name of the XML element parsed - * @param array $attrs an array of key value pairs for the attributes - * @see endElement() - */ +*XML start element handler +* +* This function is called whenever a starting element is reached +* The element handler will be called if found, otherwise it must be HTML +* +* @param resource $parser the resource handler for the XML parser +* @param string $name the name of the XML element parsed +* @param array $attrs an array of key value pairs for the attributes +* @see endElement() +*/ function startElement($parser, $name, $attrs) { global $elementHandler, $processIfs, $processGedcoms, $processRepeats, $vars; global $processFootnote; @@ -1222,15 +1220,15 @@ function startElement($parser, $name, $attrs) { } /** - * XML end element handler - * - * This function is called whenever an ending element is reached - * The element handler will be called if found, otherwise it must be HTML - * - * @param resource $parser the resource handler for the XML parser - * @param string $name the name of the XML element parsed - * @see startElement() - */ +* XML end element handler +* +* This function is called whenever an ending element is reached +* The element handler will be called if found, otherwise it must be HTML +* +* @param resource $parser the resource handler for the XML parser +* @param string $name the name of the XML element parsed +* @see startElement() +*/ function endElement($parser, $name) { global $elementHandler, $processIfs, $processGedcoms, $processRepeats; global $processFootnote; @@ -1247,14 +1245,14 @@ function endElement($parser, $name) { } /** - * XML character data handler - * - * This function is called whenever raw character data is reached - * just print it to the screen - * @param resource $parser the resource handler for the XML parser - * @param string $data the name of the XML element parsed - * @todo check this - */ +* XML character data handler +* +* This function is called whenever raw character data is reached +* just print it to the screen +* @param resource $parser the resource handler for the XML parser +* @param string $data the name of the XML element parsed +* @todo check this +*/ function characterData($parser, $data) { global $printData, $currentElement, $processGedcoms, $processIfs, $processRepeats, $reportTitle, $wt_report, $reportDescription; @@ -1659,7 +1657,7 @@ function GedcomSHandler($attrs) { $newgedrec = ""; if (count($tags)<2) { $tmp=WT_GedcomRecord::getInstance($attrs['id']); - $newgedrec=$tmp ? $tmp->getGedcom() : ''; + $newgedrec=$tmp ? $tmp->privatizeGedcom(WT_USER_ACCESS_LEVEL) : ''; } if (empty($newgedrec)) { $tgedrec = $gedrec; @@ -1670,14 +1668,14 @@ function GedcomSHandler($attrs) { $newgedrec = $vars[$match[1]]['gedcom']; } else { $tmp=WT_GedcomRecord::getInstance($match[1]); - $newgedrec=$tmp ? $tmp->getGedcom() : ''; + $newgedrec=$tmp ? $tmp->privatizeGedcom(WT_USER_ACCESS_LEVEL) : ''; } } else { if (preg_match("/@(.+)/", $tag, $match)) { $gmatch = array(); if (preg_match("/\d $match[1] @([^@]+)@/", $tgedrec, $gmatch)) { $tmp=WT_GedcomRecord::getInstance($gmatch[1]); - $newgedrec=$tmp ? $tmp->getGedcom() : ''; + $newgedrec=$tmp ? $tmp->privatizeGedcom(WT_USER_ACCESS_LEVEL) : ''; $tgedrec = $newgedrec; } else { $newgedrec = ""; @@ -2241,7 +2239,7 @@ function varSHandler($attrs) { $var = $vars[$var]['id']; } else { $tfact = $fact; - if (($fact == "EVEN" or $fact == "FACT") and $type != " ") { + if (($fact == "EVEN" || $fact == "FACT") && is_string($type) && $type != " ") { // Use : // n TYPE This text if string $tfact = $type; @@ -3138,7 +3136,7 @@ function ListSHandler($attrs) { if ($filters) { foreach ($list as $key=>$record) { foreach ($filters as $filter) { - if (!preg_match("/".$filter."/i", $record->getGedcom())) { + if (!preg_match("/".$filter."/i", $record->privatizeGedcom(WT_USER_ACCESS_LEVEL))) { unset($list[$key]); break; } @@ -3149,7 +3147,7 @@ function ListSHandler($attrs) { $mylist = array(); foreach ($list as $indi) { $key=$indi->getXref(); - $grec=$indi->getGedcom(); + $grec=$indi->privatizeGedcom(WT_USER_ACCESS_LEVEL); $keep = true; foreach ($filters2 as $filter) { if ($keep) { @@ -3301,7 +3299,7 @@ function ListEHandler() { $list_private = 0; foreach ($list as $record) { if ($record->canShow()) { - $gedrec = $record->getGedcom(); + $gedrec = $record->privatizeGedcom(WT_USER_ACCESS_LEVEL); //-- start the sax parser $repeat_parser = xml_parser_create(); $parser = $repeat_parser; @@ -3533,7 +3531,7 @@ function RelativesEHandler() { $generation = $value->generation; } $tmp=WT_GedcomRecord::getInstance($key); - $gedrec = $tmp->getGedcom(); + $gedrec = $tmp->privatizeGedcom(WT_USER_ACCESS_LEVEL); //-- start the sax parser $repeat_parser = xml_parser_create(); $parser = $repeat_parser; @@ -3674,15 +3672,15 @@ function DescriptionEHandler() { } /** - * get gedcom tag value - * - * returns the value of a gedcom tag from the given gedcom record - * @param string $tag The tag to find, use : to delineate subtags - * @param int $level The gedcom line level of the first tag to find, setting level to 0 will cause it to use 1+ the level of the incoming record - * @param string $gedrec The gedcom record to get the value from - * @param int $truncate Should the value be truncated to a certain number of characters - * @return string - */ +* get gedcom tag value +* +* returns the value of a gedcom tag from the given gedcom record +* @param string $tag The tag to find, use : to delineate subtags +* @param int $level The gedcom line level of the first tag to find, setting level to 0 will cause it to use 1+ the level of the incoming record +* @param string $gedrec The gedcom record to get the value from +* @param int $truncate Should the value be truncated to a certain number of characters +* @return string +*/ function get_gedcom_value($tag, $level, $gedrec, $truncate='') { global $GEDCOM; $ged_id=get_id_from_gedcom($GEDCOM); diff --git a/library/WT/Report/HTML.php b/library/WT/Report/HTML.php index a409ce27ef..dfce1ad9b1 100644 --- a/library/WT/Report/HTML.php +++ b/library/WT/Report/HTML.php @@ -4,7 +4,7 @@ // used by the SAX parser to generate HTML reports from the XML report file. // // webtrees: Web based Family History software -// Copyright (C) 2013 webtrees development team. +// Copyright (C) 2014 webtrees development team. // // Derived from PhpGedView // Copyright (C) 2002 to 2009 PGV Development Team. All rights reserved. @@ -21,7 +21,7 @@ // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA if (!defined('WT_WEBTREES')) { header('HTTP/1.0 403 Forbidden'); diff --git a/library/WT/Report/PDF.php b/library/WT/Report/PDF.php index 5e86101c61..e59e39365d 100644 --- a/library/WT/Report/PDF.php +++ b/library/WT/Report/PDF.php @@ -4,7 +4,7 @@ // used by the SAX parser to generate PDF reports from the XML report file. // // webtrees: Web based Family History software -// Copyright (C) 2013 webtrees development team. +// Copyright (C) 2014 webtrees development team. // // Derived from PhpGedView // Copyright (C) 2002 to 2009 PGV Development Team. All rights reserved. @@ -21,7 +21,7 @@ // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA if (!defined('WT_WEBTREES')) { header('HTTP/1.0 403 Forbidden'); diff --git a/library/WT/Repository.php b/library/WT/Repository.php index 054b214726..5254c68e23 100644 --- a/library/WT/Repository.php +++ b/library/WT/Repository.php @@ -2,7 +2,7 @@ // Class file for a Repository (REPO) object // // webtrees: Web based Family History software -// Copyright (C) 2013 webtrees development team. +// Copyright (C) 2014 webtrees development team. // // Derived from PhpGedView // Copyright (C) 2002 to 2009 PGV Development Team. All rights reserved. @@ -19,7 +19,7 @@ // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA if (!defined('WT_WEBTREES')) { header('HTTP/1.0 403 Forbidden'); @@ -48,7 +48,7 @@ class WT_Repository extends WT_GedcomRecord { } // Get an array of structures containing all the names in the record - public function getAllNames() { - return parent::_getAllNames('NAME', 1); + public function extractNames() { + parent::_extractNames(1, 'NAME', $this->getFacts('NAME')); } } diff --git a/library/WT/Site.php b/library/WT/Site.php index 9b82b283a5..3cf88ab051 100644 --- a/library/WT/Site.php +++ b/library/WT/Site.php @@ -2,7 +2,7 @@ // Provide an interface to the wt_site_setting table // // webtrees: Web based Family History software -// Copyright (c) 2013 webtrees development team +// Copyright (c) 2014 webtrees development team // // 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 @@ -16,7 +16,7 @@ // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA if (!defined('WT_WEBTREES')) { header('HTTP/1.0 403 Forbidden'); diff --git a/library/WT/Soundex.php b/library/WT/Soundex.php index 9aecd1f494..7a80200a60 100644 --- a/library/WT/Soundex.php +++ b/library/WT/Soundex.php @@ -2,7 +2,7 @@ // Functions for phonetic matching of strings // // webtrees: Web based Family History software -// Copyright (C) 2013 webtrees development team. +// Copyright (C) 2014 webtrees development team. // // 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 @@ -16,7 +16,7 @@ // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA if (!defined('WT_WEBTREES')) { header('HTTP/1.0 403 Forbidden'); diff --git a/library/WT/Source.php b/library/WT/Source.php index 2d641c3bb0..f6aee02dd9 100644 --- a/library/WT/Source.php +++ b/library/WT/Source.php @@ -2,7 +2,7 @@ // Class file for a Source (SOUR) object // // webtrees: Web based Family History software -// Copyright (C) 2013 webtrees development team. +// Copyright (C) 2014 webtrees development team. // // Derived from PhpGedView // Copyright (C) 2002 to 2009 PGV Development Team. All rights reserved. @@ -19,7 +19,7 @@ // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA if (!defined('WT_WEBTREES')) { header('HTTP/1.0 403 Forbidden'); @@ -63,7 +63,7 @@ class WT_Source extends WT_GedcomRecord { } // Get an array of structures containing all the names in the record - public function getAllNames() { - return parent::_getAllNames('TITL', 1); + public function extractNames() { + parent::_extractNames(1, 'TITL', $this->getFacts('TITL')); } } diff --git a/library/WT/Stats.php b/library/WT/Stats.php index f480686b98..8dc51735f4 100644 --- a/library/WT/Stats.php +++ b/library/WT/Stats.php @@ -5,7 +5,7 @@ // about the family tree. // // webtrees: Web based Family History software -// Copyright (C) 2013 webtrees development team. +// Copyright (C) 2014 webtrees development team. // // Derived from PhpGedView // Copyright (C) 2002 to 2010 PGV Development Team. All rights reserved. @@ -22,7 +22,7 @@ // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA if (!defined('WT_WEBTREES')) { header('HTTP/1.0 403 Forbidden'); diff --git a/library/WT/Tree.php b/library/WT/Tree.php index 9463cd7cd3..06c1612a29 100644 --- a/library/WT/Tree.php +++ b/library/WT/Tree.php @@ -2,7 +2,7 @@ // Provide an interface to the wt_gedcom table // // webtrees: Web based Family History software -// Copyright (c) 2013 webtrees development team +// Copyright (C) 2014 webtrees development team // // 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 @@ -16,7 +16,7 @@ // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA if (!defined('WT_WEBTREES')) { header('HTTP/1.0 403 Forbidden'); @@ -224,13 +224,13 @@ class WT_Tree { set_gedcom_setting($tree_id, 'COMMON_NAMES_THRESHOLD', '40'); set_gedcom_setting($tree_id, 'CONTACT_USER_ID', WT_USER_ID); set_gedcom_setting($tree_id, 'DEFAULT_PEDIGREE_GENERATIONS', '4'); - set_gedcom_setting($tree_id, 'EXPAND_NOTES', false); set_gedcom_setting($tree_id, 'EXPAND_RELATIVES_EVENTS', false); set_gedcom_setting($tree_id, 'EXPAND_SOURCES', false); set_gedcom_setting($tree_id, 'FAM_FACTS_ADD', 'CENS,MARR,RESI,SLGS,MARR_CIVIL,MARR_RELIGIOUS,MARR_PARTNERS,RESN'); set_gedcom_setting($tree_id, 'FAM_FACTS_QUICK', 'MARR,DIV,_NMR'); set_gedcom_setting($tree_id, 'FAM_FACTS_UNIQUE', 'NCHI,MARL,DIV,ANUL,DIVF,ENGA,MARB,MARC,MARS'); set_gedcom_setting($tree_id, 'FAM_ID_PREFIX', 'F'); + set_gedcom_setting($tree_id, 'FORMAT_TEXT', 'markdown'); set_gedcom_setting($tree_id, 'FULL_SOURCES', false); set_gedcom_setting($tree_id, 'GEDCOM_ID_PREFIX', 'I'); set_gedcom_setting($tree_id, 'GEDCOM_MEDIA_PATH', ''); |
