summaryrefslogtreecommitdiff
path: root/library/WT/Controller
diff options
context:
space:
mode:
authorGreg Roach <fisharebest@gmail.com>2014-08-14 10:35:02 +0100
committerGreg Roach <fisharebest@gmail.com>2014-08-14 10:35:02 +0100
commitb91ce4e162976f6e4d1c308524ea1bf460430bc8 (patch)
treece015689ba12e7e28a481cff8c199f41fbfb29f8 /library/WT/Controller
parentbcb3a83fa321f35dade827c7d6b46f73a8fd84a9 (diff)
downloadwebtrees-b91ce4e162976f6e4d1c308524ea1bf460430bc8.tar.gz
webtrees-b91ce4e162976f6e4d1c308524ea1bf460430bc8.tar.bz2
webtrees-b91ce4e162976f6e4d1c308524ea1bf460430bc8.zip
Import classes, per PSR autoloading standards
Diffstat (limited to 'library/WT/Controller')
-rw-r--r--library/WT/Controller/Family.php4
-rw-r--r--library/WT/Controller/Individual.php9
-rw-r--r--library/WT/Controller/Media.php4
-rw-r--r--library/WT/Controller/Note.php4
-rw-r--r--library/WT/Controller/Repository.php4
-rw-r--r--library/WT/Controller/Search.php4
-rw-r--r--library/WT/Controller/Source.php4
7 files changed, 24 insertions, 9 deletions
diff --git a/library/WT/Controller/Family.php b/library/WT/Controller/Family.php
index d2eb2c0a02..b36b7b59cf 100644
--- a/library/WT/Controller/Family.php
+++ b/library/WT/Controller/Family.php
@@ -21,6 +21,8 @@
// along with this program; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+use WT\Auth;
+
require_once WT_ROOT.'includes/functions/functions_print_facts.php';
require_once WT_ROOT.'includes/functions/functions_import.php';
@@ -107,7 +109,7 @@ class WT_Controller_Family extends WT_Controller_GedcomRecord {
}
// edit raw
- if (\WT\Auth::isAdmin() || WT_USER_CAN_EDIT && $SHOW_GEDCOM_RECORD) {
+ if (Auth::isAdmin() || WT_USER_CAN_EDIT && $SHOW_GEDCOM_RECORD) {
$submenu = new WT_Menu(WT_I18N::translate('Edit raw GEDCOM'), '#', 'menu-fam-editraw');
$submenu->addOnclick("return edit_raw('" . $this->record->getXref() . "');");
$menu->addSubmenu($submenu);
diff --git a/library/WT/Controller/Individual.php b/library/WT/Controller/Individual.php
index 5cc5069698..b8ae9fbe87 100644
--- a/library/WT/Controller/Individual.php
+++ b/library/WT/Controller/Individual.php
@@ -21,6 +21,9 @@
// along with this program; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+use WT\Auth;
+use WT\User;
+
require_once WT_ROOT.'includes/functions/functions_print_facts.php';
require_once WT_ROOT.'includes/functions/functions_import.php';
@@ -140,8 +143,8 @@ class WT_Controller_Individual extends WT_Controller_GedcomRecord {
$dummy->setPrimaryName(0);
echo '<dd class="field">', $dummy->getFullName();
if ($this->name_count == 1) {
- if (\WT\Auth::isAdmin()) {
- $user = \WT\User::findByGenealogyRecord($WT_TREE, $this->record);
+ if (Auth::isAdmin()) {
+ $user = User::findByGenealogyRecord($WT_TREE, $this->record);
if ($user) {
echo '<span> - <a class="warning" href="admin_users.php?filter=' . WT_Filter::escapeHtml($user->getUserName()) . '">' . WT_Filter::escapeHtml($user->getUserName()) . '</a></span>';
}
@@ -301,7 +304,7 @@ class WT_Controller_Individual extends WT_Controller_GedcomRecord {
}
// edit raw
- if (\WT\Auth::isAdmin() || WT_USER_CAN_EDIT && $SHOW_GEDCOM_RECORD) {
+ if (Auth::isAdmin() || WT_USER_CAN_EDIT && $SHOW_GEDCOM_RECORD) {
$submenu = new WT_Menu(WT_I18N::translate('Edit raw GEDCOM'), '#', 'menu-indi-editraw');
$submenu->addOnclick("return edit_raw('" . $this->record->getXref() . "');");
$menu->addSubmenu($submenu);
diff --git a/library/WT/Controller/Media.php b/library/WT/Controller/Media.php
index 1450ebffa0..dcceac8d08 100644
--- a/library/WT/Controller/Media.php
+++ b/library/WT/Controller/Media.php
@@ -21,6 +21,8 @@
// along with this program; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+use WT\Auth;
+
require_once WT_ROOT.'includes/functions/functions_print_facts.php';
require_once WT_ROOT.'includes/functions/functions_import.php';
@@ -81,7 +83,7 @@ class WT_Controller_Media extends WT_Controller_GedcomRecord {
}
// edit raw
- if (\WT\Auth::isAdmin() || WT_USER_CAN_EDIT && $SHOW_GEDCOM_RECORD) {
+ if (Auth::isAdmin() || WT_USER_CAN_EDIT && $SHOW_GEDCOM_RECORD) {
$submenu = new WT_Menu(WT_I18N::translate('Edit raw GEDCOM'), '#', 'menu-obje-editraw');
$submenu->addOnclick("return edit_raw('" . $this->record->getXref() . "');");
$menu->addSubmenu($submenu);
diff --git a/library/WT/Controller/Note.php b/library/WT/Controller/Note.php
index 32a0e23184..c125a1567d 100644
--- a/library/WT/Controller/Note.php
+++ b/library/WT/Controller/Note.php
@@ -21,6 +21,8 @@
// along with this program; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+use WT\Auth;
+
require_once WT_ROOT.'includes/functions/functions_print_facts.php';
require_once WT_ROOT.'includes/functions/functions_import.php';
@@ -53,7 +55,7 @@ class WT_Controller_Note extends WT_Controller_GedcomRecord {
// edit raw
/* Does not currently work - NOTE records do not contain nice level 1 facts
- if (\WT\Auth::isAdmin() || WT_USER_CAN_EDIT && $SHOW_GEDCOM_RECORD) {
+ if (Auth::isAdmin() || WT_USER_CAN_EDIT && $SHOW_GEDCOM_RECORD) {
$submenu = new WT_Menu(WT_I18N::translate('Edit raw GEDCOM'), '#', 'menu-note-editraw');
$submenu->addOnclick("return edit_raw('" . $this->record->getXref() . "');");
$menu->addSubmenu($submenu);
diff --git a/library/WT/Controller/Repository.php b/library/WT/Controller/Repository.php
index 61f6f8941d..3a48cdf039 100644
--- a/library/WT/Controller/Repository.php
+++ b/library/WT/Controller/Repository.php
@@ -21,6 +21,8 @@
// along with this program; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+use WT\Auth;
+
require_once WT_ROOT.'includes/functions/functions_print_facts.php';
require_once WT_ROOT.'includes/functions/functions_import.php';
@@ -66,7 +68,7 @@ class WT_Controller_Repository extends WT_Controller_GedcomRecord {
}
// edit raw
- if (\WT\Auth::isAdmin() || WT_USER_CAN_EDIT && $SHOW_GEDCOM_RECORD) {
+ if (Auth::isAdmin() || WT_USER_CAN_EDIT && $SHOW_GEDCOM_RECORD) {
$submenu = new WT_Menu(WT_I18N::translate('Edit raw GEDCOM'), '#', 'menu-repo-editraw');
$submenu->addOnclick("return edit_raw('" . $this->record->getXref() . "');");
$menu->addSubmenu($submenu);
diff --git a/library/WT/Controller/Search.php b/library/WT/Controller/Search.php
index b9bee174cf..cf212c5ee2 100644
--- a/library/WT/Controller/Search.php
+++ b/library/WT/Controller/Search.php
@@ -21,6 +21,8 @@
// along with this program; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+use WT\Log;
+
class WT_Controller_Search extends WT_Controller_Page {
public $action;
// TODO: decide if these variables are public/private/protected (or unused)
@@ -381,7 +383,7 @@ class WT_Controller_Search extends WT_Controller_Page {
return;
}
- \WT\Log::addEditLog("Search And Replace old:".$oldquery." new:".$this->replace);
+ Log::addEditLog("Search And Replace old:".$oldquery." new:".$this->replace);
$manual_save = true;
// Include edit functions.
require_once WT_ROOT.'includes/functions/functions_edit.php';
diff --git a/library/WT/Controller/Source.php b/library/WT/Controller/Source.php
index 5b8e3d6d04..19399bb950 100644
--- a/library/WT/Controller/Source.php
+++ b/library/WT/Controller/Source.php
@@ -21,6 +21,8 @@
// along with this program; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+use WT\Auth;
+
require_once WT_ROOT.'includes/functions/functions_print_facts.php';
require_once WT_ROOT.'includes/functions/functions_import.php';
@@ -66,7 +68,7 @@ class WT_Controller_Source extends WT_Controller_GedcomRecord {
}
// edit raw
- if (\WT\Auth::isAdmin() || WT_USER_CAN_EDIT && $SHOW_GEDCOM_RECORD) {
+ if (Auth::isAdmin() || WT_USER_CAN_EDIT && $SHOW_GEDCOM_RECORD) {
$submenu = new WT_Menu(WT_I18N::translate('Edit raw GEDCOM'), '#', 'menu-sour-editraw');
$submenu->addOnclick("return edit_raw('" . $this->record->getXref() . "');");
$menu->addSubmenu($submenu);