summaryrefslogtreecommitdiff
path: root/library/WT/Controller
diff options
context:
space:
mode:
Diffstat (limited to 'library/WT/Controller')
-rw-r--r--library/WT/Controller/AdvancedSearch.php4
-rw-r--r--library/WT/Controller/Ajax.php4
-rw-r--r--library/WT/Controller/Ancestry.php4
-rw-r--r--library/WT/Controller/Base.php4
-rw-r--r--library/WT/Controller/Branches.php4
-rw-r--r--library/WT/Controller/Chart.php4
-rw-r--r--library/WT/Controller/Compact.php6
-rw-r--r--library/WT/Controller/Descendancy.php4
-rw-r--r--library/WT/Controller/Family.php4
-rw-r--r--library/WT/Controller/Familybook.php4
-rw-r--r--library/WT/Controller/Fanchart.php6
-rw-r--r--library/WT/Controller/GedcomRecord.php4
-rw-r--r--library/WT/Controller/Hourglass.php4
-rw-r--r--library/WT/Controller/Individual.php11
-rw-r--r--library/WT/Controller/Lifespan.php4
-rw-r--r--library/WT/Controller/Media.php21
-rw-r--r--library/WT/Controller/Note.php4
-rw-r--r--library/WT/Controller/Page.php6
-rw-r--r--library/WT/Controller/Pedigree.php4
-rw-r--r--library/WT/Controller/Repository.php12
-rw-r--r--library/WT/Controller/Search.php4
-rw-r--r--library/WT/Controller/Simple.php4
-rw-r--r--library/WT/Controller/Source.php12
-rw-r--r--library/WT/Controller/Timeline.php4
24 files changed, 79 insertions, 63 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>&nbsp;&nbsp;<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&amp;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');