Exemple #1
0
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation; either version 2 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU General Public License for more details.
//
// 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
define('WT_SCRIPT_NAME', 'hourglass.php');
require './includes/session.php';
require_once WT_ROOT . 'includes/functions/functions_edit.php';
$controller = new WT_Controller_Hourglass();
$controller->pageHeader()->addExternalJavascript(WT_STATIC_URL . 'js/autocomplete.js')->addInlineJavascript('autocomplete();')->setupJavascript()->addInlineJavascript('sizeLines();');
$gencount = 0;
?>
<div id="hourglass-page">
	<h2><?php 
echo $controller->getPageTitle();
?>
</h2>
	<form method="get" name="people" action="?">
		<input type="hidden" name="ged" value="<?php 
echo WT_Filter::escapeHtml(WT_GEDCOM);
?>
">
		<input type="hidden" name="show_full" value="<?php 
echo $controller->show_full;
Exemple #2
0
 public function getBlock($block_id, $template = true, $cfg = null)
 {
     global $ctype, $PEDIGREE_FULL_DETAILS, $show_full, $bwidth, $bheight;
     $PEDIGREE_ROOT_ID = get_gedcom_setting(WT_GED_ID, 'PEDIGREE_ROOT_ID');
     $details = get_block_setting($block_id, 'details', false);
     $type = get_block_setting($block_id, 'type', 'pedigree');
     $pid = get_block_setting($block_id, 'pid', WT_USER_ID ? WT_USER_GEDCOM_ID ? WT_USER_GEDCOM_ID : $PEDIGREE_ROOT_ID : $PEDIGREE_ROOT_ID);
     $block = get_block_setting($block_id, 'block');
     if ($cfg) {
         foreach (array('details', 'type', 'pid', 'block') as $name) {
             if (array_key_exists($name, $cfg)) {
                 ${$name} = $cfg[$name];
             }
         }
     }
     // Override GEDCOM configuration temporarily
     if (isset($show_full)) {
         $saveShowFull = $show_full;
     }
     $savePedigreeFullDetails = $PEDIGREE_FULL_DETAILS;
     if (!$details) {
         $show_full = 0;
         // Here we could adjust the block width & height to accommodate larger displays
     } else {
         $show_full = 1;
         // Here we could adjust the block width & height to accommodate larger displays
     }
     $PEDIGREE_FULL_DETAILS = $show_full;
     $person = WT_Individual::getInstance($pid);
     if (!$person) {
         $pid = $PEDIGREE_ROOT_ID;
         set_block_setting($block_id, 'pid', $pid);
         $person = WT_Individual::getInstance($pid);
     }
     if ($type != 'treenav' && $person) {
         $controller = new WT_Controller_Hourglass($person->getXref(), 0);
         $controller->setupJavascript();
     }
     $id = $this->getName() . $block_id;
     $class = $this->getName() . '_block';
     if ($ctype == 'gedcom' && WT_USER_GEDCOM_ADMIN || $ctype == 'user' && WT_USER_ID) {
         $title = '<i class="icon-admin" title="' . WT_I18N::translate('Configure') . '" onclick="modalDialog(\'block_edit.php?block_id=' . $block_id . '\', \'' . $this->getTitle() . '\');"></i>';
     } else {
         $title = '';
     }
     if ($person) {
         switch ($type) {
             case 'pedigree':
                 $title .= WT_I18N::translate('Pedigree of %s', $person->getFullName());
                 break;
             case 'descendants':
                 $title .= WT_I18N::translate('Descendants of %s', $person->getFullName());
                 break;
             case 'hourglass':
                 $title .= WT_I18N::translate('Hourglass chart of %s', $person->getFullName());
                 break;
             case 'treenav':
                 $title .= WT_I18N::translate('Interactive tree of %s', $person->getFullName());
                 break;
         }
         $title .= help_link('index_charts', $this->getName());
         $content = '<table cellspacing="0" cellpadding="0" border="0"><tr>';
         if ($type == 'descendants' || $type == 'hourglass') {
             $content .= "<td valign=\"middle\">";
             ob_start();
             $controller->print_descendency($person, 1, false);
             $content .= ob_get_clean();
             $content .= "</td>";
         }
         if ($type == 'pedigree' || $type == 'hourglass') {
             //-- print out the root person
             if ($type != 'hourglass') {
                 $content .= "<td valign=\"middle\">";
                 ob_start();
                 print_pedigree_person($person);
                 $content .= ob_get_clean();
                 $content .= "</td>";
             }
             $content .= "<td valign=\"middle\">";
             ob_start();
             $controller->print_person_pedigree($person, 1);
             $content .= ob_get_clean();
             $content .= "</td>";
         }
         if ($type == 'treenav') {
             require_once WT_MODULES_DIR . 'tree/module.php';
             require_once WT_MODULES_DIR . 'tree/class_treeview.php';
             $mod = new tree_WT_Module();
             $tv = new TreeView();
             $content .= '<td>';
             $content .= '<script>jQuery("head").append(\'<link rel="stylesheet" href="' . $mod->css() . '" type="text/css" />\');</script>';
             $content .= '<script src="' . $mod->js() . '"></script>';
             list($html, $js) = $tv->drawViewport($person, 2);
             $content .= $html . '<script>' . $js . '</script>';
             $content .= '</td>';
         }
         $content .= "</tr></table>";
     } else {
         $content = WT_I18N::translate('You must select an individual and chart type in the block configuration settings.');
     }
     if ($template) {
         if ($block) {
             require WT_THEME_DIR . 'templates/block_small_temp.php';
         } else {
             require WT_THEME_DIR . 'templates/block_main_temp.php';
         }
     } else {
         return $content;
     }
     // Restore GEDCOM configuration
     unset($show_full);
     if (isset($saveShowFull)) {
         $show_full = $saveShowFull;
     }
     $PEDIGREE_FULL_DETAILS = $savePedigreeFullDetails;
 }
//
// webtrees: Web based Family History software
// Copyright (C) 2014 webtrees development team.
//
// Derived from PhpGedView
// Copyright (C) 2002 to 2007  John Finlay and Others
//
// 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
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU General Public License for more details.
//
// 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
define('WT_SCRIPT_NAME', 'hourglass_ajax.php');
require './includes/session.php';
$controller = new WT_Controller_Hourglass();
header('Content-type: text/html; charset=UTF-8');
Zend_Session::writeClose();
// -- print html header information
if (WT_Filter::get('type') == 'desc') {
    $controller->print_descendency(WT_Individual::getInstance($controller->pid), 1, false);
} else {
    $controller->print_person_pedigree(WT_Individual::getInstance($controller->pid), 0);
}