コード例 #1
0
ファイル: admin_users.php プロジェクト: brambravo/webtrees
        $controller->addInlineJavascript('
		function checkform(frm) {
			if (frm.username.value=="") {
				alert("' . WT_I18N::translate('You must enter a user name.') . '");
				frm.username.focus();
				return false;
			}
			if (frm.realname.value=="") {
				alert("' . WT_I18N::translate('You must enter a real name.') . '");
				frm.realname.focus();
				return false;
			}
			if (frm.pass1.value=="") {
				alert("' . WT_I18N::translate('You must enter a password.') . '");
				frm.pass1.focus();
				return false;
			}
			if (frm.emailaddress.value=="") {
				alert("' . WT_I18N::translate('You must enter an email address.') . '");
				frm.emailaddress.focus();
				return false;
			}
			if (frm.pass2.value=="") {
				alert("' . WT_I18N::translate('You must confirm the password.') . '");
				frm.pass2.focus();
				return false;
			}
			if (frm.pass1.value.length < 6) {
				alert("' . WT_I18N::translate('Passwords must contain at least 6 characters.') . '");
				frm.pass1.value = "";
				frm.pass2.value = "";
				frm.pass1.focus();
				return false;
			}
			return true;
		}
		jQuery(".relpath").change(function() {
			var fieldIDx = jQuery(this).attr("id");
			var idNum = fieldIDx.replace("RELATIONSHIP_PATH_LENGTH","");
			var newIDx = "gedcomid"+idNum;
			if (jQuery("#"+newIDx).val()=="") {
				alert("' . WT_I18N::translate('You must specify an individual record before you can restrict the user to their immediate family.') . '");
				jQuery(this).val("");
			}
		});

		function regex_quote(str) {
			return str.replace(/[\\\\.?+*()[\\](){}|]/g, "\\\\$&");
		}
	');
コード例 #2
0
ファイル: placelist.php プロジェクト: sadr110/webtrees
 $myfamlist = array();
 $positions = WT_DB::prepare("SELECT DISTINCT pl_gid FROM `##placelinks` WHERE pl_p_id=? AND pl_file=?")->execute(array($place_id, WT_GED_ID))->fetchOneColumn();
 foreach ($positions as $position) {
     $record = WT_GedcomRecord::getInstance($position);
     if ($record && $record->canShow()) {
         if ($record instanceof WT_Individual) {
             $myindilist[] = $record;
         }
         if ($record instanceof WT_Family) {
             $myfamlist[] = $record;
         }
     }
 }
 echo '<br>';
 //-- display results
 $controller->addInlineJavascript('jQuery("#places-tabs").tabs();')->addInlineJavascript('jQuery("#places-tabs").css("visibility", "visible");')->addInlineJavascript('jQuery(".loading-image").css("display", "none");');
 echo '<div class="loading-image">&nbsp;</div>';
 echo '<div id="places-tabs"><ul>';
 if ($myindilist) {
     echo '<li><a href="#places-indi"><span id="indisource">', WT_I18N::translate('Individuals'), '</span></a></li>';
 }
 if ($myfamlist) {
     echo '<li><a href="#places-fam"><span id="famsource">', WT_I18N::translate('Families'), '</span></a></li>';
 }
 echo '</ul>';
 if ($myindilist) {
     echo '<div id="places-indi">', format_indi_table($myindilist), '</div>';
 }
 if ($myfamlist) {
     echo '<div id="places-fam">', format_fam_table($myfamlist), '</div>';
 }
コード例 #3
0
        echo WT_I18N::translate('If you have created media objects in webtrees, and have edited your gedcom off-line using a program that deletes media objects, then check this box to merge the current media objects with the new GEDCOM.');
        echo '<br><br><input type="submit" value="', WT_I18N::translate('continue'), '">';
        echo '</form>';
        exit;
}
// List the gedcoms available to this user
foreach (WT_Tree::GetAll() as $tree) {
    if (Auth::isManager($tree)) {
        echo '<table class="gedcom_table">', '<tr><th>', WT_I18N::translate('Family tree'), '</th><th><a class="accepted" href="index.php?ctype=gedcom&amp;ged=', $tree->tree_name_url, '" dir="auto">', $tree->tree_title_html, '</a>', '</th></tr><tr><th class="accepted">', $tree->tree_name_html, '</th><td>';
        // The third row shows an optional progress bar and a list of maintenance options
        $importing = WT_DB::prepare("SELECT 1 FROM `##gedcom_chunk` WHERE gedcom_id=? AND imported=0 LIMIT 1")->execute(array($tree->tree_id))->fetchOne();
        if ($importing) {
            $in_progress = WT_DB::prepare("SELECT 1 FROM `##gedcom_chunk` WHERE gedcom_id=? AND imported=1 LIMIT 1")->execute(array($tree->tree_id))->fetchOne();
            if (!$in_progress) {
                echo '<div id="import', $tree->tree_id, '"><div id="progressbar', $tree->tree_id, '"><div style="position:absolute;">', WT_I18N::translate('Deleting old genealogy data…'), '</div></div></div>';
                $controller->addInlineJavascript('jQuery("#progressbar' . $tree->tree_id . '").progressbar({value: 0});');
            } else {
                echo '<div id="import', $tree->tree_id, '"></div>';
            }
            $controller->addInlineJavascript('jQuery("#import' . $tree->tree_id . '").load("import.php?gedcom_id=' . $tree->tree_id . '&keep_media' . $tree->tree_id . '=' . WT_Filter::get('keep_media' . $tree->tree_id) . '");');
            echo '<table border="0" width="100%" id="actions', $tree->tree_id, '" style="display:none">';
        } else {
            echo '<table border="0" width="100%" id="actions', $tree->tree_id, '">';
        }
        echo '<tr align="center">', '<td><a href="admin_trees_export.php?ged=', $tree->tree_name_url, '" onclick="return modalDialog(\'admin_trees_export.php?ged=', $tree->tree_name_url, '\', \'', WT_I18N::translate('Export'), '\');">', WT_I18N::translate('Export'), '</a>', help_link('export_gedcom'), '</td>', '<td><a href="', WT_SCRIPT_NAME, '?action=importform&amp;gedcom_id=', $tree->tree_id, '">', WT_I18N::translate('Import'), '</a>', help_link('import_gedcom'), '</td>', '<td><a href="admin_trees_download.php?ged=', $tree->tree_name_url, '">', WT_I18N::translate('Download'), '</a>', help_link('download_gedcom'), '</td>', '<td><a href="', WT_SCRIPT_NAME, '?action=uploadform&amp;gedcom_id=', $tree->tree_id, '">', WT_I18N::translate('Upload'), '</a>', help_link('upload_gedcom'), '</td>', '<td>', '<a href="#" onclick="if (confirm(\'' . WT_Filter::escapeJs(WT_I18N::translate('Are you sure you want to delete “%s”?', $tree->tree_name)), '\')) document.delete_form', $tree->tree_id, '.submit(); return false;">', WT_I18N::translate('Delete'), '</a>', '<form name="delete_form', $tree->tree_id, '" method="post" action="', WT_SCRIPT_NAME, '">', '<input type="hidden" name="action" value="delete">', '<input type="hidden" name="gedcom_id" value="', $tree->tree_id, '">', WT_Filter::getCsrf(), '</form>', '</td></tr></table></td></tr></table><br>';
    }
}
// Options for creating new gedcoms and setting defaults
if (Auth::isAdmin()) {
    echo '<table class="gedcom_table2"><tr>';
    if (count(WT_Tree::GetAll()) > 1) {
コード例 #4
0
ファイル: index.php プロジェクト: brambravo/webtrees
if ($blocks['main']) {
    if ($blocks['side']) {
        echo '<div id="index_main_blocks">';
    } else {
        echo '<div id="index_full_blocks">';
    }
    foreach ($blocks['main'] as $block_id => $module_name) {
        $class_name = $module_name . '_WT_Module';
        $module = new $class_name();
        if ($SEARCH_SPIDER || !$module->loadAjax()) {
            // Load the block directly
            $module->getBlock($block_id);
        } else {
            // Load the block asynchronously
            echo '<div id="block_', $block_id, '"><div class="loading-image">&nbsp;</div></div>';
            $controller->addInlineJavascript('jQuery("#block_' . $block_id . '").load("index.php?ctype=' . $ctype . '&action=ajax&block_id=' . $block_id . '");');
        }
    }
    echo '</div>';
}
if ($blocks['side']) {
    if ($blocks['main']) {
        echo '<div id="index_small_blocks">';
    } else {
        echo '<div id="index_full_blocks">';
    }
    foreach ($blocks['side'] as $block_id => $module_name) {
        $class_name = $module_name . '_WT_Module';
        $module = new $class_name();
        if ($SEARCH_SPIDER || !$module->loadAjax()) {
            // Load the block directly
コード例 #5
0
                if ($fav_count > 0) {
                    echo '<p>', $fav_count, ' ', WT_I18N::translate('favorites updated.'), '<p>';
                }
                echo '</div>';
            }
        }
    }
}
if ($action == 'choose') {
    $controller->addInlineJavascript('
	function iopen_find(textbox, gedselect) {
		ged = gedselect.options[gedselect.selectedIndex].value;
		findIndi(textbox, null, ged);
	}
	function fopen_find(textbox, gedselect) {
		ged = gedselect.options[gedselect.selectedIndex].value;
		findFamily(textbox, ged);
	}
	function sopen_find(textbox, gedselect) {
		ged = gedselect.options[gedselect.selectedIndex].value;
		findSource(textbox, null, ged);
	}
	');
    echo '<div id="merge"><h3>', WT_I18N::translate('Merge records'), '</h3>
		<form method="post" name="merge" action="admin_site_merge.php">
		<input type="hidden" name="action" value="select">
		<p>', WT_I18N::translate('Select two GEDCOM records to merge.  The records must be of the same type.'), '</p>
		<table><tr>
		<td>', WT_I18N::translate('Merge to ID:'), '</td><td>
		<select name="ged" tabindex="4" onchange="jQuery(\'#gid1\').data(\'autocomplete-ged\', jQuery(this).val());"';
    if (count(WT_Tree::getAll()) == 1) {
        echo 'style="width:1px;visibility:hidden;"';
コード例 #6
0
ファイル: relationship.php プロジェクト: brambravo/webtrees
                        echo '<i class="', $arrow_img, '"></i>';
                        if ($lh == 3) {
                            echo '<br>';
                            // note: $lh==3 means horiz arrow
                        }
                        echo WT_I18N::translate($node['relations'][$index]);
                    }
                    echo '</div>';
                }
                // Determine the z-index for this box
                $zIndex = 200 - ($colNum * $depth + $rowNum);
                echo '<div style="position:absolute; ', $TEXT_DIRECTION == 'ltr' ? 'left' : 'right', ':', $pxoffset, 'px; top:', $pyoffset, 'px; width:', $Dbwidth, 'px; height:', $Dbheight, 'px; z-index:', $zIndex, ';">';
                print_pedigree_person($person, 1);
                echo '</div>';
            }
        }
        echo '</div>';
        // close#relationship_chart
    }
}
echo '</div>';
// close #relationshippage
// The contents of <div id="relationship_chart"> use relative positions.
// Need to expand the div to include the children, or we'll overlap the footer.
// $maxyoffset is the top edge of the lowest box.
$controller->addInlineJavascript('
		relationship_chart_div = document.getElementById("relationship_chart");
		if (relationship_chart_div) {
			relationship_chart_div.style.height = "' . ($maxyoffset + $Dbheight + 20) . 'px";
			relationship_chart_div.style.width = "100%";
		}');