示例#1
0
use WT\Auth;
define('WT_SCRIPT_NAME', 'index_edit.php');
require './includes/session.php';
$controller = new WT_Controller_Ajax();
// Only one of $user_id and $gedcom_id should be set
$user_id = WT_Filter::get('user_id', WT_REGEX_INTEGER, WT_Filter::post('user_id', WT_REGEX_INTEGER));
if ($user_id) {
    $gedcom_id = null;
} else {
    $gedcom_id = WT_Filter::get('gedcom_id', WT_REGEX_INTEGER, WT_Filter::post('gedcom_id', WT_REGEX_INTEGER));
}
// Only an admin can edit the "default" page
// Only managers can edit the "home page"
// Only a user or an admin can edit a user’s "my page"
if ($gedcom_id < 0 && !Auth::isAdmin() || $gedcom_id > 0 && !Auth::isManager(WT_Tree::get($gedcom_id)) || $user_id && Auth::id() != $user_id && !Auth::isAdmin()) {
    $controller->pageHeader();
    $controller->addInlineJavascript('window.location.reload();');
    exit;
}
$action = WT_Filter::get('action');
if (isset($_REQUEST['main'])) {
    $main = $_REQUEST['main'];
} else {
    $main = array();
}
if (isset($_REQUEST['right'])) {
    $right = $_REQUEST['right'];
} else {
    $right = array();
}
// Define all the icons we're going to use
示例#2
0
// webtrees: Web based Family History software
// 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
// 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
use WT\Auth;
define('WT_SCRIPT_NAME', 'admin_trees_export.php');
require './includes/session.php';
$controller = new WT_Controller_Ajax();
$controller->pageHeader()->restrictAccess(Auth::isManager());
$filename = WT_DATA_DIR . $WT_TREE->tree_name;
// Force a ".ged" suffix
if (strtolower(substr($filename, -4)) != '.ged') {
    $filename .= '.ged';
}
if ($WT_TREE->exportGedcom($filename)) {
    echo '<p>', WT_I18N::translate('Family tree exported to %s.', '<span dir="ltr">' . $filename . '</span>'), '</p>';
} else {
    echo '<p class="error">', WT_I18N::translate('Unable to create %s.  Check the permissions.', $filename), '</p>';
}
示例#3
0
            WT_FlashMessages::addMessage(WT_I18N::translate('The file %s was deleted.', $tmp));
        } else {
            WT_FlashMessages::addMessage(WT_I18N::translate('The file %s could not be deleted.', $tmp));
        }
        $tmp = WT_DATA_DIR . $media_folder . 'thumbs/' . $delete_file;
        if (file_exists($tmp)) {
            if (@unlink($tmp)) {
                WT_FlashMessages::addMessage(WT_I18N::translate('The file %s was deleted.', $tmp));
            } else {
                WT_FlashMessages::addMessage(WT_I18N::translate('The file %s could not be deleted.', $tmp));
            }
        }
    } else {
        // File no longer exists?  Maybe it was already deleted or renamed.
    }
    $controller->pageHeader();
    exit;
}
////////////////////////////////////////////////////////////////////////////////
// GET callback for server-side pagination
////////////////////////////////////////////////////////////////////////////////
switch ($action) {
    case 'load_json':
        Zend_Session::writeClose();
        $search = WT_Filter::get('search');
        $search = $search['value'];
        $start = WT_Filter::getInteger('start');
        $length = WT_Filter::getInteger('length');
        switch ($files) {
            case 'local':
                // Filtered rows
示例#4
0
					jQuery("#loading-indicator").addClass("loading-image");
					// Only load each tab once
					if (ui.tab.data("loaded")) {
						event.preventDefault();
						return;
					}
					ui.jqXHR.success(function() {
						ui.tab.data("loaded", true);
					});
				}
			});
		')->pageHeader();
    echo '<div id="statistics-page"><h2>', WT_I18N::translate('Statistics'), '</h2>', '<div id="statistics_chart">', '<ul>', '<li><a href="statistics.php?ged=', WT_GEDURL, '&amp;ajax=1&amp;tab=0">', '<span id="stats-indi">', WT_I18N::translate('Individuals'), '</span></a></li>', '<li><a href="statistics.php?ged=', WT_GEDURL, '&amp;ajax=1&amp;tab=1">', '<span id="stats-fam">', WT_I18N::translate('Families'), '</span></a></li>', '<li><a href="statistics.php?ged=', WT_GEDURL, '&amp;ajax=1&amp;tab=2">', '<span id="stats-other">', WT_I18N::translate('Others'), '</span></a></li>', '<li><a href="statistics.php?ged=', WT_GEDURL, '&amp;ajax=1&amp;tab=3">', '<span id="stats-own">', WT_I18N::translate('Own charts'), '</span></a></li>', '</ul>', '<div id="loading-indicator" style="margin:auto;width:100%;"></div>', '</div>', '</div>', '<br><br>';
} else {
    $controller = new WT_Controller_Ajax();
    $controller->pageHeader()->addInlineJavascript('autocomplete();')->addInlineJavascript('jQuery("#loading-indicator").removeClass("loading-image");');
    $stats = new WT_Stats($GEDCOM);
    if ($tab == 0) {
        echo '<fieldset>
		<legend>', WT_I18N::translate('Total individuals: %s', $stats->totalIndividuals()), '</legend>
		<table class="facts_table">
			<tr>
				<td class="facts_label">', WT_I18N::translate('Total males'), '</td>
				<td class="facts_label">', WT_I18N::translate('Total females'), '</td>
				<td class="facts_label">', WT_I18N::translate('Total living'), '</td>
				<td class="facts_label">', WT_I18N::translate('Total dead'), '</td>
			</tr>
			<tr>
				<td class="facts_value" align="center">', $stats->totalSexMales(), '</td>
				<td class="facts_value" align="center">', $stats->totalSexFemales(), '</td>
				<td class="facts_value" align="center">', $stats->totalLiving(), '</td>