示例#1
0
     foreach ($value as $tag => $value1) {
         foreach ($value1 as $key => $setting) {
             if (isset($v_person_facts_del[$id][$tag][$key]) || $id == $v_new_person_facts_access_ID && $tag == $v_new_person_facts_abbr && $key == $v_new_person_facts_choice) {
                 continue;
             }
             if (isset($v_person_facts[$id][$tag][$key])) {
                 $person_privacy_text .= "\$person_facts['{$id}']['{$tag}']['{$key}'] = " . $v_person_facts[$id][$tag][$key] . ";\n";
             } else {
                 $person_privacy_text .= "\$person_facts['{$id}']['{$tag}']['{$key}'] = " . $PRIVACY_CONSTANTS[$setting] . ";\n";
             }
         }
     }
 }
 if ($v_new_person_facts_access_ID && $v_new_person_facts_abbr && $v_new_global_facts_choice && $v_new_global_facts_access_option) {
     $gedobj = new GedcomRecord(find_gedcom_record($v_new_person_facts_access_ID, PGV_GED_ID));
     $v_new_person_facts_access_ID = $gedobj->getXref();
     if ($v_new_person_facts_access_ID) {
         $person_privacy_text .= "\$person_facts['{$v_new_person_facts_access_ID}']['{$v_new_person_facts_abbr}']['{$v_new_person_facts_choice}'] = " . $v_new_person_facts_access_option . ";\n";
     }
 }
 $configtext = $configtext_beg . $person_privacy_text . $configtext_end;
 $PRIVACY_MODULE = $INDEX_DIRECTORY . $GEDCOM . "_priv.php";
 $fp = @fopen($PRIVACY_MODULE, "wb");
 if (!$fp) {
     global $whichFile;
     $whichFile = $PRIVACY_MODULE;
     print "<span class=\"error\">" . print_text("gedcom_config_write_error", 0, 1) . "<br /></span>\n";
 } else {
     fwrite($fp, $configtext);
     fclose($fp);
 }