} echo '<b>', $pgv_lang['accept_successful'], '</b>'; break; } if (empty($pgv_changes)) { echo '<br /><br /><b>', $pgv_lang['no_changes'], '</b>'; } else { $output = '<br /><br /><table class="list_table"><tr><td class="list_value ' . $TEXT_DIRECTION . '">'; $changedgedcoms = array(); foreach ($pgv_changes as $cid => $changes) { foreach ($changes as $i => $change) { if ($i == 0) { $changedgedcoms[$change['gedcom']] = true; $GEDCOM = $change['gedcom']; $record = GedcomRecord::getInstance($change['gid']); $output .= '<b>' . PrintReady($record->getFullName()) . '</b> ' . getLRM() . '(' . $record->getXref() . ')' . getLRM() . '<br />'; $output .= '<a href="javascript:;" onclick="return show_diff(\'' . encode_url($record->getLinkUrl() . '&show_changes=yes') . '\');">' . $pgv_lang['view_change_diff'] . '</a> | '; $output .= "<a href=\"javascript:show_gedcom_record('" . $change['gid'] . "');\">" . $pgv_lang['view_gedcom'] . "</a> | "; $output .= "<a href=\"javascript:;\" onclick=\"return edit_raw('" . $change['gid'] . "');\">" . $pgv_lang['edit_raw'] . "</a><br />"; $output .= '<div class="indent">'; $output .= $pgv_lang['changes_occurred'] . '<br />'; $output .= '<table class="list_table"><tr>'; $output .= '<td class="list_label">' . $pgv_lang['accept'] . '</td>'; $output .= '<td class="list_label">' . $pgv_lang['type'] . '</td>'; $output .= '<td class="list_label">' . $pgv_lang['username'] . '</td>'; $output .= '<td class="list_label">' . $pgv_lang['date'] . '</td>'; $output .= '<td class="list_label">GEDCOM</td>'; $output .= '<td class="list_label">' . $pgv_lang['undo'] . '</td>'; $output .= '</tr>'; } if ($i == count($changes) - 1) {
/** * add a new tag input field * * called for each fact to be edited on a form. * Fact level=0 means a new empty form : data are POSTed by name * else data are POSTed using arrays : * glevels[] : tag level * islink[] : tag is a link * tag[] : tag name * text[] : tag value * * @param string $tag fact record to edit (eg 2 DATE xxxxx) * @param string $upperlevel optional upper level tag (eg BIRT) * @param string $label An optional label to echo instead of the default from the $factarray * @param string $readOnly optional, when "READONLY", fact data can't be changed * @param string $noClose optional, when "NOCLOSE", final "</td></tr>" won't be printed * (so that additional text can be printed in the box) * @param boolean $rowDisplay True to have the row displayed by default, false to hide it by default */ function add_simple_tag($tag, $upperlevel = "", $label = "", $readOnly = "", $noClose = "", $rowDisplay = true) { global $factarray, $pgv_lang, $PGV_IMAGE_DIR, $PGV_IMAGES, $MEDIA_DIRECTORY, $TEMPLE_CODES; global $assorela, $tags, $emptyfacts, $main_fact, $TEXT_DIRECTION, $pgv_changes, $GEDCOM; global $NPFX_accept, $SPFX_accept, $NSFX_accept, $FILE_FORM_accept, $upload_count; global $tabkey, $STATUS_CODES, $SPLIT_PLACES, $pid, $linkToID; global $bdm, $PRIVACY_BY_RESN; global $lang_short_cut, $LANGUAGE; global $QUICK_REQUIRED_FACTS, $QUICK_REQUIRED_FAMFACTS, $PREFER_LEVEL2_SOURCES; if (substr($tag, 0, strpos($tag, "PLAC"))) { ?> <script type="text/javascript"> <!-- function valid_lati_long(field, pos, neg) { // valid LATI or LONG according to Gedcom standard // pos (+) : N or E // neg (-) : S or W txt=field.value.toUpperCase(); txt=txt.replace(/(^\s*)|(\s*$)/g,''); // trim txt=txt.replace(/ /g,':'); // N12 34 ==> N12.34 txt=txt.replace(/\+/g,''); // +17.1234 ==> 17.1234 txt=txt.replace(/-/g,neg); // -0.5698 ==> W0.5698 txt=txt.replace(/,/g,'.'); // 0,5698 ==> 0.5698 // 0๏ฟฝ34'11 ==> 0:34:11 txt=txt.replace(/\uB0/g,':'); // ๏ฟฝ txt=txt.replace(/\u27/g,':'); // ' // 0:34:11.2W ==> W0.5698 txt=txt.replace(/^([0-9]+):([0-9]+):([0-9.]+)(.*)/g, function($0, $1, $2, $3, $4) { var n=parseFloat($1); n+=($2/60); n+=($3/3600); n=Math.round(n*1E4)/1E4; return $4+n; }); // 0:34W ==> W0.5667 txt=txt.replace(/^([0-9]+):([0-9]+)(.*)/g, function($0, $1, $2, $3) { var n=parseFloat($1); n+=($2/60); n=Math.round(n*1E4)/1E4; return $3+n; }); // 0.5698W ==> W0.5698 txt=txt.replace(/(.*)([N|S|E|W]+)$/g,'$2$1'); // 17.1234 ==> N17.1234 if (txt!='' && txt.charAt(0)!=neg && txt.charAt(0)!=pos) txt=pos+txt; field.value = txt; } function toggle_lati_long() { tr = document.getElementsByTagName('tr'); for (var i=0; i<tr.length; i++) { if (tr[i].id.indexOf("LATI")>=0 || tr[i].id.indexOf("LONG")>=0) { var disp = tr[i].style.display; if (disp=="none") { disp="table-row"; if (document.all && !window.opera) disp = "inline"; // IE } else disp="none"; tr[i].style.display=disp; } } } //--> </script> <?php } if (!isset($noClose) && isset($readOnly) && $readOnly == "NOCLOSE") { $noClose = "NOCLOSE"; $readOnly = ""; } if (!isset($noClose) || $noClose != "NOCLOSE") { $noClose = ""; } if (!isset($readOnly) || $readOnly != "READONLY") { $readOnly = ""; } if (!isset($tabkey)) { $tabkey = 1; } if (empty($linkToID)) { $linkToID = $pid; } $subnamefacts = array("NPFX", "GIVN", "SPFX", "SURN", "NSFX", "_MARNM_SURN"); @(list($level, $fact, $value) = explode(" ", $tag)); // element name : used to POST data if ($level == 0) { if ($upperlevel) { $element_name = $upperlevel . "_" . $fact; } else { $element_name = $fact; } // ex: OCCU } else { $element_name = "text[]"; } if ($level == 1) { $main_fact = $fact; } // element id : used by javascript functions if ($level == 0) { $element_id = $fact; } else { $element_id = $fact . floor(microtime() * 1000000); } // ex: SOUR56402 if ($upperlevel) { $element_id = $upperlevel . "_" . $fact; } // ex: BIRT_DATE | DEAT_DATE ... // field value $islink = (substr($value, 0, 1) == "@" and substr($value, 0, 2) != "@#"); if ($islink) { $value = trim(trim(substr($tag, strlen($fact) + 3)), " @\r"); } else { $value = trim(substr($tag, strlen($fact) + 3)); } if ($fact == 'REPO' || $fact == 'SOUR' || $fact == 'OBJE' || $fact == 'FAMC') { $islink = true; } // rows & cols switch ($fact) { case 'FORM': $rows = 1; $cols = 5; break; case 'LATI': case 'LONG': case 'NPFX': case 'SPFX': case 'NSFX': $rows = 1; $cols = 12; break; case 'DATE': case 'TIME': case 'TYPE': $rows = 1; $cols = 20; break; case 'GIVN': case 'SURN': case '_MARNM': $rows = 1; $cols = 25; break; case '_UID': $rows = 1; $cols = 50; break; case 'TEXT': case 'PUBL': $rows = 10; $cols = 70; break; case 'SHARED_NOTE_EDIT': $islink = 1; $fact = "NOTE"; $rows = 15; $cols = 88; break; case 'SHARED_NOTE': $islink = 1; $fact = "NOTE"; $rows = 1; $cols = $islink ? 8 : 40; break; case 'NOTE': if ($islink) { $rows = 1; $cols = $islink ? 8 : 40; break; } else { $rows = 10; $cols = 70; break; } case 'ADDR': $rows = 4; $cols = 40; break; case 'PAGE': $rows = 1; $cols = 50; break; default: $rows = 1; $cols = $islink ? 8 : 40; break; } // label $style = ""; echo "<tr id=\"" . $element_id . "_tr\" "; if ($fact == "MAP" || $fact == "LATI" || $fact == "LONG") { echo " style=\"display:none;\""; } echo " >\n"; if (in_array($fact, $subnamefacts) || $fact == "LATI" || $fact == "LONG") { echo "<td class=\"optionbox {$TEXT_DIRECTION} wrap width25\">"; } else { echo "<td class=\"descriptionbox {$TEXT_DIRECTION} wrap width25\">"; } // help link if (!in_array($fact, $emptyfacts)) { if ($fact == "DATE") { print_help_link("def_gedcom_date_help", "qm", "date"); } else { if ($fact == "RESN") { print_help_link($fact . "_help", "qm"); } else { if ($fact == "NOTE" && $islink) { print_help_link("edit_add_SHARED_NOTE_help", "qm"); } else { print_help_link("edit_" . $fact . "_help", "qm"); } } } } if ($fact == "_AKAN" || $fact == "_AKA" || $fact == "ALIA") { // Allow special processing for different languages $func = "fact_AKA_localisation_{$lang_short_cut[$LANGUAGE]}"; if (function_exists($func)) { // Localise the AKA fact $func($fact, $pid); } } else { if ($fact == "AGNC" && !empty($main_fact)) { // Allow special processing for different languages $func = "fact_AGNC_localisation_{$lang_short_cut[$LANGUAGE]}"; if (function_exists($func)) { // Localise the AGNC fact $func($fact, $main_fact); } } } if (PGV_DEBUG) { echo $element_name . "<br />\n"; } // tag name if (!empty($label)) { if ($label == "Note" && $islink) { echo $pgv_lang["shared_note"]; } else { echo $label; } } else { if ($fact == "NOTE" && $islink) { echo $pgv_lang["shared_note"]; } else { if (isset($pgv_lang[$fact])) { echo $pgv_lang[$fact]; } else { if (isset($factarray[$fact])) { echo $factarray[$fact]; } else { echo $fact; } } } } echo "\n"; // tag level if ($level > 0) { if ($fact == "TEXT" and $level > 1) { echo "<input type=\"hidden\" name=\"glevels[]\" value=\"" . ($level - 1) . "\" />"; echo "<input type=\"hidden\" name=\"islink[]\" value=\"0\" />"; echo "<input type=\"hidden\" name=\"tag[]\" value=\"DATA\" />"; //-- leave data text[] value empty because the following TEXT line will //--- cause the DATA to be added echo "<input type=\"hidden\" name=\"text[]\" value=\"\" />"; } echo "<input type=\"hidden\" name=\"glevels[]\" value=\"" . $level . "\" />\n"; echo "<input type=\"hidden\" name=\"islink[]\" value=\"" . $islink . "\" />\n"; echo "<input type=\"hidden\" name=\"tag[]\" value=\"" . $fact . "\" />\n"; // Shared Notes Debug -------------------- // echo "<br />Label = ".$label; // echo "<br />Level = ".$level; // echo "<br />Link = ".$islink; // echo "<br />Fact = ".$fact; // echo "<br />Value = ".$value; // End Debug ------------------- } echo "\n</td>"; // value echo "<td class=\"optionbox wrap\">\n"; if (PGV_DEBUG) { echo $tag . "<br />\n"; } // retrieve linked NOTE if ($fact == "NOTE" && $islink) { $noteid = $value; } if (in_array($fact, $emptyfacts) && (empty($value) || $value == "y" || $value == "Y")) { $value = strtoupper($value); //-- don't default anything to Y when adding events through people //-- default to Y when specifically adding one of these events if ($level == 1) { $value = "Y"; } // default YES echo "<input type=\"hidden\" id=\"" . $element_id . "\" name=\"" . $element_name . "\" value=\"" . $value . "\" />"; if ($level <= 1) { echo "<input type=\"checkbox\" "; if ($value == "Y") { echo " checked=\"checked\""; } echo " onclick=\"if (this.checked) " . $element_id . ".value='Y'; else " . $element_id . ".value=''; \" />"; echo $pgv_lang["yes"]; } } else { if ($fact == "TEMP") { echo "<select tabindex=\"" . $tabkey . "\" name=\"" . $element_name . "\" >\n"; echo "<option value=''>" . $pgv_lang["no_temple"] . "</option>\n"; foreach ($TEMPLE_CODES as $code => $temple) { echo "<option value=\"{$code}\""; if ($code == $value) { echo " selected=\"selected\""; } echo ">{$temple} ({$code})</option>\n"; } echo "</select>\n"; } else { if ($fact == "ADOP") { echo "<select tabindex=\"" . $tabkey . "\" name=\"" . $element_name . "\" >"; foreach (array("BOTH" => $factarray["HUSB"] . "+" . $factarray["WIFE"], "HUSB" => $factarray["HUSB"], "WIFE" => $factarray["WIFE"]) as $k => $v) { echo "<option value='{$k}'"; if ($value == $k) { echo " selected=\"selected\""; } echo ">{$v}</option>"; } echo "</select>\n"; } else { if ($fact == "PEDI") { echo "<select tabindex=\"" . $tabkey . "\" name=\"" . $element_name . "\" >"; foreach (array("" => $pgv_lang["unknown"], "birth" => $factarray["BIRT"], "adopted" => $pgv_lang["adopted"], "foster" => $pgv_lang["foster"], "sealing" => $pgv_lang["sealing"]) as $k => $v) { echo "<option value='{$k}'"; if (UTF8_strtolower($value) == $k) { echo " selected=\"selected\""; } echo ">{$v}</option>"; } echo "</select>\n"; } else { if ($fact == "STAT") { echo "<select tabindex=\"" . $tabkey . "\" name=\"" . $element_name . "\" >\n"; echo "<option value=''>No special status</option>\n"; foreach ($STATUS_CODES as $code => $status) { echo "<option value=\"{$code}\""; if ($code == $value) { echo " selected=\"selected\""; } echo ">{$status}</option>\n"; } echo "</select>\n"; } else { if ($fact == "RELA") { $text = strtolower($value); // add current relationship if not found in default list if (!array_key_exists($text, $assorela)) { $assorela[$text] = $text; } echo "<select tabindex=\"" . $tabkey . "\" id=\"" . $element_id . "\" name=\"" . $element_name . "\" >\n"; foreach ($assorela as $key => $value) { echo "<option value=\"" . $key . "\""; if ($key == $text) { echo " selected=\"selected\""; } echo ">" . $assorela["{$key}"] . "</option>\n"; } echo "</select>\n"; } else { if ($fact == "_PGVU") { $text = strtolower($value); echo "<select tabindex=\"" . $tabkey . "\" id=\"" . $element_id . "\" name=\"" . $element_name . "\" >\n"; echo '<option value=""'; if ('' == $text) { echo ' selected="selected"'; } echo ">-</option>\n"; foreach (get_all_users('asc', 'username') as $user_id => $user_name) { echo "<option value=\"" . $user_id . "\""; if ($user_id == $text) { echo " selected=\"selected\""; } echo ">" . $user_name . "</option>\n"; } echo "</select>\n"; } else { if ($fact == "RESN") { ?> <script type="text/javascript"> <!-- function update_RESN_img(resn_val) { document.getElementById("RESN_none").style.display="none"; document.getElementById("RESN_locked").style.display="none"; document.getElementById("RESN_privacy").style.display="none"; document.getElementById("RESN_confidential").style.display="none"; document.getElementById("RESN_"+resn_val).style.display="inline"; if (resn_val=='none') resn_val=''; document.getElementById("<?php echo $element_id; ?> ").value=resn_val; } //--> </script> <?php if (!$PRIVACY_BY_RESN && $level == 1) { // warn user that level 1 RESN tags have no effect when PRIVACY_BY_RESN is false echo "<small>" . $pgv_lang["resn_disabled"] . "</small>"; } echo "<input type=\"hidden\" id=\"" . $element_id . "\" name=\"" . $element_name . "\" value=\"" . $value . "\" />\n"; echo "<table><tr valign=\"top\">\n"; foreach (array("none", "locked", "privacy", "confidential") as $resn_index => $resn_val) { if ($resn_val == "none") { $resnv = ""; } else { $resnv = $resn_val; } echo "<td><input tabindex=\"" . $tabkey . "\" type=\"radio\" name=\"RESN_radio\" onclick=\"update_RESN_img('" . $resn_val . "')\""; echo " value=\"" . $resnv . "\""; if ($value == $resnv) { echo " checked=\"checked\""; } echo " /><small>" . $pgv_lang[$resn_val] . "</small>"; echo "<br /> <img id=\"RESN_" . $resn_val . "\" src=\"images/RESN_" . $resn_val . ".gif\" alt=\"" . $pgv_lang[$resn_val] . "\" title=\"" . $pgv_lang[$resn_val] . "\" border=\"0\""; if ($value == $resnv) { echo " style=\"display:inline\""; } else { echo " style=\"display:none\""; } echo " /></td>\n"; } echo "</tr></table>\n"; } else { if ($fact == "_PRIM" or $fact == "_THUM") { echo "<select tabindex=\"" . $tabkey . "\" id=\"" . $element_id . "\" name=\"" . $element_name . "\" >\n"; echo "<option value=\"\"></option>\n"; echo "<option value=\"Y\""; if ($value == "Y") { echo " selected=\"selected\""; } echo ">" . $pgv_lang["yes"] . "</option>\n"; echo "<option value=\"N\""; if ($value == "N") { echo " selected=\"selected\""; } echo ">" . $pgv_lang["no"] . "</option>\n"; echo "</select>\n"; } else { if ($fact == "SEX") { echo "<select tabindex=\"" . $tabkey . "\" id=\"" . $element_id . "\" name=\"" . $element_name . "\">\n<option value=\"M\""; if ($value == "M") { echo " selected=\"selected\""; } echo ">" . $pgv_lang["male"] . "</option>\n<option value=\"F\""; if ($value == "F") { echo " selected=\"selected\""; } echo ">" . $pgv_lang["female"] . "</option>\n<option value=\"U\""; if ($value == "U" || empty($value)) { echo " selected=\"selected\""; } echo ">" . $pgv_lang["unknown"] . "</option>\n</select>\n"; } else { if ($fact == "TYPE" && $level == '3') { //-- Build array of currently defined values for this Media Fact foreach ($pgv_lang as $varname => $typeValue) { if (substr($varname, 0, 6) == "TYPE__") { if ($varname != "TYPE__other") { $type[strtolower(substr($varname, 6))] = $typeValue; } } } //-- Sort the array into a meaningful order array_flip($type); asort($type); array_flip($type); //-- Add "Other" at the end of the list $type["other"] = $pgv_lang["TYPE__other"]; //-- Build the selector for the Media "TYPE" Fact echo "<select tabindex=\"" . $tabkey . "\" name=\"text[]\">"; if ($value == "") { echo "<option selected=\"selected\" value=\"\" > " . $pgv_lang["choose"] . " </option>"; } $selectedValue = strtolower($value); foreach ($type as $typeName => $typeValue) { echo "<option value=\"" . $typeName . "\" "; if ($selectedValue == $typeName) { echo "selected=\"selected\" "; } echo "> " . $typeValue . " </option>"; } echo "</select>"; } else { if ($fact == "NAME" && $upperlevel != 'REPO' || $fact == "_MARNM") { // Populated in javascript from sub-tags echo "<input type=\"hidden\" id=\"" . $element_id . "\" name=\"" . $element_name . "\" onchange=\"updateTextName('" . $element_id . "');\" value=\"" . PrintReady(htmlspecialchars($value, ENT_COMPAT, 'UTF-8')) . "\" />"; echo "<span id=\"" . $element_id . "_display\">" . PrintReady(htmlspecialchars($value, ENT_COMPAT, 'UTF-8')) . "</span>"; echo " <a href=\"#edit_name\" onclick=\"convertHidden('" . $element_id . "'); return false;\"> "; if (isset($PGV_IMAGES["edit_indi"]["small"])) { echo "<img src=\"" . $PGV_IMAGE_DIR . "/" . $PGV_IMAGES["edit_indi"]["small"] . "\" border=\"0\" width=\"20\" alt=\"" . $pgv_lang["edit_name"] . "\" align=\"top\" />"; } else { echo "<span class=\"age\">[" . $pgv_lang["edit_name"] . "]</span>"; } echo "</a>"; } else { // textarea if ($rows > 1) { echo "<textarea tabindex=\"" . $tabkey . "\" id=\"" . $element_id . "\" name=\"" . $element_name . "\" rows=\"" . $rows . "\" cols=\"" . $cols . "\">" . PrintReady(htmlspecialchars($value, ENT_COMPAT, 'UTF-8')) . "</textarea><br />\n"; } else { // text echo "<input tabindex=\"" . $tabkey . "\" type=\"text\" id=\"" . $element_id . "\" name=\"" . $element_name . "\" value=\"" . PrintReady(htmlspecialchars($value, ENT_COMPAT, 'UTF-8')) . "\" size=\"" . $cols . "\" dir=\"ltr\""; echo " class=\"{$fact}\""; echo " autocomplete=\"off\""; if (in_array($fact, $subnamefacts)) { echo " onblur=\"updatewholename();\" onkeyup=\"updatewholename();\""; } if ($fact == "DATE") { echo " onblur=\"valid_date(this);\" onmouseout=\"valid_date(this);\""; } if ($fact == "LATI") { echo " onblur=\"valid_lati_long(this, 'N', 'S');\" onmouseout=\"valid_lati_long(this, 'N', 'S');\""; } if ($fact == "LONG") { echo " onblur=\"valid_lati_long(this, 'E', 'W');\" onmouseout=\"valid_lati_long(this, 'E', 'W');\""; } //if ($fact=="FILE") echo " onchange=\"if (updateFormat) updateFormat(this.value);\""; echo " " . $readOnly . " />\n"; } // split PLAC if ($fact == "PLAC" && $readOnly == "") { echo "<div id=\"" . $element_id . "_pop\" style=\"display: inline;\">\n"; print_specialchar_link($element_id, false); print_findplace_link($element_id); echo "</div>\n"; echo "<a href=\"javascript:;\" onclick=\"toggle_lati_long();\"><img src=\"images/buttons/target.gif\" border=\"0\" align=\"middle\" alt=\"" . $factarray["LATI"] . " / " . $factarray["LONG"] . "\" title=\"" . $factarray["LATI"] . " / " . $factarray["LONG"] . "\" /></a>"; if ($SPLIT_PLACES) { if (!function_exists("print_place_subfields")) { require "includes/functions/functions_places.php"; } setup_place_subfields($element_id); print_place_subfields($element_id); } } else { if (($cols > 20 || $fact == "NPFX") && $readOnly == "") { print_specialchar_link($element_id, false); } } } } } } } } } } } } } } // MARRiage TYPE : hide text field and show a selection list if ($fact == "TYPE" and $tags[0] == "MARR") { echo "<script type='text/javascript'>"; echo "document.getElementById('" . $element_id . "').style.display='none'"; echo "</script>"; echo "<select tabindex=\"" . $tabkey . "\" id=\"" . $element_id . "_sel\" onchange=\"document.getElementById('" . $element_id . "').value=this.value;\" >\n"; foreach (array("Unknown", "Civil", "Religious", "Partners") as $indexval => $key) { if ($key == "Unknown") { echo "<option value=\"\""; } else { echo "<option value=\"" . $key . "\""; } $a = strtolower($key); $b = strtolower($value); if (@strpos($a, $b) !== false or @strpos($b, $a) !== false) { echo " selected=\"selected\""; } echo ">" . $factarray["MARR_" . strtoupper($key)] . "</option>\n"; } echo "</select>"; } // popup links if ($readOnly == "") { if ($fact == "DATE") { print_calendar_popup($element_id); } if ($fact == "FAMC") { print_findfamily_link($element_id, ""); } if ($fact == "FAMS") { print_findfamily_link($element_id, ""); } if ($fact == "ASSO") { print_findindi_link($element_id, ""); } if ($fact == "FILE") { print_findmedia_link($element_id, "0file"); } if ($fact == "SOUR") { print_findsource_link($element_id); print_addnewsource_link($element_id); //print_autopaste_link($element_id, array("S1", "S2"), false, false, true); //-- checkboxes to apply '1 SOUR' to BIRT/MARR/DEAT as '2 SOUR' if ($level == 1) { echo '<br />'; if ($PREFER_LEVEL2_SOURCES === '0') { $level1_checked = ''; $level2_checked = ''; } else { if ($PREFER_LEVEL2_SOURCES === '1' || $PREFER_LEVEL2_SOURCES === true) { $level1_checked = ''; $level2_checked = ' checked="checked"'; } else { $level1_checked = ' checked="checked"'; $level2_checked = ''; } } if (strpos($bdm, 'B') !== false) { echo ' <input type="checkbox" name="SOUR_INDI" ', $level1_checked, ' value="Y" />'; echo $pgv_lang['individual']; if (preg_match_all('/(' . PGV_REGEX_TAG . ')/', $QUICK_REQUIRED_FACTS, $matches)) { foreach ($matches[1] as $match) { if (!in_array($match, explode('|', PGV_EVENTS_DEAT))) { echo ' <input type="checkbox" name="SOUR_', $match, '"', $level2_checked, ' value="Y" />'; echo $factarray[$match]; } } } } if (strpos($bdm, 'D') !== false) { if (preg_match_all('/(' . PGV_REGEX_TAG . ')/', $QUICK_REQUIRED_FACTS, $matches)) { foreach ($matches[1] as $match) { if (in_array($match, explode('|', PGV_EVENTS_DEAT))) { echo ' <input type="checkbox" name="SOUR_', $match, '"', $level2_checked, ' value="Y" />'; echo $factarray[$match]; } } } } if (strpos($bdm, 'M') !== false) { echo ' <input type="checkbox" name="SOUR_FAM" ', $level1_checked, ' value="Y" />'; echo $pgv_lang["family"]; if (preg_match_all('/(' . PGV_REGEX_TAG . ')/', $QUICK_REQUIRED_FAMFACTS, $matches)) { foreach ($matches[1] as $match) { echo ' <input type="checkbox" name="SOUR_', $match, '"', $level2_checked, ' value="Y" />'; echo $factarray[$match]; } } } } } if ($fact == "REPO") { print_findrepository_link($element_id); print_addnewrepository_link($element_id); } // Shared Notes Icons ======================================== // $record=GedcomRecord::getInstance($value); if ($fact == "NOTE" && $islink) { print_findnote_link($element_id); print_addnewnote_link($element_id); if ($value != "") { echo " "; print_editnote_link($value); } // If GEDFAct_assistant/_CENS/ module exists && we are on the INDI page // Then show the add Shared note assisted icon, if not ... do not show if ($pid) { $type_pid = GedcomRecord::getInstance($pid); if (file_exists('modules/GEDFact_assistant/_CENS/census_1_ctrl.php') && $type_pid->getType() == "INDI") { echo " "; print_addnewnote_assisted_link($element_id); } } echo "<br />"; } // =========================================================== if ($fact == "OBJE") { print_findmedia_link($element_id, "1media"); } if ($fact == "OBJE" && !$value) { print_addnewmedia_link($element_id); $value = "new"; } } // current value if ($TEXT_DIRECTION == "ltr") { if ($fact == "DATE") { $date = new GedcomDate($value); echo $date->Display(false); } if (($fact == "ASSO" || $fact == "SOUR" || $fact == "OBJE" || $fact == "NOTE" && $islink) && $value) { $record = GedcomRecord::getInstance($value); if ($record) { echo ' ', PrintReady($record->getFullName()), ' (', $value, ')'; } else { if ($value != "new") { echo ' ', $value; } } } } else { if ($fact == "DATE") { $date = new GedcomDate($value); echo getRLM(), $date->Display(false), getRLM(); } if (($fact == "ASSO" || $fact == "SOUR" || $fact == "OBJE" || $fact == "NOTE" && $islink) && $value) { $record = GedcomRecord::getInstance($value); if ($record) { echo getRLM(), PrintReady($record->getFullName()), ' ', getLRM(), '(', $value, ') ', getLRM(), getRLM(); } else { if ($value != "new") { echo getRLM(), $value, ' ', getRLM(); } } } } /* if ($fact=="NOTE" && $islink && $value!="") { include('includes/functions/functions_print_lists.php'); echo "<tr><td class=\"descriptionbox ".$TEXT_DIRECTION." wrap width25\">"; print_help_link("edit_add_SHARED_NOTE_help", "qm"); // echo $pgv_lang["admin_override"]; echo "Shared Note Links<br /><br />"; echo "</td><td class=\"optionbox wrap\">\n"; print_indi_list(fetch_linked_indi($value, "NOTE", "1")); echo "</td></tr>\n"; } */ // pastable values if ($readOnly == "") { if ($fact == "SPFX") { print_autopaste_link($element_id, $SPFX_accept); } if ($fact == "NSFX") { print_autopaste_link($element_id, $NSFX_accept); } if ($fact == "FORM") { print_autopaste_link($element_id, $FILE_FORM_accept, false, false); } } if ($noClose != "NOCLOSE") { echo "</td></tr>\n"; } $tabkey++; return $element_id; }
/** * print family header * @param String family id * @param String family label * @return html table */ function printFamilyHeader($famid, $label) { global $pgv_lang; global $PGV_IMAGE_DIR, $PGV_IMAGES, $SHOW_ID_NUMBERS, $SEARCH_SPIDER; ?> <table> <tr> <td><img src="<?php print $PGV_IMAGE_DIR . "/" . $PGV_IMAGES["cfamily"]["small"]; ?> " border="0" class="icon" alt="" /></td> <td><span class="subheaders"><?php print PrintReady($label); ?> </span> <?php if (!$this->isPrintPreview() && empty($SEARCH_SPIDER)) { ?> - <a href="family.php?famid=<?php print $famid; ?> ">[<?php print $pgv_lang["view_family"]; if ($SHOW_ID_NUMBERS) { print " " . getLRM() . "({$famid})" . getLRM(); } ?> ]</a> <?php } ?> </td> </tr> </table> <?php }
/** * 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'; } } } }
/** * print the children table for a family * * @param string $famid family gedcom ID * @param string $childid optional child ID * @param int $sosa optional child sosa number * @param string $label optional indi label (descendancy booklet) */ function print_family_children($famid, $childid = "", $sosa = 0, $label = "", $personcount = "1") { global $pgv_lang, $factarray, $pbwidth, $pbheight, $view, $show_famlink, $show_cousins; global $PGV_IMAGE_DIR, $PGV_IMAGES, $show_changes, $pgv_changes, $GEDCOM, $SHOW_ID_NUMBERS, $TEXT_DIRECTION; $family = Family::getInstance($famid); $children = $family->getChildrenIds(); print "<table border=\"0\" cellpadding=\"0\" cellspacing=\"2\"><tr>"; if ($sosa > 0) { print "<td></td>"; } print "<td><span class=\"subheaders\">" . $pgv_lang["children"] . "</span></td>"; if ($sosa > 0) { print "<td></td><td></td>"; } print "</tr>\n"; $newchildren = array(); $oldchildren = array(); if (PGV_USER_CAN_EDIT) { if (isset($_REQUEST['show_changes']) && $_REQUEST['show_changes'] == 'yes' && isset($pgv_changes[$famid . "_" . $GEDCOM])) { $newrec = find_updated_record($famid); $ct = preg_match_all("/1 CHIL @(.*)@/", $newrec, $match, PREG_SET_ORDER); if ($ct > 0) { $oldchil = array(); for ($i = 0; $i < $ct; $i++) { if (!in_array($match[$i][1], $children)) { $newchildren[] = $match[$i][1]; } else { $oldchil[] = $match[$i][1]; } } foreach ($children as $indexval => $chil) { if (!in_array($chil, $oldchil)) { $oldchildren[] = $chil; } } //-- if there are no old or new children then the children were reordered if (count($newchildren) == 0 && count($oldchildren) == 0) { $children = array(); for ($i = 0; $i < $ct; $i++) { $children[] = $match[$i][1]; } } } } } $nchi = 1; if (count($children) > 0 || count($newchildren) > 0 || count($oldchildren) > 0) { foreach ($children as $indexval => $chil) { if (!in_array($chil, $oldchildren)) { print "<tr>\n"; if ($sosa != 0) { if ($chil == $childid) { print_sosa_number($sosa, $childid); } else { if (empty($label)) { print_sosa_number(""); } else { print_sosa_number($label . $nchi++ . "."); } } } print "<td valign=\"middle\" >"; print_pedigree_person($chil, 1, $show_famlink, 8, $personcount); $personcount++; print "</td>"; if ($sosa != 0) { // loop for all families where current child is a spouse $famids = find_sfamily_ids($chil); $maxfam = count($famids) - 1; for ($f = 0; $f <= $maxfam; $f++) { $famid = $famids[$f]; if (!$famid) { continue; } $parents = find_parents($famid); if (!$parents) { continue; } if ($parents["HUSB"] == $chil) { $spouse = $parents["WIFE"]; } else { $spouse = $parents["HUSB"]; } // multiple marriages if ($f > 0) { print "</tr>\n<tr><td> </td>"; print "<td valign=\"top\""; if ($TEXT_DIRECTION == "rtl") { print " align=\"left\">"; } else { print " align=\"right\">"; } //if ($f==$maxfam) print "<img height=\"50%\""; //else print "<img height=\"100%\""; if ($f == $maxfam) { print "<img height=\"" . ($pbheight / 2 - 3) . "px\""; } else { print "<img height=\"" . $pbheight . "px\""; } print " width=\"3\" src=\"" . $PGV_IMAGE_DIR . "/" . $PGV_IMAGES["vline"]["other"] . "\" alt=\"\" />"; print "</td>"; } print "<td class=\"details1\" valign=\"middle\" align=\"center\">"; $divrec = ""; if (showFact("MARR", $famid)) { // marriage date $famrec = find_family_record($famid); $ct = preg_match("/2 DATE.*(\\d\\d\\d\\d)/", get_sub_record(1, "1 MARR", $famrec), $match); if ($ct > 0) { print "<span class=\"date\">" . trim($match[1]) . "</span>"; } // divorce date $divrec = get_sub_record(1, "1 DIV", $famrec); $ct = preg_match("/2 DATE.*(\\d\\d\\d\\d)/", $divrec, $match); if ($ct > 0) { print "-<span class=\"date\">" . trim($match[1]) . "</span>"; } } print "<br /><img width=\"100%\" height=\"3\" src=\"" . $PGV_IMAGE_DIR . "/" . $PGV_IMAGES["hline"]["other"] . "\" alt=\"\" />"; // family link if ($famid) { print "<br />"; print "<a class=\"details1\" href=\"family.php?famid={$famid}\">"; if ($SHOW_ID_NUMBERS) { print getLRM() . " ({$famid}) " . getLRM(); } print "</a>"; } print "</td>\n"; // spouse information print "<td style=\"vertical-align: center;"; if (!empty($divrec) and $view != "preview") { print " filter:alpha(opacity=40);-moz-opacity:0.4\">"; } else { print "\">"; } print_pedigree_person($spouse, 1, $show_famlink, 9, $personcount); $personcount++; print "</td>\n"; // cousins if ($show_cousins) { print_cousins($famid, $personcount); $personcount++; } } } print "</tr>\n"; } } foreach ($newchildren as $indexval => $chil) { print "<tr >"; print "<td valign=\"top\" class=\"facts_valueblue\" style=\"width: " . $pbwidth . "px; height: " . $pbheight . "px;\">\n"; print_pedigree_person($chil, 1, $show_famlink, 0, $personcount); $personcount++; print "</td></tr>\n"; } foreach ($oldchildren as $indexval => $chil) { print "<tr >"; print "<td valign=\"top\" class=\"facts_valuered\" style=\"width: " . $pbwidth . "px; height: " . $pbheight . "px;\">\n"; print_pedigree_person($chil, 1, $show_famlink, 0, $personcount); $personcount++; print "</td></tr>\n"; } // message 'no children' except for sosa } else { if ($sosa < 1) { print "<tr><td></td><td valign=\"top\" >"; $nchi = ""; if (isset($pgv_changes[$famid . "_" . $GEDCOM])) { $famrec = find_updated_record($famid); } else { $famrec = find_family_record($famid); } $ct = preg_match("/1 NCHI (\\w+)/", $famrec, $match); if ($ct > 0) { $nchi = $match[1]; } else { $famrec = find_family_record($famid); $ct = preg_match("/1 NCHI (\\w+)/", $famrec, $match); if ($ct > 0) { $nchi = $match[1]; } } if ($nchi == "0") { print "<img src=\"images/small/childless.gif\" alt=\"" . $pgv_lang["childless_family"] . "\" title=\"" . $pgv_lang["childless_family"] . "\" /> " . $pgv_lang["childless_family"]; } else { print $pgv_lang["no_children"]; } print "</td></tr>"; } else { print "<tr>\n"; print_sosa_number($sosa, $childid); print "<td valign=\"top\">"; print_pedigree_person($childid, 1, $show_famlink, 0, $personcount); $personcount++; print "</td></tr>\n"; } } print "</table><br />"; if ($view != "preview" && $sosa == 0 && PGV_USER_CAN_EDIT) { print_help_link("add_child_help", "qm", "add_child_to_family"); print "<a href=\"javascript:;\" onclick=\"return addnewchild('{$famid}','');\">" . $pgv_lang["add_child_to_family"] . "</a>"; print "<span style='white-space:nowrap;'>"; print " <a href=\"javascript:;\" onclick=\"return addnewchild('{$famid}','M');\">[" . Person::sexImage('M', 'small', $pgv_lang['son']) . "]</a>"; print " <a href=\"javascript:;\" onclick=\"return addnewchild('{$famid}','F');\">[" . Person::sexImage('F', 'small', $pgv_lang['daughter']) . "]</a>"; print "</span>"; } }
print $d_logfile_str; } print "</td>"; print "</tr>"; // Row 6: Change Log File print "<tr>"; print "<td valign=\"top\">"; // Column 1 (row legend) print_text("ged_change"); print "</td>"; print "<td valign=\"top\">"; // Column 2 (notices) if (!isset($CHANGELOG_CREATE)) { print getLRM() . $pgv_lang["none"]; } else { print getLRM() . $pgv_lang[$CHANGELOG_CREATE]; } print "</td>"; print "<td colspan=\"5\" valign=\"top\">"; // Columns 3-7 (file name selector) // Get the logfiles if (!isset($logfilename)) { $logfilename = ""; } $file_nr = 0; if (isset($dir_array)) { unset($dir_array); } $dir_var = opendir($INDEX_DIRECTORY); while ($file = readdir($dir_var)) { if (strpos($file, ".log") > 0 && strstr($file, "ged-" . $ged_name) !== false) {
?> </td> <td class="list_value"><input type="checkbox" name="convert" value="yes" /></td></tr> <tr><td class="descriptionbox width50 wrap"><?php print_help_link("remove_tags_help", "qm"); print $pgv_lang["remove_custom_tags"]; ?> </td> <td class="list_value"><input type="checkbox" name="remove" value="yes" checked="checked" /></td></tr> <tr><td class="descriptionbox width50 wrap"><?php print_help_link("convertPath_help", "qm"); print $pgv_lang["convertPath"]; ?> </td> <td class="list_value"><input type="text" name="conv_path" size="30" value="<?php echo getLRM(), $conv_path, getLRM(); ?> " /></td></tr> <tr><td class="descriptionbox width50 wrap"><?php print_help_link("convertSlashes_help", "qm"); print $pgv_lang["convertSlashes"]; ?> </td> <td class="list_value"> <input type="radio" name="conv_slashes" value="forward" <?php if ($conv_slashes == 'forward') { print "checked=\"checked\" "; } ?> /> <?php print $pgv_lang["forwardSlashes"];
<td class="optionbox"><input type="checkbox" name="convert" value="yes" /></td></tr> <tr><td class="descriptionbox width50 wrap"><?php print_help_link("remove_tags_help", "qm"); print $pgv_lang["remove_custom_tags"]; ?> </td> <td class="optionbox"><input type="checkbox" name="remove" value="yes" checked="checked" /></td></tr> <tr><td class="descriptionbox width50 wrap"><?php print_help_link("convertPath_help", "qm"); print $pgv_lang["convertPath"]; ?> </td> <td class="list_value"><input type="text" name="conv_path" size="30" value="<?php echo getLRM(), $controller->conv_path, getLRM(); ?> " /></td></tr> <tr><td class="descriptionbox width50 wrap"><?php print_help_link("convertSlashes_help", "qm"); print $pgv_lang["convertSlashes"]; ?> </td> <td class="list_value"> <input type="radio" name="conv_slashes" value="forward" <?php if ($controller->conv_slashes == 'forward') { print "checked=\"checked\" "; } ?> /> <?php
} } } $newcol = ceil($count / $col); print "<td class=\"list_label\" colspan=\"{$col}\">"; print $TableTitle; print "</td></tr><tr>\n"; print "<td class=\"list_value\" style=\"padding: 14px;\">\n"; foreach ($surnames as $surname => $namecount) { if (begRTLText($namecount["name"])) { print "<div class =\"rtl\" dir=\"rtl\"> <a href=\"aliveinyear.php?year={$year}&alpha=" . $alpha . "&surname_sublist={$surname_sublist}&surname=" . urlencode($namecount["name"]) . "\"> " . PrintReady($namecount["name"]) . getRLM() . " - [" . $namecount["match"] . "]" . getRLM(); } else { if (substr($namecount["name"], 0, 5) == "@N.N.") { print "<div class =\"ltr\" dir=\"ltr\"> <a href=\"aliveinyear.php?year={$year}&alpha=" . $namecount["alpha"] . "&surname_sublist={$surname_sublist}&surname=@N.N.\"> " . $pgv_lang["NN"] . getLRM() . " - [" . $namecount["match"] . "]" . getLRM() . " "; } else { print "<div class =\"ltr\" dir=\"ltr\"> <a href=\"aliveinyear.php?year={$year}&alpha=" . $alpha . "&surname_sublist={$surname_sublist}&surname=" . urlencode($namecount["name"]) . "\">" . PrintReady($namecount["name"]) . getLRM() . " - [" . $namecount["match"] . "]" . getLRM(); } } print "</a> </div>\n"; $count_indi += $namecount["match"]; $i++; if ($i == $newcol && $i < $count) { print "</td><td class=\"list_value\" style=\"padding: 14px;\">\n"; $newcol = $i + ceil($count / $col); } } print "</td>\n"; print "</tr><tr><td colspan=\"{$col}\" align=\"center\"> "; if ($SHOW_MARRIED_NAMES && $count > 1) { print $pgv_lang["total_names"] . " " . $count_indi; }
function print_user_messages($block = true, $config = "", $side, $index) { global $pgv_lang, $PGV_IMAGE_DIR, $TEXT_DIRECTION, $PGV_STORE_MESSAGES, $PGV_IMAGES; $usermessages = getUserMessages(PGV_USER_NAME); $id = "user_messages"; $title = print_help_link("mygedview_message_help", "qm", "", false, true); $title .= $pgv_lang["my_messages"] . " "; if ($TEXT_DIRECTION == "rtl") { $title .= getRLM(); } $title .= "(" . count($usermessages) . ")"; if ($TEXT_DIRECTION == "rtl") { $title .= getRLM(); } $content = ""; $content .= "<form name=\"messageform\" action=\"\" onsubmit=\"return confirm('" . $pgv_lang["confirm_message_delete"] . "');\">"; if (count($usermessages) == 0) { $content .= $pgv_lang["no_messages"] . "<br />"; } else { $content .= ' <script language="JavaScript" type="text/javascript"> <!-- function select_all() { '; foreach ($usermessages as $key => $message) { if (isset($message["id"])) { $key = $message["id"]; } $content .= ' var cb = document.getElementById("cb_message' . $key . '"); if (cb) { if (!cb.checked) cb.checked = true; else cb.checked = false; } '; } $content .= ' return false; } //--> </script> '; $content .= "<input type=\"hidden\" name=\"action\" value=\"deletemessage\" />"; $content .= "<table class=\"list_table\"><tr>"; $content .= "<td class=\"list_label\">" . $pgv_lang["delete"] . "<br /><a href=\"javascript:;\" onclick=\"return select_all();\">" . $pgv_lang["all"] . "</a></td>"; $content .= "<td class=\"list_label\">" . $pgv_lang["message_subject"] . "</td>"; $content .= "<td class=\"list_label\">" . $pgv_lang["date_created"] . "</td>"; $content .= "<td class=\"list_label\">" . $pgv_lang["message_from"] . "</td>"; $content .= "</tr>"; foreach ($usermessages as $key => $message) { if (isset($message["id"])) { $key = $message["id"]; } $content .= "<tr>"; $content .= "<td class=\"list_value_wrap\"><input type=\"checkbox\" id=\"cb_message{$key}\" name=\"message_id[]\" value=\"{$key}\" /></td>"; $showmsg = preg_replace("/(\\w)\\/(\\w)/", "\$1/<span style=\"font-size:1px;\"> </span>\$2", PrintReady($message["subject"])); $showmsg = str_replace("@", "@<span style=\"font-size:1px;\"> </span>", $showmsg); $content .= "<td class=\"list_value_wrap\"><a href=\"javascript:;\" onclick=\"expand_layer('message{$key}'); return false;\"><img id=\"message{$key}_img\" src=\"" . $PGV_IMAGE_DIR . "/" . $PGV_IMAGES["plus"]["other"] . "\" border=\"0\" alt=\"" . $pgv_lang["show_details"] . "\" title=\"" . $pgv_lang["show_details"] . "\" /> <b>" . $showmsg . "</b></a></td>"; if (!empty($message["created"])) { $time = strtotime($message["created"]); } else { $time = time(); } $content .= "<td class=\"list_value_wrap\">" . format_timestamp($time) . "</td>"; $content .= "<td class=\"list_value_wrap\">"; $user_id = get_user_id($message["from"]); if ($user_id) { $content .= PrintReady(getUserFullName($user_id)); if ($TEXT_DIRECTION == "ltr") { $content .= " " . getLRM() . " - " . htmlspecialchars($user_id, ENT_COMPAT, 'UTF-8') . getLRM(); } else { $content .= " " . getRLM() . " - " . htmlspecialchars($user_id, ENT_COMPAT, 'UTF-8') . getRLM(); } } else { $content .= "<a href=\"mailto:" . $message["from"] . "\">" . str_replace("@", "@<span style=\"font-size:1px;\"> </span>", $message["from"]) . "</a>"; } $content .= "</td>"; $content .= "</tr>"; $content .= "<tr><td class=\"list_value_wrap\" colspan=\"5\"><div id=\"message{$key}\" style=\"display: none;\">"; $message["body"] = nl2br(htmlspecialchars($message["body"], ENT_COMPAT, 'UTF-8')); $message["body"] = expand_urls($message["body"]); $content .= PrintReady($message["body"]) . "<br /><br />"; if (strpos($message["subject"], "RE:") === false) { $message["subject"] = "RE:" . $message["subject"]; } if ($user_id) { $content .= "<a href=\"javascript:;\" onclick=\"reply('" . $user_id . "', '" . $message["subject"] . "'); return false;\">" . $pgv_lang["reply"] . "</a> | "; } $content .= "<a href=\"" . encode_url("index.php?action=deletemessage&message_id={$key}") . "\" onclick=\"return confirm('" . $pgv_lang["confirm_message_delete"] . "');\">" . $pgv_lang["delete"] . "</a></div></td></tr>"; } $content .= "</table>"; $content .= "<input type=\"submit\" value=\"" . $pgv_lang["delete_selected_messages"] . "\" /><br /><br />"; } if (get_user_count() > 1) { $content .= $pgv_lang["message"] . " <select name=\"touser\">"; if (PGV_USER_IS_ADMIN) { $content .= "<option value=\"all\">" . $pgv_lang["broadcast_all"] . "</option>"; $content .= "<option value=\"never_logged\">" . $pgv_lang["broadcast_never_logged_in"] . "</option>"; $content .= "<option value=\"last_6mo\">" . $pgv_lang["broadcast_not_logged_6mo"] . "</option>"; } foreach (get_all_users() as $user_id => $user_name) { if ($user_id != PGV_USER_ID && get_user_setting($user_id, 'verified_by_admin') == 'yes' && get_user_setting($user_id, 'contactmethod') != 'none') { $content .= "<option value=\"" . $user_name . "\">" . PrintReady(getUserFullName($user_id)) . " "; if ($TEXT_DIRECTION == "ltr") { $content .= stripLRMRLM(getLRM() . " - " . $user_name . getLRM()); } else { $content .= stripLRMRLM(getRLM() . " - " . $user_name . getRLM()); } $content .= "</option>"; } } $content .= "</select><input type=\"button\" value=\"" . $pgv_lang["send"] . "\" onclick=\"message(document.messageform.touser.options[document.messageform.touser.selectedIndex].value, 'messaging2', ''); return false;\" />"; } $content .= "</form>"; global $THEME_DIR; if ($block) { require $THEME_DIR . 'templates/block_small_temp.php'; } else { require $THEME_DIR . 'templates/block_main_temp.php'; } }
static function userMessages() { global $pgv_lang, $PGV_IMAGE_DIR, $TEXT_DIRECTION, $PGV_STORE_MESSAGES, $PGV_IMAGES; $usermessages = getUserMessages(PGV_USER_NAME); $content = "<form name=\"messageform\" action=\"\" onsubmit=\"return confirm('{$pgv_lang['confirm_message_delete']}');\">"; if (count($usermessages) == 0) { $content .= "{$pgv_lang['no_messages']}<br />\n"; } else { $content .= ' <script language="JavaScript" type="text/javascript"> <!-- function select_all() { '; foreach ($usermessages as $k => $message) { if (isset($message['id'])) { $k = $message['id']; } $content .= ' var cb = document.getElementById("cb_message' . $k . '"); if (cb) { if (!cb.checked) cb.checked = true; else cb.checked = false; } '; } $content .= ' return false; } //--> </script> '; $content .= '<input type="hidden" name="action" value="deletemessage" />' . '<table class="list_table"><tr>' . "<td class=\"list_label\">{$pgv_lang['delete']}<br />\n<a href=\"javascript:;\" onclick=\"return select_all();\">{$pgv_lang['all']}</a></td>\n" . "<td class=\"list_label\">{$pgv_lang['message_subject']}</td>\n" . "<td class=\"list_label\">{$pgv_lang['date_created']}</td>\n" . "<td class=\"list_label\">{$pgv_lang['message_from']}</td>\n" . "</tr>\n"; foreach ($usermessages as $k => $message) { if (isset($message['id'])) { $k = $message['id']; } $content .= "<tr>\n<td class=\"list_value_wrap\"><input type=\"checkbox\" id=\"cb_message{$k}\" name=\"message_id[]\" value=\"{$k}\" /></td>\n"; $showmsg = preg_replace("/(\\w)\\/(\\w)/", "\$1/<span style=\"font-size:1px;\"> </span>\$2", PrintReady($message['subject'])); $showmsg = preg_replace("/@/", "@<span style=\"font-size:1px;\"> </span>", $showmsg); $content .= "<td class=\"list_value_wrap\"><a href=\"javascript:;\" onclick=\"expand_layer('message{$k}'); return false;\"><b>{$showmsg}</b> <img id=\"message{$k}_img\" src=\"{$PGV_IMAGE_DIR}/{$PGV_IMAGES['plus']['other']}\" border=\"0\" alt=\"\" title=\"\" /></a></td>\n"; if (!empty($message['created'])) { $t = strtotime($message['created']); } else { $t = time(); } $content .= '<td class="list_value_wrap">' . format_timestamp($t) . "</td>\n" . '<td class="list_value_wrap">'; $user_id = get_user_id($message['from']); if ($user_id) { $content .= PrintReady(getUserFullName($user_id)); if ($TEXT_DIRECTION == 'ltr') { $content .= ' ' . getLRM() . ' - ' . htmlspecialchars($user_id, ENT_COMPAT, 'UTF-8') . getLRM(); } else { $content .= ' ' . getRLM() . ' - ' . htmlspecialchars($user_id, ENT_COMPAT, 'UTF-8') . getRLM(); } } else { $content .= "<a href=\"mailto:{$user_id}\">" . preg_replace("/@/", "@<span style=\"font-size:1px;\"> </span>", $user_id) . '</a>'; } $content .= "</td>\n" . "</tr>\n" . "<tr>\n<td class=\"list_value_wrap\" colspan=\"5\"><div id=\"message{$k}\" style=\"display: none;\">"; $message['body'] = expand_urls(nl2br(htmlspecialchars($message['body'], ENT_COMPAT, 'UTF-8'))); $content .= PrintReady($message['body']) . "<br />\n<br />\n"; if (preg_match("/RE:/", $message["subject"]) == 0) { $message['subject'] = "RE:{$message['subject']}"; } if ($user_id) { $content .= "<a href=\"javascript:;\" onclick=\"reply('{$user_id}', '{$message['subject']}'); return false;\">{$pgv_lang['reply']}</a> | "; } $content .= "<a href=\"" . encode_url("index.php?action=deletemessage&message_id={$k}") . "\" onclick=\"return confirm('{$pgv_lang['confirm_message_delete']}');\">{$pgv_lang['delete']}</a></div></td>\n</tr>\n"; } $content .= "</table>\n" . "<input type=\"submit\" value=\"{$pgv_lang['delete_selected_messages']}\" /><br />\n<br />\n"; } if (get_user_count() > 1) { $content .= "{$pgv_lang['message']} <select name=\"touser\">"; if (PGV_USER_IS_ADMIN) { $content .= "<option value=\"all\">{$pgv_lang['broadcast_all']}</option>\n" . "<option value=\"never_logged\">{$pgv_lang['broadcast_never_logged_in']}</option>\n" . "<option value=\"last_6mo\">{$pgv_lang['broadcast_not_logged_6mo']}</option>\n"; } foreach (get_all_users() as $user_id => $user_name) { if ($user_id != PGV_USER_ID && get_user_setting($user_id, 'verified_by_admin') == 'yes') { $content .= "<option value=\"{$user_id}\">" . PrintReady(getUserFullName($user_id)) . ' '; if ($TEXT_DIRECTION == 'ltr') { $content .= getLRM() . " - {$user_id}" . getLRM(); } else { $content .= getRLM() . " - {$user_id}" . getRLM(); } $content .= "</option>\n"; } } $content .= "</select>\n<input type=\"button\" value=\"{$pgv_lang['send']}\" onclick=\"message(document.messageform.touser.options[document.messageform.touser.selectedIndex].value, 'messaging2', ''); return false;\" />\n"; } $content .= "</form>\n"; return $content; }
<tr class="<?php print $TEXT_DIRECTION; ?> "> <td class="optionbox"> <input type="checkbox" name="v_user_privacy_del[<?php print $key; ?> ][<?php print $id; ?> ]" value="1" /> </td> <td class="optionbox"> <?php echo $key, '<br />', getLRM(), '(', getUserFullName($key), ')', getLRM(); ?> </td> <td class="optionbox"> <?php print $id; ?> </td> <td class="optionbox"> <?php search_ID_details($id, 2); ?> </td> <td class="optionbox"> <select size="1" name="v_user_privacy[<?php print $key;