Пример #1
0
 /**
  * Generate the HTML content of this block.
  *
  * @param int      $block_id
  * @param bool     $template
  * @param string[] $cfg
  *
  * @return string
  */
 public function getBlock($block_id, $template = true, $cfg = array())
 {
     global $WT_TREE;
     $id = $this->getName() . $block_id;
     $class = $this->getName() . '_block';
     $title = '<span dir="auto">' . I18N::translate('Welcome %s', Auth::user()->getRealNameHtml()) . '</span>';
     $content = '<table><tr>';
     $content .= '<td><a href="edituser.php"><i class="icon-mypage"></i><br>' . I18N::translate('My account') . '</a></td>';
     $gedcomid = $WT_TREE->getUserPreference(Auth::user(), 'gedcomid');
     if ($gedcomid) {
         if (Module::isActiveChart($WT_TREE, 'pedigree_chart')) {
             $content .= '<td><a href="pedigree.php?rootid=' . $gedcomid . '&amp;ged=' . $WT_TREE->getNameUrl() . '"><i class="icon-pedigree"></i><br>' . I18N::translate('My pedigree') . '</a></td>';
         }
         $content .= '<td><a href="individual.php?pid=' . $gedcomid . '&amp;ged=' . $WT_TREE->getNameUrl() . '"><i class="icon-indis"></i><br>' . I18N::translate('My individual record') . '</a></td>';
     }
     $content .= '</tr></table>';
     if ($template) {
         return Theme::theme()->formatBlock($id, $title, $class, $content);
     } else {
         return $content;
     }
 }
Пример #2
0
 /**
  * Generate the HTML content of this block.
  *
  * @param int      $block_id
  * @param bool     $template
  * @param string[] $cfg
  *
  * @return string
  */
 public function getBlock($block_id, $template = true, $cfg = array())
 {
     global $controller, $WT_TREE;
     $indi_xref = $controller->getSignificantIndividual()->getXref();
     $id = $this->getName() . $block_id;
     $class = $this->getName() . '_block';
     $title = $WT_TREE->getTitleHtml();
     $content = '<table><tr>';
     if (Module::isActiveChart($WT_TREE, 'pedigree_chart')) {
         $content .= '<td><a href="pedigree.php?rootid=' . $indi_xref . '&amp;ged=' . $WT_TREE->getNameUrl() . '"><i class="icon-pedigree"></i><br>' . I18N::translate('Default chart') . '</a></td>';
     }
     $content .= '<td><a href="individual.php?pid=' . $indi_xref . '&amp;ged=' . $WT_TREE->getNameUrl() . '"><i class="icon-indis"></i><br>' . I18N::translate('Default individual') . '</a></td>';
     if (Site::getPreference('USE_REGISTRATION_MODULE') && !Auth::check()) {
         $content .= '<td><a href="' . WT_LOGIN_URL . '?action=register"><i class="icon-user_add"></i><br>' . I18N::translate('Request a new user account') . '</a></td>';
     }
     $content .= "</tr>";
     $content .= "</table>";
     if ($template) {
         return Theme::theme()->formatBlock($id, $title, $class, $content);
     } else {
         return $content;
     }
 }
Пример #3
0
/**
 * Defined in session.php
 *
 * @global Tree $WT_TREE
 */
global $WT_TREE;
use Fisharebest\Webtrees\Controller\AncestryController;
use Fisharebest\Webtrees\Functions\FunctionsCharts;
use Fisharebest\Webtrees\Functions\FunctionsEdit;
use Fisharebest\Webtrees\Functions\FunctionsPrint;
use Fisharebest\Webtrees\Functions\FunctionsPrintLists;
define('WT_SCRIPT_NAME', 'ancestry.php');
require './includes/session.php';
$MAX_PEDIGREE_GENERATIONS = $WT_TREE->getPreference('MAX_PEDIGREE_GENERATIONS');
$controller = new AncestryController();
$controller->restrictAccess(Module::isActiveChart($WT_TREE, 'ancestors_chart'))->pageHeader()->addExternalJavascript(WT_AUTOCOMPLETE_JS_URL)->addInlineJavascript('autocomplete();');
?>
<div id="ancestry-page">
	<h2><?php 
echo $controller->getPageTitle();
?>
</h2>
	<form name="people" id="people" method="get" action="?">
		<input type="hidden" name="ged" value="<?php 
echo $WT_TREE->getNameHtml();
?>
">
		<table class="list_table">
			<tbody>
				<tr>
					<td class="descriptionbox">
Пример #4
0
 */
namespace Fisharebest\Webtrees;

/**
 * Defined in session.php
 *
 * @global Tree $WT_TREE
 */
