Esempio n. 1
0
 function init()
 {
     // Cannot edit with a "remember me" login.
     if ($_SESSION["cookie_login"]) {
         header('Location: ' . encode_url("login.php?type=simple&url=" . urlencode("edit_interface.php?" . decode_url($QUERY_STRING)), false));
         exit;
     }
     // Coming soon ???
     $this->has_familysearch = file_exists('modules/FamilySearch/familySearchWrapper.php');
     if ($this->has_familysearch) {
         require_once 'modules/FamilySearch/familySearchWrapper.php';
     }
     // The PID can come from a URL or a form
     $this->pid = safe_REQUEST($_REQUEST, 'pid', PGV_REGEX_XREF);
     $this->person = Person::getInstance($this->pid);
     $this->server_list = get_server_list();
     $this->gedcom_list = get_all_gedcoms();
     unset($this->gedcom_list[PGV_GED_ID]);
     // Other input values come from the form
     $this->form_txtPID = safe_POST('txtPID', PGV_REGEX_XREF);
     $this->form_cbRelationship = safe_POST('cbRelationship');
     $this->form_location = safe_POST('location');
     $this->form_txtURL = safe_POST('txtURL', PGV_REGEX_URL);
     $this->form_txtTitle = safe_POST('txtTitle', '[^<>"%{};]+');
     $this->form_txtGID = safe_POST('txtGID', $this->gedcom_list);
     $this->form_txtUsername = safe_POST('txtUsername', PGV_REGEX_USERNAME);
     $this->form_txtPassword = safe_POST('txtPassword', PGV_REGEX_PASSWORD);
     $this->form_cbExistingServers = safe_POST('cbExistingServers', array_keys($this->server_list));
     $this->form_txtCB_Title = safe_POST('txtCB_Title', '[^<>"%{};]+');
     $this->form_txtCB_GID = safe_POST('txtCB_GID', $this->gedcom_list);
     $this->form_txtFS_URL = safe_POST('txtFS_URL', PGV_REGEX_URL);
     $this->form_txtFS_Title = safe_POST('txtFS_Title', '[^<>"%{};]+');
     $this->form_txtFS_GID = safe_POST('txtFS_GID', $this->gedcom_list);
     $this->form_txtFS_Username = safe_POST('txtFS_Username', PGV_REGEX_USERNAME);
     $this->form_txtFS_Password = safe_POST('txtFS_Password', PGV_REGEX_PASSWORD);
     if (is_null($this->form_location)) {
         if ($this->server_list) {
             $this->form_location = 'existing';
         } else {
             $this->form_location = 'remote';
         }
     }
 }
