summaryrefslogtreecommitdiff
path: root/family.php
diff options
context:
space:
mode:
authorGreg Roach <fisharebest@gmail.com>2018-01-10 21:43:33 +0000
committerGreg Roach <fisharebest@gmail.com>2018-01-13 11:26:45 +0000
commit225e381f36d59b49c8cdac0060465fa5af2fc308 (patch)
tree89cdab8ff4f2fd708b54c292ed2339c2028d38a4 /family.php
parent181186b616da35d9a7627f0b17fa144ff9355c99 (diff)
downloadwebtrees-225e381f36d59b49c8cdac0060465fa5af2fc308.tar.gz
webtrees-225e381f36d59b49c8cdac0060465fa5af2fc308.tar.bz2
webtrees-225e381f36d59b49c8cdac0060465fa5af2fc308.zip
Use views for genealogy objects
Diffstat (limited to 'family.php')
-rw-r--r--family.php33
1 files changed, 4 insertions, 29 deletions
diff --git a/family.php b/family.php
index 2c2faec2a5..62c607100e 100644
--- a/family.php
+++ b/family.php
@@ -13,34 +13,9 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-namespace Fisharebest\Webtrees;
-use Fisharebest\Webtrees\Controller\FamilyController;
+// Redirect legacy URLs to the new router.
+$_GET['xref'] = $_GET['famid'] ?? '';
+$_GET['route'] = 'family';
-/** @global Tree $WT_TREE */
-global $WT_TREE;
-
-require 'includes/session.php';
-
-$record = Family::getInstance(Filter::get('famid', WT_REGEX_XREF), $WT_TREE);
-$controller = new FamilyController($record);
-
-if ($controller->record && $controller->record->canShow()) {
- $controller->pageHeader();
-} else {
- http_response_code(404);
- $controller->pageHeader();
-
- echo View::make('alerts/danger', [
- 'alert' => I18N::translate('This family does not exist or you do not have permission to view it.'),
- ]);
-
- return;
-}
-
-$facts = $controller->record->getFacts(null, true);
-
-echo View::make('family-page', [
- 'family' => $controller->record,
- 'facts' => $facts,
-]);
+require __DIR__ . '/index.php';