global $WT_TREE;
use Fisharebest\Webtrees\Controller\PedigreeController;
use Fisharebest\Webtrees\Functions\FunctionsEdit;
use Fisharebest\Webtrees\Functions\FunctionsPrint;
define('WT_SCRIPT_NAME', 'pedigree.php');
require './includes/session.php';
$controller = new PedigreeController();
$controller->restrictAccess(Module::isActiveChart($WT_TREE, 'pedigree_chart'))->pageHeader()->addExternalJavascript(WT_AUTOCOMPLETE_JS_URL)->addInlineJavascript('
	(function() {
		autocomplete();

		jQuery("#childarrow").on("click", ".menuselect", function(e) {
			e.preventDefault();
			jQuery("#childbox").slideToggle("fast");
		});

		jQuery("#pedigree_chart")
			.width(' . $controller->chartsize['x'] . ')
			.height(' . $controller->chartsize['y'] . ');

		// Set variables
		var p0, p1, p2,  // Holds the ids of the boxes used in the join calculations
			canvas       = jQuery("#pedigree_canvas"),
Пример #5
0
 /**
  * A link to the user's individual record.
  *
  * @return Menu|null
  */
 protected function menuMyPedigree()
 {
     $gedcomid = $this->tree->getUserPreference(Auth::user(), 'gedcomid');
     if ($gedcomid && Module::isActiveChart($this->tree, 'pedigree_chart')) {
         $showFull = $this->tree->getPreference('PEDIGREE_FULL_DETAILS') ? 1 : 0;
         $showLayout = $this->tree->getPreference('PEDIGREE_LAYOUT') ? 1 : 0;
         return new Menu(I18N::translate('My pedigree'), 'pedigree.php?' . $this->tree_url . '&amp;rootid=' . $gedcomid . '&amp;show_full=' . $showFull . '&amp;talloffset=' . $showLayout, 'menu-mypedigree');
     } else {
         return null;
     }
 }
Пример #6
0
 * 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, see <http://www.gnu.org/licenses/>.
 */
namespace Fisharebest\Webtrees;

use Fisharebest\Webtrees\Controller\LifespanController;
use Fisharebest\Webtrees\Functions\FunctionsPrint;
define('WT_SCRIPT_NAME', 'lifespan.php');
require './includes/session.php';
global $WT_TREE;
$controller = new LifespanController();
$controller->restrictAccess(Module::isActiveChart($WT_TREE, 'lifespans_chart'))->pageHeader()->addExternalJavascript(WT_AUTOCOMPLETE_JS_URL);
?>
<div id="lifespan-page">
	<h2><?php 
echo I18N::translate('Lifespans');
?>
</h2>

	<form>
		<table class="list_table">
			<tbody>
				<tr>
					<th class="descriptionbox" colspan="4">
						<?php 
echo I18N::translate('Select individuals by place or date');
?>
Пример #7
0
use Fisharebest\Webtrees\Functions\FunctionsEdit;
use Fisharebest\Webtrees\Functions\FunctionsPrint;
use Fisharebest\Webtrees\Module\RelationshipsChartModule;
define('WT_SCRIPT_NAME', 'relationship.php');
require './includes/session.php';
$max_recursion = $WT_TREE->getPreference('RELATIONSHIP_RECURSION', RelationshipsChartModule::DEFAULT_RECURSION);
$ancestors_only = $WT_TREE->getPreference('RELATIONSHIP_ANCESTORS', RelationshipsChartModule::DEFAULT_ANCESTORS);
$controller = new RelationshipController();
$pid1 = Filter::get('pid1', WT_REGEX_XREF);
$pid2 = Filter::get('pid2', WT_REGEX_XREF);
$show_full = Filter::getInteger('show_full', 0, 1, $WT_TREE->getPreference('PEDIGREE_FULL_DETAILS'));
$recursion = Filter::getInteger('recursion', 0, $max_recursion, 0);
$ancestors = Filter::getInteger('ancestors', 0, 1, 0);
$person1 = Individual::getInstance($pid1, $WT_TREE);
$person2 = Individual::getInstance($pid2, $WT_TREE);
$controller->restrictAccess(Module::isActiveChart($WT_TREE, 'relationships_chart'))->addExternalJavascript(WT_AUTOCOMPLETE_JS_URL)->addInlineJavascript('autocomplete();');
if ($person1 && $person2) {
    $controller->setPageTitle(I18N::translate('Relationships between %1$s and %2$s', $person1->getFullName(), $person2->getFullName()))->pageHeader();
    $paths = $controller->calculateRelationships($person1, $person2, $recursion, (bool) $ancestors);
} else {
    $controller->setPageTitle(I18N::translate('Relationships'))->pageHeader();
    $paths = array();
}
?>
<h2><?php 
echo $controller->getPageTitle();
?>
</h2>
<form name="people" method="get" action="?">
	<input type="hidden" name="ged" value="<?php 
echo $WT_TREE->getNameHtml();
Пример #8
0
 * Defined in session.php
 *
 * @global Tree $WT_TREE
 */
global $WT_TREE;
use Fisharebest\Webtrees\Controller\AjaxController;
use Fisharebest\Webtrees\Controller\PageController;
use Fisharebest\Webtrees\Functions\FunctionsPrint;
define('WT_SCRIPT_NAME', 'statistics.php');
require './includes/session.php';
// check for on demand content loading
$tab = Filter::getInteger('tab', 0, 3);
$ajax = Filter::getBool('ajax');
if (!$ajax) {
    $controller = new PageController();
    $controller->restrictAccess(Module::isActiveChart($WT_TREE, 'statistics_chart'))->setPageTitle(I18N::translate('Statistics'))->addExternalJavascript(WT_AUTOCOMPLETE_JS_URL)->addInlineJavascript('
			jQuery("#statistics_chart").css("visibility", "visible");
			jQuery("#statistics_chart").tabs({
				load: function() {
					jQuery("#loading-indicator").removeClass("loading-image");
				},
				beforeLoad: function(event, ui) {
					// Only load each tab once
					if (ui.tab.data("loaded")) {
						event.preventDefault();
						return;
					}
					else {
						jQuery("#loading-indicator").addClass("loading-image");
					}
					ui.jqXHR.success(function() {