Esempio n. 2
0
        print_header($pgv_lang["config_lang_utility"]);
}
print PGV_JS_START;
print "var helpWin;";
print "function showchanges() {";
print "window.location = '" . PGV_SCRIPT_NAME . "';";
print "}";
print "function helpPopup03(which) {";
print "location.href = 'editlang_edit_settings.php?' + which + '&new_shortcut=' + document.new_lang_form.new_shortcut.value;";
print "return false;";
print "}";
print PGV_JS_END;
// Create array with configured languages in gedcoms and users
$configuredlanguages = array();
// Read gedcom configuration and collect language data
foreach (get_all_gedcoms() as $ged_id => $ged_name) {
    require get_config_file($ged_id);
    if (!isset($configuredlanguages["gedcom"][$LANGUAGE][$ged_name])) {
        $configuredlanguages["gedcom"][$LANGUAGE][$ged_name] = true;
    }
}
// Restore the current settings
require get_config_file(PGV_GED_ID);
// Read user configuration and collect language data
foreach (get_all_users() as $user_id => $user_name) {
    if (!isset($configuredlanguages["users"][get_user_setting($user_id, 'language')][$user_id])) {
        $configuredlanguages["users"][get_user_setting($user_id, 'language')][$user_id] = true;
    }
}
// Sort the Language table into localized language name order
foreach ($pgv_language as $key => $value) {
     $GEDFILENAME = basename($path);
 } else {
     $GEDFILENAME = $_FILES['GEDCOMPATH']['name'];
 }
 if ($path == "" || dirname($path) == ".") {
     $upload_path = $INDEX_DIRECTORY;
 } else {
     $upload_path = dirname($path) . "/";
 }
 if (empty($GEDFILENAME)) {
     $GEDFILENAME = $_FILES['GEDCOMPATH']['name'];
 }
 //-- remove any funny characters from uploaded files
 $GEDFILENAME = preg_replace('/[\\+\\&\\%\\$@]/', "_", $GEDFILENAME);
 // NOTE: When uploading a file check if it doesn't exist yet
 if ($action == "replace" || !in_array($GEDFILENAME, get_all_gedcoms()) && !file_exists($upload_path . $GEDFILENAME)) {
     if (move_uploaded_file($_FILES['GEDCOMPATH']['tmp_name'], $upload_path . $GEDFILENAME)) {
         AddToLog("Gedcom " . $path . $GEDFILENAME . " uploaded");
         $GEDCOMPATH = $upload_path . $GEDFILENAME;
     } else {
         $error = print_text("upload_error", 0, 1) . "<br />" . file_upload_error_text($_FILES['GEDCOMPATH']['error']);
         $action = "upload_form";
     }
 } else {
     // NOTE: If the file exists we will make a backup file
     if (move_uploaded_file($_FILES['GEDCOMPATH']['tmp_name'], $upload_path . $GEDFILENAME . ".bak")) {
         $bakfile = $upload_path . $GEDFILENAME . ".bak";
         $GEDCOMPATH = $upload_path . $GEDFILENAME;
     } else {
         $error = print_text("upload_error", 0, 1) . "<br />" . file_upload_error_text($_FILES['GEDCOMPATH']['error']);
         $action = "upload_form";
Esempio n. 4
0
function AddToSearchLog($LogString, $allgeds)
{
    global $INDEX_DIRECTORY, $SEARCHLOG_CREATE, $GEDCOM, $username;
    if (!isset($allgeds)) {
        return;
    }
    if (count($allgeds) == 0) {
        return;
    }
    //-- do not allow code to be written to the log file
    $LogString = preg_replace("/<\\?.*\\?>/", "*** CODE DETECTED ***", $LogString);
    $oldged = $GEDCOM;
    foreach ($allgeds as $indexval => $value) {
        $GEDCOM = $value;
        include get_config_file();
        if ($SEARCHLOG_CREATE != "none") {
            $REMOTE_ADDR = $_SERVER['REMOTE_ADDR'];
            if (empty($SEARCHLOG_CREATE)) {
                $SEARCHLOG_CREATE = "daily";
            }
            if ($SEARCHLOG_CREATE == "daily") {
                $logfile = $INDEX_DIRECTORY . "srch-" . $GEDCOM . date("Ymd") . ".log";
            }
            if ($SEARCHLOG_CREATE == "weekly") {
                $logfile = $INDEX_DIRECTORY . "srch-" . $GEDCOM . date("Ym") . "-week" . date("W") . ".log";
            }
            if ($SEARCHLOG_CREATE == "monthly") {
                $logfile = $INDEX_DIRECTORY . "srch-" . $GEDCOM . date("Ym") . ".log";
            }
            if ($SEARCHLOG_CREATE == "yearly") {
                $logfile = $INDEX_DIRECTORY . "srch-" . $GEDCOM . date("Y") . ".log";
            }
            if (is_writable($INDEX_DIRECTORY)) {
                $logline = "Date / Time: " . date("d.m.Y H:i:s") . " - IP: " . $REMOTE_ADDR . " - User: "******"<br />";
                if (count($allgeds) == count(get_all_gedcoms())) {
                    $logline .= "Searchtype: Global<br />";
                } else {
                    $logline .= "Searchtype: Gedcom<br />";
                }
                $logline .= $LogString . "<br /><br />\r\n";
                $fp = fopen($logfile, "a");
                flock($fp, 2);
                fputs($fp, $logline);
                flock($fp, 3);
                fclose($fp);
            }
        }
    }
    $GEDCOM = $oldged;
    include get_config_file();
}
Esempio n. 5
0
/**
 * Print Review Changes Block
 *
 * Prints a block allowing the user review all changes pending approval
 */
function review_changes_block($block = true, $config = "", $side, $index)
{
    global $pgv_lang, $ctype, $QUERY_STRING, $factarray, $PGV_IMAGE_DIR, $PGV_IMAGES;
    global $pgv_changes, $TEXT_DIRECTION, $SHOW_SOURCES, $PGV_BLOCKS;
    global $PHPGEDVIEW_EMAIL;
    if (empty($config)) {
        $config = $PGV_BLOCKS["review_changes_block"]["config"];
    }
    if ($pgv_changes) {
        //-- if the time difference from the last email is greater than 24 hours then send out another email
        $LAST_CHANGE_EMAIL = get_site_setting('LAST_CHANGE_EMAIL');
        if (time() - $LAST_CHANGE_EMAIL > 60 * 60 * 24 * $config["days"]) {
            $LAST_CHANGE_EMAIL = time();
            set_site_setting('LAST_CHANGE_EMAIL', $LAST_CHANGE_EMAIL);
            write_changes();
            if ($config["sendmail"] == "yes") {
                // Which users have pending changes?
                $users_with_changes = array();
                foreach (get_all_users() as $user_id => $user_name) {
                    foreach (get_all_gedcoms() as $ged_id => $ged_name) {
                        if (exists_pending_change($user_id, $ged_id)) {
                            $users_with_changes[$user_id] = $user_name;
                            break;
                        }
                    }
                }
                foreach ($users_with_changes as $user_id => $user_name) {
                    //-- send message
                    $message = array();
                    $message["to"] = $user_name;
                    $message["from"] = $PHPGEDVIEW_EMAIL;
                    $message["subject"] = $pgv_lang["review_changes_subject"];
                    $message["body"] = $pgv_lang["review_changes_body"];
                    $message["method"] = get_user_setting($user_id, 'contactmethod');
                    $message["url"] = PGV_SCRIPT_NAME . "?" . html_entity_decode($QUERY_STRING);
                    $message["no_from"] = true;
                    addMessage($message);
                }
            }
        }
        if (PGV_USER_CAN_EDIT) {
            $id = "review_changes_block";
            $title = print_help_link("review_changes_help", "qm", "", false, true);
            if ($PGV_BLOCKS["review_changes_block"]["canconfig"]) {
                if ($ctype == "gedcom" && PGV_USER_GEDCOM_ADMIN || $ctype == "user" && PGV_USER_ID) {
                    if ($ctype == "gedcom") {
                        $name = PGV_GEDCOM;
                    } else {
                        $name = PGV_USER_NAME;
                    }
                    $title .= "<a href=\"javascript: configure block\" onclick=\"window.open('" . encode_url("index_edit.php?name={$name}&ctype={$ctype}&action=configure&side={$side}&index={$index}") . "', '_blank', 'top=50,left=50,width=600,height=350,scrollbars=1,resizable=1'); return false;\">";
                    $title .= "<img class=\"adminicon\" src=\"{$PGV_IMAGE_DIR}/" . $PGV_IMAGES["admin"]["small"] . "\" width=\"15\" height=\"15\" border=\"0\" alt=\"" . $pgv_lang["config_block"] . "\" /></a>";
                }
            }
            $title .= $pgv_lang["review_changes"];
            $content = "";
            if (PGV_USER_CAN_ACCEPT) {
                $content .= "<a href=\"javascript:;\" onclick=\"window.open('edit_changes.php','_blank','width=600,height=500,resizable=1,scrollbars=1'); return false;\">" . $pgv_lang["accept_changes"] . "</a><br />";
            }
            if ($config["sendmail"] == "yes") {
                $content .= $pgv_lang["last_email_sent"] . format_timestamp($LAST_CHANGE_EMAIL) . "<br />";
                $content .= $pgv_lang["next_email_sent"] . format_timestamp($LAST_CHANGE_EMAIL + 60 * 60 * 24 * $config["days"]) . "<br /><br />";
            }
            foreach ($pgv_changes as $cid => $changes) {
                $change = $changes[count($changes) - 1];
                if ($change["gedcom"] == PGV_GEDCOM) {
                    $record = GedcomRecord::getInstance($change['gid']);
                    if ($record->getType() != 'SOUR' || $SHOW_SOURCES >= PGV_USER_ACCESS_LEVEL) {
                        $content .= '<b>' . PrintReady($record->getFullName()) . '</b> ' . getLRM() . '(' . $record->getXref() . ')' . getLRM();
                        switch ($record->getType()) {
                            case 'INDI':
                            case 'FAM':
                            case 'SOUR':
                            case 'OBJE':
                                $content .= $block ? '<br />' : ' ';
                                $content .= '<a href="' . encode_url($record->getLinkUrl() . '&show_changes=yes') . '">' . $pgv_lang['view_change_diff'] . '</a>';
                                break;
                        }
                        $content .= '<br />';
                    }
                }
            }
            global $THEME_DIR;
            if ($block) {
                require $THEME_DIR . 'templates/block_small_temp.php';
            } else {
                require $THEME_DIR . 'templates/block_main_temp.php';
            }
        }
    }
}
Esempio n. 6
0
 *
 * @package PhpGedView
 * @subpackage Admin
 * @version $Id: downloadgedcom.php 6879 2010-01-30 11:35:46Z fisharebest $
 */
define('PGV_SCRIPT_NAME', 'downloadgedcom.php');
require './config.php';
require_once PGV_ROOT . 'includes/functions/functions_export.php';
// Validate user parameters
if (!isset($_SESSION['exportConvPath'])) {
    $_SESSION['exportConvPath'] = $MEDIA_DIRECTORY;
}
if (!isset($_SESSION['exportConvSlashes'])) {
    $_SESSION['exportConvSlashes'] = 'forward';
}
$ged = safe_GET('ged', get_all_gedcoms());
$action = safe_GET('action', 'download');
$remove = safe_GET('remove', 'yes', 'no');
$convert = safe_GET('convert', 'yes', 'no');
$zip = safe_GET('zip', 'yes', 'no');
$conv_path = safe_GET('conv_path', PGV_REGEX_NOSCRIPT, $_SESSION['exportConvPath']);
$conv_slashes = safe_GET('conv_slashes', array('forward', 'backward'), $_SESSION['exportConvSlashes']);
$privatize_export = safe_GET('privatize_export', array('none', 'visitor', 'user', 'gedadmin', 'admin'));
$filetype = safe_GET('filetype', array('gedcom', 'gramps'));
$conv_path = stripLRMRLM($conv_path);
$_SESSION['exportConvPath'] = $conv_path;
// remember this for the next Download
$_SESSION['exportConvSlashes'] = $conv_slashes;
if (!PGV_USER_GEDCOM_ADMIN || !$ged) {
    header("Location: editgedcoms.php");
    exit;
Esempio n. 7
0
echo '<tr><td class="list_label">', $pgv_lang['show'], '</td>';
echo '<td class="optionbox"><select name="showall">';
echo '<option value="0"', $showall == 0 ? ' selected="selected"' : '', '>', $pgv_lang['err_rec'], '</option>';
echo '<option value="1"', $showall == 1 ? ' selected="selected"' : '', '>', $pgv_lang['all_rec'], '</option>';
echo '</select></td></tr>';
echo '<tr><td colspan="2" class="list_label"><input type="submit" value="', $pgv_lang['show'], '"><input type="hidden" name="action" value="go"></td></tr>';
echo '</table></form><hr />';
// Do not run until user clicks "show", as default page may take a while to load.
// Instead, show some useful help info.
if (!isset($_POST['action'])) {
    echo '<p>', $pgv_lang['gedcheck_text'], '</p><hr />';
    print_footer();
    exit;
}
// If we're checking a gedcom that is imported into the database, check that the file is synchronised
if (in_array($ged, get_all_gedcoms())) {
    require get_config_file($ged);
    if (!$SYNC_GEDCOM_FILE && ($ged = $GEDCOM)) {
        $ged_link = 'href="javascript:" onclick="window.open(\'' . encode_url("export_gedcom.php?export={$ged}") . '\', \'_blank\',\'left=50,top=50,width=500,height=500,resizable=1,scrollbars=1\');"';
        echo '<div class="error">', print_text('gedcheck_sync', 0, 1);
        echo '</div><hr/>';
    }
    require get_config_file(PGV_GEDCOM);
}
// Special cases.  Other facts link to themselves; SUBN, SUBN, OBJE, NOTE, REPO, SOUR
$XREF_LINK = array('FAMC' => 'FAM', 'FAMS' => 'FAM', 'HUSB' => 'INDI', 'WIFE' => 'INDI', 'CHIL' => 'INDI', 'ASSO' => 'INDI', 'ALIA' => 'INDI', 'ANCI' => 'SUBM', 'DESI' => 'SUBM', '_PGV_OBJS' => 'OBJE', 'AUTH' => 'INDI');
// Use the global settings for these (if they exist)
if (isset($FAM_FACTS_UNIQUE)) {
    $fam_facts_unique = preg_split('/[, ;:]+/', $FAM_FACTS_UNIQUE, -1, PREG_SPLIT_NO_EMPTY);
} else {
    $fam_facts_unique = array();
Esempio n. 8
0
	}
	//-->
	</script>
	<?php 
    echo "<h2>", $pgv_lang["merge_step1"], "</h2>\n";
    echo "<form method=\"post\" name=\"merge\" action=\"edit_merge.php\">\n";
    echo "<input type=\"hidden\" name=\"action\" value=\"select\" />\n";
    echo $pgv_lang["select_gedcom_records"], "<br />\n";
    echo "\n\t\t<table class=\"list_table, ", $TEXT_DIRECTION, "\">\n\t\t<tr>";
    echo "<td class=\"list_label\">&nbsp;";
    echo $pgv_lang["merge_to"];
    echo "&nbsp;</td><td>";
    echo "<input type=\"text\" id=\"gid1\" name=\"gid1\" value=\"", $gid1, "\" size=\"10\" tabindex=\"1\"/> ";
    echo '<script type="text/javascript">document.getElementById("gid1").focus();</script>';
    echo "<select name=\"ged\" tabindex=\"4\">\n";
    $all_gedcoms = get_all_gedcoms();
    asort($all_gedcoms);
    foreach ($all_gedcoms as $ged_id => $ged_name) {
        echo "<option value=\"", $ged_name, "\"";
        if (empty($ged) && $ged_id == PGV_GED_ID || !empty($ged) && $ged == $ged_name) {
            echo " selected=\"selected\"";
        }
        echo ">", PrintReady(strip_tags(get_gedcom_setting($ged_id, 'title'))), "</option>\n";
    }
    echo "</select>\n";
    echo "<a href=\"javascript:iopen_find(document.merge.gid1, document.merge.ged);\" tabindex=\"6\"> ", $pgv_lang["find_individual"], "</a> |";
    echo " <a href=\"javascript:fopen_find(document.merge.gid1, document.merge.ged);\" tabindex=\"8\"> ", $pgv_lang["find_familyid"], "</a> |";
    echo " <a href=\"javascript:sopen_find(document.merge.gid1, document.merge.ged);\" tabindex=\"10\"> ", $pgv_lang["find_sourceid"], "</a>";
    print_help_link("rootid_help", "qm");
    echo "</td></tr><tr><td class=\"list_label\">&nbsp;";
    echo $pgv_lang["merge_from"];
Esempio n. 9
0
function print_htmlplus_block_config($config)
{
    global $pgv_lang, $factarray, $ctype, $PGV_BLOCKS, $TEXT_DIRECTION, $LANGUAGE, $language_settings, $GEDCOM;
    $useFCK = file_exists(PGV_ROOT . 'modules/FCKeditor/fckeditor.php');
    $templates = array();
    $d = dir('blocks/');
    while (false !== ($entry = $d->read())) {
        if (strstr($entry, 'block_htmlplus_')) {
            $tpl = file("blocks/{$entry}");
            $info = array_shift($tpl);
            $bits = explode('|', $info);
            if (count($bits) != 2) {
                $bits = array($entry, '');
            }
            $templates[] = array('filename' => $entry, 'title' => isset($pgv_lang[$bits[0]]) ? $pgv_lang[$bits[0]] : $bits[0], 'description' => isset($pgv_lang[$bits[1]]) ? $pgv_lang[$bits[1]] : $bits[1], 'template' => htmlspecialchars(join('', $tpl), ENT_COMPAT, 'UTF-8'));
        }
    }
    $d->close();
    // config sanity check
    if (empty($config)) {
        $config = $PGV_BLOCKS['print_htmlplus_block']['config'];
    } else {
        foreach ($PGV_BLOCKS['print_htmlplus_block']['config'] as $k => $v) {
            if (!isset($config[$k])) {
                $config[$k] = $v;
            }
        }
    }
    // title
    $config['title'] = htmlentities($config['title'], ENT_COMPAT, 'UTF-8');
    print "\t<tr>\n\t\t<td class=\"descriptionbox wrap width33\">" . print_help_link('index_htmlplus_title_help', 'qm_ah', '', false, true) . "{$factarray['TITL']}</td>\n" . "\t\t<td class=\"optionbox\"><input type=\"text\" name=\"title\" size=\"30\" value=\"{$config['title']}\" /></td>\n\t</tr>\n";
    // templates
    print "\t<tr>\n\t\t<td class=\"descriptionbox wrap width33\">" . print_help_link('index_htmlplus_template_help', 'qm_ah', '', false, true) . "{$pgv_lang['htmlplus_block_templates']}</td>\n" . "\t\t<td class=\"optionbox\">\n";
    if ($useFCK) {
        print "\t\t\t<script language=\"JavaScript\" type=\"text/javascript\">\n" . "\t\t\t<!--\n" . "\t\t\t\tfunction loadTemplate(html)\n" . "\t\t\t\t{\n" . "\t\t\t\t\tvar oEditor = FCKeditorAPI.GetInstance('html');\n" . "\t\t\t\t\toEditor.SetHTML(html);\n" . "\t\t\t\t}\n" . "\t\t\t-->\n" . "\t\t\t</script>\n" . "\t\t\t<select name=\"template\" onchange=\"loadTemplate(document.block.template.options[document.block.template.selectedIndex].value);\">\n";
    } else {
        print "\t\t\t<select name=\"template\" onchange=\"document.block.html.value=document.block.template.options[document.block.template.selectedIndex].value;\">\n";
    }
    print "\t\t\t\t<option value=\"\">{$pgv_lang['htmlplus_block_custom']}</option>\n";
    foreach ($templates as $tpl) {
        print "\t\t\t\t<option value=\"{$tpl['template']}\">{$tpl['title']}</option>\n";
    }
    print "\t\t\t</select>\n" . "\t\t</td>\n\t</tr>\n";
    // gedcom
    $gedcoms = get_all_gedcoms();
    if (count($gedcoms) > 1) {
        if ($config['gedcom'] == '__current__') {
            $sel_current = ' selected="selected"';
        } else {
            $sel_current = '';
        }
        if ($config['gedcom'] == '__default__') {
            $sel_default = ' selected="selected"';
        } else {
            $sel_default = '';
        }
        print "\t<tr>\n\t\t<td class=\"descriptionbox wrap width33\">" . print_help_link('index_htmlplus_gedcom_help', 'qm_ah', '', false, true) . "{$pgv_lang['htmlplus_block_gedcom']}</td>\n" . "\t\t<td class=\"optionbox\">\n" . "\t\t\t<select name=\"gedcom\">\n" . "\t\t\t\t<option value=\"__current__\"{$sel_current}>{$pgv_lang['htmlplus_block_current']}</option>\n" . "\t\t\t\t<option value=\"__default__\"{$sel_default}>{$pgv_lang['htmlplus_block_default']}</option>\n";
        foreach ($gedcoms as $ged_id => $ged_name) {
            if ($ged_name == $config['gedcom']) {
                $sel = ' selected="selected"';
            } else {
                $sel = '';
            }
            print "\t\t\t\t<option value=\"{$ged_name}\"{$sel}>" . PrintReady(get_gedcom_setting($ged_id, 'title')) . "</option>\n";
        }
        print "\t\t\t</select>\n" . "\t\t</td>\n\t</tr>\n";
    }
    // html
    print "\t<tr>\n\t\t<td class=\"descriptionbox wrap width33\">\n" . print_help_link('index_htmlplus_content_help', 'qm_ah', '', false, true) . "{$pgv_lang['htmlplus_block_content']}<br />\n\t\t\t<br />\n" . "\t\t</td>\n" . "\t\t<td class=\"optionbox\">\n\t\t\t";
    if ($useFCK) {
        // use FCKeditor module
        require_once PGV_ROOT . 'modules/FCKeditor/fckeditor.php';
        $oFCKeditor = new FCKeditor('html');
        $oFCKeditor->BasePath = './modules/FCKeditor/';
        $oFCKeditor->Value = $config['html'];
        $oFCKeditor->Width = 700;
        $oFCKeditor->Height = 250;
        $oFCKeditor->Config['AutoDetectLanguage'] = false;
        $oFCKeditor->Config['DefaultLanguage'] = $language_settings[$LANGUAGE]['lang_short_cut'];
        $oFCKeditor->Create();
    } else {
        //use standard textarea
        print "<textarea name=\"html\" rows=\"10\" cols=\"80\">" . str_replace("<", "&lt;", $config['html']) . "</textarea>";
    }
    print "\n\t\t</td>\n\t</tr>\n";
    // compatibility mode
    if ($config['compat'] == 1) {
        $compat = ' checked="checked"';
    } else {
        $compat = '';
    }
    print "\t<tr>\n\t\t<td class=\"descriptionbox wrap width33\">" . print_help_link('index_htmlplus_compat_help', 'qm_ah', '', false, true) . "{$pgv_lang['htmlplus_block_compat']}</td>\n" . "\t\t<td class=\"optionbox\"><input type=\"checkbox\" name=\"compat\" value=\"1\"{$compat} /></td>\n" . "\t</tr>\n";
    // extended features
    if ($config['ui'] == 1) {
        $ui = ' checked="checked"';
    } else {
        $ui = '';
    }
    print "\t<tr>\n\t\t<td class=\"descriptionbox wrap width33\">" . print_help_link('index_htmlplus_ui_help', 'qm_ah', '', false, true) . "{$pgv_lang['htmlplus_block_ui']}</td>\n" . "\t\t<td class=\"optionbox\"><input type=\"checkbox\" name=\"ui\" value=\"1\"{$ui} /></td>\n" . "\t</tr>\n";
    // Cache file life
    if ($ctype == 'gedcom') {
        print "\t<tr>\n\t\t<td class=\"descriptionbox wrap width33\">" . print_help_link('cache_life_help', 'qm', '', false, true) . "{$pgv_lang['cache_life']}</td>\n" . "\t\t<td class=\"optionbox\">" . "<input type=\"text\" name=\"cache\" size=\"2\" value=\"{$config['cache']}\" /></td>\n" . "\t</tr>\n";
    }
}
Esempio n. 10
0
 /**
  * get the menu for the lists
  * @return Menu the menu item
  */
 static function &getListsMenu($surname = "")
 {
     global $TEXT_DIRECTION, $PGV_IMAGE_DIR, $PGV_IMAGES, $GEDCOM, $pgv_lang;
     global $SHOW_SOURCES, $MULTI_MEDIA, $SEARCH_SPIDER;
     global $ALLOW_CHANGE_GEDCOM;
     if ($TEXT_DIRECTION == "rtl") {
         $ff = "_rtl";
     } else {
         $ff = "";
     }
     if (!empty($SEARCH_SPIDER)) {
         // Only want the indi list for search engines.
         //-- main lists menu item
         $link = "indilist.php?ged={$GEDCOM}";
         if ($surname) {
             $link .= "&surname={$surname}";
             $menu = new Menu($pgv_lang["lists"], encode_url($link));
             if (!empty($PGV_IMAGES["indis"]["small"])) {
                 $menu->addIcon($PGV_IMAGE_DIR . "/" . $PGV_IMAGES["indis"]["small"]);
             }
             $menu->addClass("menuitem{$ff}", "menuitem_hover{$ff}", "submenu{$ff}", "icon_small_indis");
         } else {
             $menu = new Menu($pgv_lang["lists"], encode_url($link), "down");
             if (!empty($PGV_IMAGES["indis"]["large"])) {
                 $menu->addIcon($PGV_IMAGE_DIR . "/" . $PGV_IMAGES["indis"]["large"]);
             }
             $menu->addClass("menuitem{$ff}", "menuitem_hover{$ff}", "submenu{$ff}", "icon_large_indis");
         }
         //-- gedcom list
         if ($ALLOW_CHANGE_GEDCOM) {
             foreach (get_all_gedcoms() as $ged_id => $gedcom) {
                 $submenu = new Menu($pgv_lang["individual_list"] . " - " . PrintReady(get_gedcom_setting($ged_id, 'title')), encode_url('indilist.php?ged=' . $gedcom));
                 if (!empty($PGV_IMAGES["gedcom"]["small"])) {
                     $submenu->addIcon($PGV_IMAGE_DIR . "/" . $PGV_IMAGES["gedcom"]["small"]);
                 }
                 $submenu->addClass("submenuitem{$ff}", "submenuitem_hover{$ff}", "", "icon_small_gedcom");
                 $menu->addSubmenu($submenu);
             }
         }
         return $menu;
     }
     //-- main lists menu item
     $link = "indilist.php?ged=" . $GEDCOM;
     if ($surname) {
         $link .= "&surname=" . $surname;
         $menu = new Menu($pgv_lang["lists"], encode_url($link));
         if (!empty($PGV_IMAGES["indis"]["small"])) {
             $menu->addIcon($PGV_IMAGE_DIR . "/" . $PGV_IMAGES["indis"]["small"]);
         }
         $menu->addClass("submenuitem{$ff}", "submenuitem_hover{$ff}", "submenu{$ff}", "icon_small_indis");
     } else {
         $menu = new Menu($pgv_lang["lists"], $link, "down");
         if (!empty($PGV_IMAGES["indis"]["large"])) {
             $menu->addIcon($PGV_IMAGE_DIR . "/" . $PGV_IMAGES["indis"]["large"]);
         }
         $menu->addClass("menuitem{$ff}", "menuitem_hover{$ff}", "submenu{$ff}", "icon_large_indis");
     }
     // Build a sortable list of submenu items and then sort it in localized name order
     $menuList = array();
     $menuList["individual"] = $pgv_lang["individual_list"];
     if (file_exists("famlist.php")) {
         $menuList["family"] = $pgv_lang["family_list"];
     }
     if (file_exists("branches.php")) {
         $menuList["branches"] = $pgv_lang["branch_list"];
     }
     if (!$surname && file_exists("sourcelist.php") && $SHOW_SOURCES >= PGV_USER_ACCESS_LEVEL) {
         $menuList["source"] = $pgv_lang["source_list"];
     }
     if (!$surname && file_exists("notelist.php") && $SHOW_SOURCES >= PGV_USER_ACCESS_LEVEL) {
         $menuList["note"] = $pgv_lang["shared_note_list"];
     }
     if (!$surname && file_exists("repolist.php")) {
         $menuList["repository"] = $pgv_lang["repo_list"];
     }
     if (!$surname && file_exists("placelist.php")) {
         $menuList["places"] = $pgv_lang["place_list"];
     }
     if (!$surname && file_exists("medialist.php") && $MULTI_MEDIA) {
         $menuList["media"] = $pgv_lang["media_list"];
     }
     asort($menuList);
     // Produce the submenus in localized name order
     foreach ($menuList as $menuType => $menuName) {
         switch ($menuType) {
             case "individual":
                 //-- indi list sub menu
                 $link = "indilist.php?ged=" . $GEDCOM;
                 if ($surname) {
                     $link .= "&surname=" . $surname;
                 }
                 $submenu = new Menu($pgv_lang["individual_list"], encode_url($link));
                 if (!empty($PGV_IMAGES["indis"]["small"])) {
                     $submenu->addIcon($PGV_IMAGE_DIR . "/" . $PGV_IMAGES["indis"]["small"]);
                 }
                 $submenu->addClass("submenuitem{$ff}", "submenuitem_hover{$ff}", "", "icon_small_indis");
                 $menu->addSubmenu($submenu);
                 break;
             case "family":
                 //-- famlist sub menu
                 $link = "famlist.php?ged={$GEDCOM}";
                 if ($surname) {
                     $link .= "&amp;surname=" . $surname;
                 }
                 $submenu = new Menu($pgv_lang["family_list"], $link);
                 if (!empty($PGV_IMAGES["cfamily"]["small"])) {
                     $submenu->addIcon($PGV_IMAGE_DIR . "/" . $PGV_IMAGES["cfamily"]["small"]);
                 }
                 $submenu->addClass("submenuitem{$ff}", "submenuitem_hover{$ff}", "", "icon_small_cfamily");
                 $menu->addSubmenu($submenu);
                 break;
             case "branches":
                 //-- branches sub menu
                 $link = "branches.php?ged={$GEDCOM}";
                 if ($surname) {
                     $link .= "&amp;surn=" . $surname;
                 }
                 $submenu = new Menu($pgv_lang["branch_list"], $link);
                 if (!empty($PGV_IMAGES["patriarch"]["small"])) {
                     $submenu->addIcon($PGV_IMAGE_DIR . "/" . $PGV_IMAGES["patriarch"]["small"]);
                 }
                 $submenu->addClass("submenuitem{$ff}", "submenuitem_hover{$ff}", "", "icon_small_patriarch");
                 $menu->addSubmenu($submenu);
                 break;
             case "source":
                 //-- source
                 $submenu = new Menu($pgv_lang["source_list"], encode_url('sourcelist.php?ged=' . $GEDCOM));
                 if (!empty($PGV_IMAGES["menu_source"]["small"])) {
                     $submenu->addIcon($PGV_IMAGE_DIR . "/" . $PGV_IMAGES["menu_source"]["small"]);
                 }
                 $submenu->addClass("submenuitem{$ff}", "submenuitem_hover{$ff}", "", "icon_small_menu_source");
                 $menu->addSubmenu($submenu);
                 break;
             case "note":
                 //-- shared note
                 $submenu = new Menu($pgv_lang["shared_note_list"], encode_url('notelist.php?ged=' . $GEDCOM));
                 if (!empty($PGV_IMAGES["notes"]["small"])) {
                     $submenu->addIcon($PGV_IMAGE_DIR . "/" . $PGV_IMAGES["notes"]["small"]);
                 }
                 $submenu->addClass("submenuitem{$ff}", "submenuitem_hover{$ff}", "", "icon_small_notes");
                 $menu->addSubmenu($submenu);
                 break;
             case "repository":
                 //-- repository
                 $submenu = new Menu($pgv_lang["repo_list"], "repolist.php");
                 if (!empty($PGV_IMAGES["menu_repository"]["small"])) {
                     $submenu->addIcon($PGV_IMAGE_DIR . "/" . $PGV_IMAGES["menu_repository"]["small"]);
                 }
                 $submenu->addClass("submenuitem{$ff}", "submenuitem_hover{$ff}", "", "icon_small_menu_repository");
                 $menu->addSubmenu($submenu);
                 break;
             case "places":
                 //-- places
                 $submenu = new Menu($pgv_lang["place_list"], encode_url('placelist.php?ged=' . $GEDCOM));
                 if (!empty($PGV_IMAGES["place"]["small"])) {
                     $submenu->addIcon($PGV_IMAGE_DIR . "/" . $PGV_IMAGES["place"]["small"]);
                 }
                 $submenu->addClass("submenuitem{$ff}", "submenuitem_hover{$ff}", "", "icon_small_place");
                 $menu->addSubmenu($submenu);
                 break;
             case "media":
                 //-- medialist
                 $submenu = new Menu($pgv_lang["media_list"], encode_url('medialist.php?ged=' . $GEDCOM));
                 if (!empty($PGV_IMAGES["menu_media"]["small"])) {
                     $submenu->addIcon($PGV_IMAGE_DIR . "/" . $PGV_IMAGES["menu_media"]["small"]);
                 }
                 $submenu->addClass("submenuitem{$ff}", "submenuitem_hover{$ff}", "", "icon_small_menu_media");
                 $menu->addSubmenu($submenu);
                 break;
         }
     }
     return $menu;
 }