diff options
| author | Scrutinizer Auto-Fixer <auto-fixer@scrutinizer-ci.com> | 2015-01-18 21:18:16 +0000 |
|---|---|---|
| committer | Scrutinizer Auto-Fixer <auto-fixer@scrutinizer-ci.com> | 2015-01-18 21:18:16 +0000 |
| commit | 8c1c5406bfd0c0d3e0526697389651cd77974ce1 (patch) | |
| tree | 6c91418d6f4ef1adbcbe2e32c9c337c4201bbcd1 | |
| parent | 82244a930056640180f4ca7c4203b7b5f6119cc6 (diff) | |
| download | webtrees-8c1c5406bfd0c0d3e0526697389651cd77974ce1.tar.gz webtrees-8c1c5406bfd0c0d3e0526697389651cd77974ce1.tar.bz2 webtrees-8c1c5406bfd0c0d3e0526697389651cd77974ce1.zip | |
Scrutinizer Auto-Fixes
This commit consists of patches automatically generated for this project on https://scrutinizer-ci.com
| -rw-r--r-- | includes/functions/functions_print_facts.php | 222 | ||||
| -rw-r--r-- | modules_v3/GEDFact_assistant/_CENS/addnoteaction_assisted.php | 22 | ||||
| -rw-r--r-- | modules_v3/GEDFact_assistant/_CENS/census_3_find.php | 66 | ||||
| -rw-r--r-- | modules_v3/GEDFact_assistant/_MEDIA/media_0_inverselink.php | 26 | ||||
| -rw-r--r-- | modules_v3/GEDFact_assistant/_MEDIA/media_1_ctrl.php | 104 | ||||
| -rw-r--r-- | modules_v3/GEDFact_assistant/module.php | 36 | ||||
| -rw-r--r-- | modules_v3/batch_update/plugins/married_names.php | 30 | ||||
| -rw-r--r-- | modules_v3/charts/module.php | 48 | ||||
| -rw-r--r-- | modules_v3/clippings/clippings_ctrl.php | 124 | ||||
| -rw-r--r-- | modules_v3/clippings/module.php | 212 | ||||
| -rw-r--r-- | modules_v3/families/module.php | 66 | ||||
| -rw-r--r-- | modules_v3/faq/help_text.php | 34 | ||||
| -rw-r--r-- | modules_v3/gedcom_favorites/module.php | 100 | ||||
| -rw-r--r-- | modules_v3/gedcom_stats/module.php | 206 | ||||
| -rw-r--r-- | modules_v3/googlemap/help_text.php | 62 | ||||
| -rw-r--r-- | modules_v3/html/module.php | 112 | ||||
| -rw-r--r-- | modules_v3/personal_facts/module.php | 76 | ||||
| -rw-r--r-- | modules_v3/random_media/module.php | 188 |
18 files changed, 867 insertions, 867 deletions
diff --git a/includes/functions/functions_print_facts.php b/includes/functions/functions_print_facts.php index 6bea4ea0a0..33e9b54946 100644 --- a/includes/functions/functions_print_facts.php +++ b/includes/functions/functions_print_facts.php @@ -41,7 +41,7 @@ use WT\User; */ function print_fact(WT_Fact $fact, WT_GedcomRecord $record) { global $HIDE_GEDCOM_ERRORS, $SHOW_FACT_ICONS; - static $n_chil=0, $n_gchi=0; + static $n_chil = 0, $n_gchi = 0; $parent = $fact->getParent(); @@ -80,11 +80,11 @@ function print_fact(WT_Fact $fact, WT_GedcomRecord $record) { $label_person = $fact->getParent()->getSpouse($record); } else { // Individual event - $label_person=$parent; + $label_person = $parent; } // New or deleted facts need different styling - $styleadd=''; + $styleadd = ''; if ($fact->isPendingAddition()) { $styleadd = 'new'; } @@ -98,20 +98,20 @@ function print_fact(WT_Fact $fact, WT_GedcomRecord $record) { } // Event of close associates - if ($fact->getFactId()=='asso') { + if ($fact->getFactId() == 'asso') { $styleadd = trim($styleadd . ' rela'); } // historical facts - if ($fact->getFactId()=='histo') { + if ($fact->getFactId() == 'histo') { $styleadd = trim($styleadd . ' histo'); } // Does this fact have a type? if (preg_match('/\n2 TYPE (.+)/', $fact->getGedcom(), $match)) { - $type=$match[1]; + $type = $match[1]; } else { - $type=''; + $type = ''; } switch ($fact->getTag()) { @@ -134,7 +134,7 @@ function print_fact(WT_Fact $fact, WT_GedcomRecord $record) { // This is a hack for a proprietory extension. Is it still used/needed? $utype = strtoupper($type); if ($utype == 'CIVIL' || $utype == 'PARTNERS' || $utype == 'RELIGIOUS') { - $label = WT_Gedcom_Tag::getLabel('MARR_'.$utype, $label_person); + $label = WT_Gedcom_Tag::getLabel('MARR_' . $utype, $label_person); $type = ''; // Do not print this again } else { $label = $fact->getLabel(); @@ -153,7 +153,7 @@ function print_fact(WT_Fact $fact, WT_GedcomRecord $record) { echo Theme::theme()->icon($fact), ' '; } - if ($fact->getFactId()!='histo' && $fact->canEdit()) { + if ($fact->getFactId() != 'histo' && $fact->canEdit()) { ?> <a href="#" @@ -266,7 +266,7 @@ function print_fact(WT_Fact $fact, WT_GedcomRecord $record) { echo '<div class="field">', WT_Filter::expandUrls($fact->getValue()), '</div>'; break; case 'REPO': - if (preg_match('/^@('.WT_REGEX_XREF.')@$/', $fact->getValue(), $match)) { + if (preg_match('/^@(' . WT_REGEX_XREF . ')@$/', $fact->getValue(), $match)) { print_repository_record($match[1]); } else { echo '<div class="error">', WT_Filter::escapeHtml($fact->getValue()), '</div>'; @@ -294,8 +294,8 @@ function print_fact(WT_Fact $fact, WT_GedcomRecord $record) { // Do not display "Yes". break; default: - if (preg_match('/^@('.WT_REGEX_XREF.')@$/', $fact->getValue(), $match)) { - $target=WT_GedcomRecord::getInstance($match[1]); + if (preg_match('/^@(' . WT_REGEX_XREF . ')@$/', $fact->getValue(), $match)) { + $target = WT_GedcomRecord::getInstance($match[1]); if ($target) { echo '<div><a href="', $target->getHtmlUrl(), '">', $target->getFullName(), '</a></div>'; } else { @@ -315,7 +315,7 @@ function print_fact(WT_Fact $fact, WT_GedcomRecord $record) { // Events of close relatives, e.g. _MARR_CHIL if (substr($fact->getTag(), 0, 6) == '_MARR_' && ($utype == 'CIVIL' || $utype == 'PARTNERS' || $utype == 'RELIGIOUS')) { // Translate MARR/TYPE using the code that supports MARR_CIVIL, etc. tags - $type = WT_Gedcom_Tag::getLabel('MARR_'.$utype); + $type = WT_Gedcom_Tag::getLabel('MARR_' . $utype); } else { // Allow (custom) translations for other types $type = WT_I18N::translate($type); @@ -340,7 +340,7 @@ function print_fact(WT_Fact $fact, WT_GedcomRecord $record) { echo format_asso_rela_record($fact); // Print any other "2 XXXX" attributes, in the order in which they appear. - preg_match_all('/\n2 ('.WT_REGEX_TAG.') (.+)/', $fact->getGedcom(), $matches, PREG_SET_ORDER); + preg_match_all('/\n2 (' . WT_REGEX_TAG . ') (.+)/', $fact->getGedcom(), $matches, PREG_SET_ORDER); foreach ($matches as $match) { switch ($match[1]) { case 'DATE': @@ -366,17 +366,17 @@ function print_fact(WT_Fact $fact, WT_GedcomRecord $record) { // These will be shown at the end break; case 'EVEN': // 0 SOUR / 1 DATA / 2 EVEN / 3 DATE / 3 PLAC - $events=array(); + $events = array(); foreach (preg_split('/ *, */', $match[2]) as $event) { - $events[]=WT_Gedcom_Tag::getLabel($event); + $events[] = WT_Gedcom_Tag::getLabel($event); } - if (count($events)==1) { + if (count($events) == 1) { echo WT_Gedcom_Tag::getLabelValue('EVEN', $event); } else { echo WT_Gedcom_Tag::getLabelValue('EVEN', implode(WT_I18N::$list_separator, $events)); } if (preg_match('/\n3 DATE (.+)/', $fact->getGedcom(), $date_match)) { - $date=new WT_Date($date_match[1]); + $date = new WT_Date($date_match[1]); echo WT_Gedcom_Tag::getLabelValue('DATE', $date->display()); } if (preg_match('/\n3 PLAC (.+)/', $fact->getGedcom(), $plac_match)) { @@ -386,12 +386,12 @@ function print_fact(WT_Fact $fact, WT_GedcomRecord $record) { case 'FAMC': // 0 INDI / 1 ADOP / 2 FAMC / 3 ADOP $family = WT_Family::getInstance(str_replace('@', '', $match[2])); if ($family) { - echo WT_Gedcom_Tag::getLabelValue('FAM', '<a href="'.$family->getHtmlUrl().'">'.$family->getFullName().'</a>'); + echo WT_Gedcom_Tag::getLabelValue('FAM', '<a href="' . $family->getHtmlUrl() . '">' . $family->getFullName() . '</a>'); if (preg_match('/\n3 ADOP (HUSB|WIFE|BOTH)/', $fact->getGedcom(), $match)) { echo WT_Gedcom_Tag::getLabelValue('ADOP', WT_Gedcom_Code_Adop::getValue($match[1], $label_person)); } } else { - echo WT_Gedcom_Tag::getLabelValue('FAM', '<span class="error">'.$match[2].'</span>'); + echo WT_Gedcom_Tag::getLabelValue('FAM', '<span class="error">' . $match[2] . '</span>'); } break; case '_WT_USER': @@ -407,16 +407,16 @@ function print_fact(WT_Fact $fact, WT_GedcomRecord $record) { case 'none': // Note: "2 RESN none" is not valid gedcom. // However, webtrees privacy rules will interpret it as "show an otherwise private fact to public". - echo WT_Gedcom_Tag::getLabelValue('RESN', '<i class="icon-resn-none"></i> '.WT_I18N::translate('Show to visitors')); + echo WT_Gedcom_Tag::getLabelValue('RESN', '<i class="icon-resn-none"></i> ' . WT_I18N::translate('Show to visitors')); break; case 'privacy': - echo WT_Gedcom_Tag::getLabelValue('RESN', '<i class="icon-resn-privacy"></i> '.WT_I18N::translate('Show to members')); + echo WT_Gedcom_Tag::getLabelValue('RESN', '<i class="icon-resn-privacy"></i> ' . WT_I18N::translate('Show to members')); break; case 'confidential': - echo WT_Gedcom_Tag::getLabelValue('RESN', '<i class="icon-resn-confidential"></i> '.WT_I18N::translate('Show to managers')); + echo WT_Gedcom_Tag::getLabelValue('RESN', '<i class="icon-resn-confidential"></i> ' . WT_I18N::translate('Show to managers')); break; case 'locked': - echo WT_Gedcom_Tag::getLabelValue('RESN', '<i class="icon-resn-locked"></i> '.WT_I18N::translate('Only managers can edit')); + echo WT_Gedcom_Tag::getLabelValue('RESN', '<i class="icon-resn-locked"></i> ' . WT_I18N::translate('Only managers can edit')); break; default: echo WT_Gedcom_Tag::getLabelValue('RESN', WT_Filter::escapeHtml($match[2])); @@ -436,7 +436,7 @@ function print_fact(WT_Fact $fact, WT_GedcomRecord $record) { case '_URL': case 'WWW': $link = '<a href="' . WT_Filter::escapeHtml($match[2]) . '">' . WT_Filter::escapeHtml($match[2]) . '</a>'; - echo WT_Gedcom_Tag::getLabelValue($fact->getTag().':'.$match[1], $link); + echo WT_Gedcom_Tag::getLabelValue($fact->getTag() . ':' . $match[1], $link); break; default: if (!$HIDE_GEDCOM_ERRORS || WT_Gedcom_Tag::isTag($match[1])) { @@ -444,14 +444,14 @@ function print_fact(WT_Fact $fact, WT_GedcomRecord $record) { // Links $linked_record = WT_GedcomRecord::getInstance($xmatch[1]); if ($linked_record) { - $link = '<a href="' .$linked_record->getHtmlUrl() . '">' . $linked_record->getFullName() . '</a>'; - echo WT_Gedcom_Tag::getLabelValue($fact->getTag().':'.$match[1], $link); + $link = '<a href="' . $linked_record->getHtmlUrl() . '">' . $linked_record->getFullName() . '</a>'; + echo WT_Gedcom_Tag::getLabelValue($fact->getTag() . ':' . $match[1], $link); } else { - echo WT_Gedcom_Tag::getLabelValue($fact->getTag().':'.$match[1], WT_Filter::escapeHtml($match[2])); + echo WT_Gedcom_Tag::getLabelValue($fact->getTag() . ':' . $match[1], WT_Filter::escapeHtml($match[2])); } } else { // Non links - echo WT_Gedcom_Tag::getLabelValue($fact->getTag().':'.$match[1], WT_Filter::escapeHtml($match[2])); + echo WT_Gedcom_Tag::getLabelValue($fact->getTag() . ':' . $match[1], WT_Filter::escapeHtml($match[2])); } } break; @@ -471,7 +471,7 @@ function print_fact(WT_Fact $fact, WT_GedcomRecord $record) { * @param string $xref the Gedcom Xref ID of the repository to print */ function print_repository_record($xref) { - $repository=WT_Repository::getInstance($xref); + $repository = WT_Repository::getInstance($xref); if ($repository && $repository->canShow()) { echo '<a class="field" href="', $repository->getHtmlUrl(), '">', $repository->getFullName(), '</a><br>'; echo '<br>'; @@ -494,43 +494,43 @@ function print_fact_sources($factrec, $level) { global $EXPAND_SOURCES; $data = ''; - $nlevel = $level+1; + $nlevel = $level + 1; // -- Systems not using source records [ 1046971 ] $ct = preg_match_all("/$level SOUR (.*)/", $factrec, $match, PREG_SET_ORDER); - for ($j=0; $j<$ct; $j++) { - if (strpos($match[$j][1], '@')===false) { - $data .= '<div class="fact_SOUR"><span class="label">'.WT_I18N::translate('Source').':</span> <span class="field" dir="auto">'.WT_Filter::escapeHtml($match[$j][1]).'</span></div>'; + for ($j = 0; $j < $ct; $j++) { + if (strpos($match[$j][1], '@') === false) { + $data .= '<div class="fact_SOUR"><span class="label">' . WT_I18N::translate('Source') . ':</span> <span class="field" dir="auto">' . WT_Filter::escapeHtml($match[$j][1]) . '</span></div>'; } } // -- find source for each fact $ct = preg_match_all("/$level SOUR @(.*)@/", $factrec, $match, PREG_SET_ORDER); $spos2 = 0; - for ($j=0; $j<$ct; $j++) { + for ($j = 0; $j < $ct; $j++) { $sid = $match[$j][1]; - $source=WT_Source::getInstance($sid); + $source = WT_Source::getInstance($sid); if ($source) { if ($source->canShow()) { - $spos1 = strpos($factrec, "$level SOUR @".$sid."@", $spos2); + $spos1 = strpos($factrec, "$level SOUR @" . $sid . "@", $spos2); $spos2 = strpos($factrec, "\n$level", $spos1); if (!$spos2) { $spos2 = strlen($factrec); } - $srec = substr($factrec, $spos1, $spos2-$spos1); + $srec = substr($factrec, $spos1, $spos2 - $spos1); $lt = preg_match_all("/$nlevel \w+/", $srec, $matches); $data .= '<div class="fact_SOUR">'; $data .= '<span class="label">'; $elementID = Uuid::uuid4(); if ($EXPAND_SOURCES) { - $plusminus='icon-minus'; + $plusminus = 'icon-minus'; } else { - $plusminus='icon-plus'; + $plusminus = 'icon-plus'; } - if ($lt>0) { - $data .= '<a href="#" onclick="return expand_layer(\''.$elementID.'\');"><i id="'.$elementID.'_img" class="'.$plusminus.'"></i></a> '; + if ($lt > 0) { + $data .= '<a href="#" onclick="return expand_layer(\'' . $elementID . '\');"><i id="' . $elementID . '_img" class="' . $plusminus . '"></i></a> '; } - $data .= WT_I18N::translate('Source').':</span> <span class="field">'; - $data .= '<a href="'.$source->getHtmlUrl().'">'.$source->getFullName().'</a>'; + $data .= WT_I18N::translate('Source') . ':</span> <span class="field">'; + $data .= '<a href="' . $source->getHtmlUrl() . '">' . $source->getFullName() . '</a>'; $data .= '</span></div>'; $data .= "<div id=\"$elementID\""; @@ -558,7 +558,7 @@ function print_fact_sources($factrec, $level) { // http://webtrees.net/index.php/en/forum/3-help-for-beta-and-svn-versions/27002-source-media-privacy-issue } } else { - $data .= WT_Gedcom_Tag::getLabelValue('SOUR', '<span class="error">'.$sid.'</span>'); + $data .= WT_Gedcom_Tag::getLabelValue('SOUR', '<span class="error">' . $sid . '</span>'); } } @@ -574,7 +574,7 @@ function print_fact_sources($factrec, $level) { function print_media_links($factrec, $level) { global $SEARCH_SPIDER, $HIDE_GEDCOM_ERRORS; - $nlevel = $level+1; + $nlevel = $level + 1; if (preg_match_all("/$level OBJE @(.*)@/", $factrec, $omatch, PREG_SET_ORDER) == 0) { return; } @@ -599,15 +599,15 @@ function print_media_links($factrec, $level) { // NOTE: echo the notes of the media echo '<p>'; echo print_fact_notes($media->getGedcom(), 1); - $ttype = preg_match("/".($nlevel+1)." TYPE (.*)/", $media->getGedcom(), $match); - if ($ttype>0) { + $ttype = preg_match("/" . ($nlevel + 1) . " TYPE (.*)/", $media->getGedcom(), $match); + if ($ttype > 0) { $mediaType = WT_Gedcom_Tag::getFileFormTypeValue($match[1]); echo '<p class="label">', WT_I18N::translate('Type'), ': </span> <span class="field">', $mediaType, '</p>'; } echo '</p>'; //-- print spouse name for marriage events $ct = preg_match("/WT_SPOUSE: (.*)/", $factrec, $match); - if ($ct>0) { + if ($ct > 0) { $spouse = WT_Individual::getInstance($match[1]); if ($spouse) { echo '<a href="', $spouse->getHtmlUrl(), '">'; @@ -654,49 +654,49 @@ function print_main_sources(WT_Fact $fact, $level) { $parent = $fact->getParent(); $pid = $parent->getXref(); - $nlevel = $level+1; + $nlevel = $level + 1; if ($fact->isPendingAddition()) { $styleadd = 'new'; - $can_edit = $level==1 && $fact->canEdit(); + $can_edit = $level == 1 && $fact->canEdit(); } elseif ($fact->isPendingDeletion()) { - $styleadd='old'; + $styleadd = 'old'; $can_edit = false; } else { - $styleadd=''; - $can_edit = $level==1 && $fact->canEdit(); + $styleadd = ''; + $can_edit = $level == 1 && $fact->canEdit(); } // -- find source for each fact $ct = preg_match_all("/($level SOUR (.+))/", $factrec, $match, PREG_SET_ORDER); $spos2 = 0; - for ($j=0; $j<$ct; $j++) { + for ($j = 0; $j < $ct; $j++) { $sid = trim($match[$j][2], '@'); $spos1 = strpos($factrec, $match[$j][1], $spos2); $spos2 = strpos($factrec, "\n$level", $spos1); if (!$spos2) { $spos2 = strlen($factrec); } - $srec = substr($factrec, $spos1, $spos2-$spos1); - $source=WT_Source::getInstance($sid); + $srec = substr($factrec, $spos1, $spos2 - $spos1); + $source = WT_Source::getInstance($sid); // Allow access to "1 SOUR @non_existent_source@", so it can be corrected/deleted if (!$source || $source->canShow()) { - if ($level>1) { + if ($level > 1) { echo '<tr class="row_sour2">'; } else { echo '<tr>'; } echo '<td class="descriptionbox'; - if ($level>1) { + if ($level > 1) { echo ' rela'; } echo ' ', $styleadd, ' width20">'; $factlines = explode("\n", $factrec); // 1 BIRT Y\n2 SOUR ... $factwords = explode(" ", $factlines[0]); // 1 BIRT Y $factname = $factwords[1]; // BIRT - if ($factname == 'EVEN' || $factname=='FACT') { + if ($factname == 'EVEN' || $factname == 'FACT') { // Add ' EVEN' to provide sensible output for an event with an empty TYPE record $ct = preg_match("/2 TYPE (.*)/", $factrec, $ematch); - if ($ct>0) { + if ($ct > 0) { $factname = trim($ematch[1]); echo $factname; } else { @@ -706,7 +706,7 @@ function print_main_sources(WT_Fact $fact, $level) { if ($can_edit) { echo "<a onclick=\"return edit_record('$pid', '$fact_id');\" href=\"#\" title=\"", WT_I18N::translate('Edit'), '">'; if ($SHOW_FACT_ICONS) { - if ($level==1) { + if ($level == 1) { echo '<i class="icon-source"></i> '; } } @@ -716,10 +716,10 @@ function print_main_sources(WT_Fact $fact, $level) { // Inline sources can't be edited. Attempting to save one will convert it // into a link, and delete it. // e.g. "1 SOUR my source" becomes "1 SOUR @my source@" which does not exist. - echo "<div class=\"editlink\"><a class=\"editicon\" onclick=\"return edit_record('$pid', '$fact_id');\" href=\"#\" title=\"".WT_I18N::translate('Edit')."\"><span class=\"link_text\">".WT_I18N::translate('Edit')."</span></a></div>"; - echo '<div class="copylink"><a class="copyicon" href="#" onclick="return copy_fact(\'', $pid, '\', \'', $fact_id, '\');" title="'.WT_I18N::translate('Copy').'"><span class="link_text">'.WT_I18N::translate('Copy').'</span></a></div>'; + echo "<div class=\"editlink\"><a class=\"editicon\" onclick=\"return edit_record('$pid', '$fact_id');\" href=\"#\" title=\"" . WT_I18N::translate('Edit') . "\"><span class=\"link_text\">" . WT_I18N::translate('Edit') . "</span></a></div>"; + echo '<div class="copylink"><a class="copyicon" href="#" onclick="return copy_fact(\'', $pid, '\', \'', $fact_id, '\');" title="' . WT_I18N::translate('Copy') . '"><span class="link_text">' . WT_I18N::translate('Copy') . '</span></a></div>'; } - echo "<div class=\"deletelink\"><a class=\"deleteicon\" onclick=\"return delete_fact('".WT_I18N::translate('Are you sure you want to delete this fact?')."', '$pid', '$fact_id');\" href=\"#\" title=\"".WT_I18N::translate('Delete')."\"><span class=\"link_text\">".WT_I18N::translate('Delete')."</span></a></div>"; + echo "<div class=\"deletelink\"><a class=\"deleteicon\" onclick=\"return delete_fact('" . WT_I18N::translate('Are you sure you want to delete this fact?') . "', '$pid', '$fact_id');\" href=\"#\" title=\"" . WT_I18N::translate('Delete') . "\"><span class=\"link_text\">" . WT_I18N::translate('Delete') . "</span></a></div>"; echo '</div>'; } else { echo WT_Gedcom_Tag::getLabel($factname, $parent); @@ -760,21 +760,21 @@ function print_main_sources(WT_Fact $fact, $level) { } } $cs = preg_match("/$nlevel EVEN (.*)/", $srec, $cmatch); - if ($cs>0) { + if ($cs > 0) { echo '<br><span class="label">', WT_Gedcom_Tag::getLabel('EVEN'), ' </span><span class="field">', $cmatch[1], '</span>'; - $cs = preg_match("/".($nlevel+1)." ROLE (.*)/", $srec, $cmatch); - if ($cs>0) { + $cs = preg_match("/" . ($nlevel + 1) . " ROLE (.*)/", $srec, $cmatch); + if ($cs > 0) { echo '<br> <span class="label">', WT_Gedcom_Tag::getLabel('ROLE'), ' </span><span class="field">', $cmatch[1], '</span>'; } } echo printSourceStructure(getSourceStructure($srec)); echo '<div class="indent">'; print_media_links($srec, $nlevel); - if ($nlevel==2) { + if ($nlevel == 2) { print_media_links($source->getGedcom(), 1); } echo print_fact_notes($srec, $nlevel); - if ($nlevel==2) { + if ($nlevel == 2) { echo print_fact_notes($source->getGedcom(), 1); } echo '</div>'; @@ -820,7 +820,7 @@ function printSourceStructure($textSOUR) { } } - if ($textSOUR['QUAY']!='') { + if ($textSOUR['QUAY'] != '') { $html .= WT_Gedcom_Tag::getLabelValue('QUAY', WT_Gedcom_Code_Quay::getValue($textSOUR['QUAY'])); } @@ -844,7 +844,7 @@ function printSourceStructure($textSOUR) { */ function getSourceStructure($srec) { // Set up the output array - $textSOUR=array( + $textSOUR = array( 'PAGE'=>'', 'EVEN'=>'', 'ROLE'=>'', @@ -855,23 +855,23 @@ function getSourceStructure($srec) { ); if ($srec) { - $subrecords=explode("\n", $srec); - for ($i=0; $i<count($subrecords); $i++) { - $tag =substr($subrecords[$i], 2, 4); - $text =substr($subrecords[$i], 7); + $subrecords = explode("\n", $srec); + for ($i = 0; $i < count($subrecords); $i++) { + $tag = substr($subrecords[$i], 2, 4); + $text = substr($subrecords[$i], 7); $i++; - for (; $i<count($subrecords); $i++) { + for (; $i < count($subrecords); $i++) { $nextTag = substr($subrecords[$i], 2, 4); - if ($nextTag!='CONT') { + if ($nextTag != 'CONT') { $i--; break; } - if ($nextTag=='CONT') { + if ($nextTag == 'CONT') { $text .= "\n"; } $text .= rtrim(substr($subrecords[$i], 7)); } - if ($tag=='TEXT') { + if ($tag == 'TEXT') { $textSOUR[$tag][] = $text; } else { $textSOUR[$tag] = $text; @@ -898,17 +898,17 @@ function print_main_notes(WT_Fact $fact, $level) { if ($fact->isPendingAddition()) { $styleadd = ' new'; - $can_edit = $level==1 && $fact->canEdit(); + $can_edit = $level == 1 && $fact->canEdit(); } elseif ($fact->isPendingDeletion()) { - $styleadd=' old'; + $styleadd = ' old'; $can_edit = false; } else { - $styleadd=''; - $can_edit = $level==1 && $fact->canEdit(); + $styleadd = ''; + $can_edit = $level == 1 && $fact->canEdit(); } $ct = preg_match_all("/$level NOTE (.*)/", $factrec, $match, PREG_SET_ORDER); - for ($j=0; $j<$ct; $j++) { + for ($j = 0; $j < $ct; $j++) { // Note object, or inline note? if (preg_match("/$level NOTE @(.*)@/", $match[$j][0], $nmatch)) { $note = WT_Note::getInstance($nmatch[1]); @@ -937,16 +937,16 @@ function print_main_notes(WT_Fact $fact, $level) { } echo '</a>'; echo '<div class="editfacts">'; - echo "<div class=\"editlink\"><a class=\"editicon\" onclick=\"return edit_record('$pid', '$fact_id');\" href=\"#\" title=\"".WT_I18N::translate('Edit')."\"><span class=\"link_text\">".WT_I18N::translate('Edit')."</span></a></div>"; - echo '<div class="copylink"><a class="copyicon" href="#" onclick="return copy_fact(\'', $pid, '\', \'', $fact_id, '\');" title="'.WT_I18N::translate('Copy').'"><span class="link_text">'.WT_I18N::translate('Copy').'</span></a></div>'; - echo "<div class=\"deletelink\"><a class=\"deleteicon\" onclick=\"return delete_fact('".WT_I18N::translate('Are you sure you want to delete this fact?')."', '$pid', '$fact_id');\" href=\"#\" title=\"".WT_I18N::translate('Delete')."\"><span class=\"link_text\">".WT_I18N::translate('Delete')."</span></a></div>"; + echo "<div class=\"editlink\"><a class=\"editicon\" onclick=\"return edit_record('$pid', '$fact_id');\" href=\"#\" title=\"" . WT_I18N::translate('Edit') . "\"><span class=\"link_text\">" . WT_I18N::translate('Edit') . "</span></a></div>"; + echo '<div class="copylink"><a class="copyicon" href="#" onclick="return copy_fact(\'', $pid, '\', \'', $fact_id, '\');" title="' . WT_I18N::translate('Copy') . '"><span class="link_text">' . WT_I18N::translate('Copy') . '</span></a></div>'; + echo "<div class=\"deletelink\"><a class=\"deleteicon\" onclick=\"return delete_fact('" . WT_I18N::translate('Are you sure you want to delete this fact?') . "', '$pid', '$fact_id');\" href=\"#\" title=\"" . WT_I18N::translate('Delete') . "\"><span class=\"link_text\">" . WT_I18N::translate('Delete') . "</span></a></div>"; if ($note) { - echo '<a class="icon-note" href="', $note->getHtmlUrl() ,'" title="' . WT_I18N::translate('View') . '"><span class="link_text">' . WT_I18N::translate('View') . '</span></a>'; + echo '<a class="icon-note" href="', $note->getHtmlUrl(), '" title="' . WT_I18N::translate('View') . '"><span class="link_text">' . WT_I18N::translate('View') . '</span></a>'; } echo '</div>'; } } else { - if ($level<2) { + if ($level < 2) { if ($SHOW_FACT_ICONS) { echo '<i class="icon-note"></i> '; } @@ -959,11 +959,11 @@ function print_main_notes(WT_Fact $fact, $level) { $factlines = explode("\n", $factrec); // 1 BIRT Y\n2 NOTE ... $factwords = explode(" ", $factlines[0]); // 1 BIRT Y $factname = $factwords[1]; // BIRT - $parent=WT_GedcomRecord::getInstance($pid); - if ($factname == 'EVEN' || $factname=='FACT') { + $parent = WT_GedcomRecord::getInstance($pid); + if ($factname == 'EVEN' || $factname == 'FACT') { // Add ' EVEN' to provide sensible output for an event with an empty TYPE record $ct = preg_match("/2 TYPE (.*)/", $factrec, $ematch); - if ($ct>0) { + if ($ct > 0) { $factname = trim($ematch[1]); echo $factname; } else { @@ -973,7 +973,7 @@ function print_main_notes(WT_Fact $fact, $level) { // Note is already printed echo WT_Gedcom_Tag::getLabel($factname, $parent); if ($note) { - echo '<div class="editfacts"><a class="icon-note" href="', $note->getHtmlUrl() ,'" title="' . WT_I18N::translate('View') . '"><span class="link_text">' . WT_I18N::translate('View') . '</span></a></div>'; + echo '<div class="editfacts"><a class="icon-note" href="', $note->getHtmlUrl(), '" title="' . WT_I18N::translate('View') . '"><span class="link_text">' . WT_I18N::translate('View') . '</span></a></div>'; } } @@ -989,8 +989,8 @@ function print_main_notes(WT_Fact $fact, $level) { } } else { // Inline notes - $nrec = get_sub_record($level, "$level NOTE", $factrec, $j+1); - $text = $match[$j][1] . get_cont($level+1, $nrec); + $nrec = get_sub_record($level, "$level NOTE", $factrec, $j + 1); + $text = $match[$j][1] . get_cont($level + 1, $nrec); $text = WT_Filter::formatText($text, $WT_TREE); } @@ -1043,28 +1043,28 @@ function print_main_media(WT_Fact $fact, $level) { if ($fact->isPendingAddition()) { $styleadd = 'new'; - $can_edit = $level==1 && $fact->canEdit(); + $can_edit = $level == 1 && $fact->canEdit(); } elseif ($fact->isPendingDeletion()) { - $styleadd='old'; + $styleadd = 'old'; $can_edit = false; } else { - $styleadd=''; - $can_edit = $level==1 && $fact->canEdit(); + $styleadd = ''; + $can_edit = $level == 1 && $fact->canEdit(); } // -- find source for each fact preg_match_all('/(?:^|\n)' . $level . ' OBJE @(.*)@/', $factrec, $matches); foreach ($matches[1] as $xref) { - $media=WT_Media::getInstance($xref); + $media = WT_Media::getInstance($xref); // Allow access to "1 OBJE @non_existent_source@", so it can be corrected/deleted if (!$media || $media->canShow()) { - if ($level>1) { + if ($level > 1) { echo '<tr class="row_obje2">'; } else { echo '<tr>'; } echo '<td class="descriptionbox'; - if ($level>1) { + if ($level > 1) { echo ' rela'; } echo ' ', $styleadd, ' width20">'; @@ -1072,10 +1072,10 @@ function print_main_media(WT_Fact $fact, $level) { $factlines = explode("\n", $factrec); // 1 BIRT Y\n2 SOUR ... $factwords = explode(" ", $factlines[0]); // 1 BIRT Y $factname = $factwords[1]; // BIRT - if ($factname == 'EVEN' || $factname=='FACT') { + if ($factname == 'EVEN' || $factname == 'FACT') { // Add ' EVEN' to provide sensible output for an event with an empty TYPE record $ct = preg_match("/2 TYPE (.*)/", $factrec, $ematch); - if ($ct>0) { + if ($ct > 0) { $factname = $ematch[1]; echo $factname; } else { @@ -1087,7 +1087,7 @@ function print_main_media(WT_Fact $fact, $level) { echo WT_Gedcom_Tag::getLabel($factname, $parent), '</a>'; echo '<div class="editfacts">'; echo '<div class="editlink"><a class="editicon" onclick="window.open(\'addmedia.php?action=editmedia&pid=', $media->getXref(), '\', \'_blank\', edit_window_specs); return false;" href="#" title="', WT_I18N::translate('Edit'), '"><span class="link_text">', WT_I18N::translate('Edit'), '</span></a></div>'; - echo '<div class="copylink"><a class="copyicon" href="#" onclick="jQuery.post(\'action.php\',{action:\'copy-fact\', type:\'\', factgedcom:\''.rawurlencode($factrec).'\'},function(){location.reload();})" title="'.WT_I18N::translate('Copy').'"><span class="link_text">'.WT_I18N::translate('Copy').'</span></a></div>'; + echo '<div class="copylink"><a class="copyicon" href="#" onclick="jQuery.post(\'action.php\',{action:\'copy-fact\', type:\'\', factgedcom:\'' . rawurlencode($factrec) . '\'},function(){location.reload();})" title="' . WT_I18N::translate('Copy') . '"><span class="link_text">' . WT_I18N::translate('Copy') . '</span></a></div>'; echo '<div class="deletelink"><a class="deleteicon" onclick="return delete_fact(\'', WT_I18N::translate('Are you sure you want to delete this fact?'), '\', \'', $parent->getXref(), '\', \'', $fact->getFactId(), '\');" href="#" title="', WT_I18N::translate('Delete'), '"><span class="link_text">', WT_I18N::translate('Delete'), '</span></a></div>'; echo '</div>'; } else { @@ -1099,11 +1099,11 @@ function print_main_media(WT_Fact $fact, $level) { echo '<span class="field">'; echo $media->displayImage(); if (empty($SEARCH_SPIDER)) { - echo '<a href="'.$media->getHtmlUrl().'">'; + echo '<a href="' . $media->getHtmlUrl() . '">'; } echo '<em>'; foreach ($media->getAllNames() as $name) { - if ($name['type']!='TITL') { + if ($name['type'] != 'TITL') { echo '<br>'; } echo $name['full']; @@ -1119,10 +1119,10 @@ function print_main_media(WT_Fact $fact, $level) { if (!empty($imgsize['WxH'])) { echo WT_Gedcom_Tag::getLabelValue('__IMAGE_SIZE__', $imgsize['WxH']); } - if ($media->getFilesizeraw()>0) { - echo WT_Gedcom_Tag::getLabelValue('__FILE_SIZE__', $media->getFilesize()); + if ($media->getFilesizeraw() > 0) { + echo WT_Gedcom_Tag::getLabelValue('__FILE_SIZE__', $media->getFilesize()); } - $mediatype=$media->getMediaType(); + $mediatype = $media->getMediaType(); if ($mediatype) { echo WT_Gedcom_Tag::getLabelValue('TYPE', WT_Gedcom_Tag::getFileFormTypeValue($mediatype)); } diff --git a/modules_v3/GEDFact_assistant/_CENS/addnoteaction_assisted.php b/modules_v3/GEDFact_assistant/_CENS/addnoteaction_assisted.php index 2ffb3fb03f..ca56f94806 100644 --- a/modules_v3/GEDFact_assistant/_CENS/addnoteaction_assisted.php +++ b/modules_v3/GEDFact_assistant/_CENS/addnoteaction_assisted.php @@ -25,15 +25,15 @@ //-- create a shared note record from the incoming variables -$newgedrec = "0 @XREF@ NOTE\n"; +$newgedrec = "0 @XREF@ NOTE\n"; if (isset($_REQUEST['EVEN'])) $EVEN = $_REQUEST['EVEN']; -if (!empty($EVEN) && count($EVEN)>0) { +if (!empty($EVEN) && count($EVEN) > 0) { $newgedrec .= "1 DATA\n"; - $newgedrec .= "2 EVEN ".implode(",", $EVEN)."\n"; - if (!empty($EVEN_DATE)) $newgedrec .= "3 DATE ".$EVEN_DATE."\n"; - if (!empty($EVEN_PLAC)) $newgedrec .= "3 PLAC ".$EVEN_PLAC."\n"; - if (!empty($AGNC)) $newgedrec .= "2 AGNC ".$AGNC."\n"; + $newgedrec .= "2 EVEN " . implode(",", $EVEN) . "\n"; + if (!empty($EVEN_DATE)) $newgedrec .= "3 DATE " . $EVEN_DATE . "\n"; + if (!empty($EVEN_PLAC)) $newgedrec .= "3 PLAC " . $EVEN_PLAC . "\n"; + if (!empty($AGNC)) $newgedrec .= "2 AGNC " . $AGNC . "\n"; } if (isset($_REQUEST['ABBR'])) $ABBR = $_REQUEST['ABBR']; if (isset($_REQUEST['TITL'])) $TITL = $_REQUEST['TITL']; @@ -53,10 +53,10 @@ global $pid; if (!empty($NOTE)) { $newlines = preg_split("/\r?\n/", $NOTE, -1); - for ($k=0; $k<count($newlines); $k++) { - if ($k==0 && count($newlines)>1) { + for ($k = 0; $k < count($newlines); $k++) { + if ($k == 0 && count($newlines) > 1) { $newgedrec = "0 @XREF@ NOTE $newlines[$k]\n"; - } else if ($k==0) { + } else if ($k == 0) { $newgedrec = "0 @XREF@ NOTE $newlines[$k]\n1 CONT\n"; } else { $newgedrec .= "1 CONT $newlines[$k]\n"; @@ -73,7 +73,7 @@ if (!empty($AUTH)) $newgedrec .= "1 AUTH $AUTH\n"; if (!empty($PUBL)) { $newlines = preg_split("/\r?\n/", $PUBL, -1, PREG_SPLIT_NO_EMPTY); foreach ($newlines as $k=>$line) { - if ($k==0) { + if ($k == 0) { $newgedrec .= "1 PUBL $line\n"; } else { $newgedrec .= "2 CONT $line\n"; @@ -87,7 +87,7 @@ if (!empty($NOTE)) { if ($pid_array != '') { $record = WT_GedcomRecord::createRecord($newgedrec, WT_GED_ID); } else { - $record=''; + $record = ''; echo '<div class="indent">No individuals entered, close and try again </div>'; } diff --git a/modules_v3/GEDFact_assistant/_CENS/census_3_find.php b/modules_v3/GEDFact_assistant/_CENS/census_3_find.php index bf6dc36f07..23b5da11b6 100644 --- a/modules_v3/GEDFact_assistant/_CENS/census_3_find.php +++ b/modules_v3/GEDFact_assistant/_CENS/census_3_find.php @@ -66,30 +66,30 @@ echo "</td>"; echo "</table>"; echo "<br>"; -if ($action=="filter") { +if ($action == "filter") { $filter = trim($filter); - $filter_array=explode(' ', preg_replace('/ {2,}/', ' ', $filter)); + $filter_array = explode(' ', preg_replace('/ {2,}/', ' ', $filter)); // Output Individual for GEDFact Assistant ====================== echo "<table class=\"tabs_table width90\">"; - $myindilist=search_indis_names($filter_array, array(WT_GED_ID), 'AND'); + $myindilist = search_indis_names($filter_array, array(WT_GED_ID), 'AND'); if ($myindilist) { echo "<tr><td class=\"list_value_wrap\"><ul>"; usort($myindilist, array('WT_GedcomRecord', 'compare')); - foreach ($myindilist as $indi ) { + foreach ($myindilist as $indi) { $nam = $indi->getAllNames(); - $wholename = rtrim($nam[0]['givn'],'*')." ".$nam[0]['surname']; - $fulln = rtrim($nam[0]['givn'],'*')." ".$nam[0]['surname']; + $wholename = rtrim($nam[0]['givn'], '*') . " " . $nam[0]['surname']; + $fulln = rtrim($nam[0]['givn'], '*') . " " . $nam[0]['surname']; $fulln = str_replace('"', '\'', $fulln); // Replace double quotes - $fulln = str_replace("@N.N.", "(".WT_I18N::translate('unknown').")", $fulln); - $fulln = str_replace("@P.N.", "(".WT_I18N::translate('unknown').")", $fulln); - $givn = rtrim($nam[0]['givn'],'*'); + $fulln = str_replace("@N.N.", "(" . WT_I18N::translate('unknown') . ")", $fulln); + $fulln = str_replace("@P.N.", "(" . WT_I18N::translate('unknown') . ")", $fulln); + $givn = rtrim($nam[0]['givn'], '*'); $surn = $nam[0]['surname']; if (isset($nam[1])) { - $fulmn = rtrim($nam[1]['givn'],'*')." ".$nam[1]['surname']; + $fulmn = rtrim($nam[1]['givn'], '*') . " " . $nam[1]['surname']; $fulmn = str_replace('"', '\'', $fulmn); // Replace double quotes - $fulmn = str_replace("@N.N.", "(".WT_I18N::translate('unknown').")", $fulmn); - $fulmn = str_replace("@P.N.", "(".WT_I18N::translate('unknown').")", $fulmn); + $fulmn = str_replace("@N.N.", "(" . WT_I18N::translate('unknown') . ")", $fulmn); + $fulmn = str_replace("@P.N.", "(" . WT_I18N::translate('unknown') . ")", $fulmn); $marn = $nam[1]['surname']; } else { $fulmn = $fulln; @@ -112,7 +112,7 @@ if ($action=="filter") { //-- Build Indi Spouse Family to get marriage Date ---------- foreach ($indi->getSpouseFamilies() as $family) { $marrdate = $family->getMarriageDate(); - $marrdate = ($marrdate->minJD()+$marrdate->maxJD())/2; // Julian + $marrdate = ($marrdate->minJD() + $marrdate->maxJD()) / 2; // Julian $children = $family->getChildren(); } if (!isset($marrdate)) { $marrdate = ""; } @@ -122,19 +122,19 @@ if ($action=="filter") { if (isset($children)) { foreach ($children as $key=>$child) { $chnam = $child->getAllNames(); - $chfulln = rtrim($chnam[0]['givn'],'*')." ".$chnam[0]['surname']; + $chfulln = rtrim($chnam[0]['givn'], '*') . " " . $chnam[0]['surname']; $chfulln = str_replace('"', "", $chfulln); // Must remove quotes completely here - $chfulln = str_replace("@N.N.", "(".WT_I18N::translate('unknown').")", $chfulln); - $chfulln = str_replace("@P.N.", "(".WT_I18N::translate('unknown').")", $chfulln); // Child’s Full Name - $chdob = ($child->getBirthDate()->minJD()+$child->getBirthDate()->maxJD())/2; // Child’s Date of Birth (Julian) + $chfulln = str_replace("@N.N.", "(" . WT_I18N::translate('unknown') . ")", $chfulln); + $chfulln = str_replace("@P.N.", "(" . WT_I18N::translate('unknown') . ")", $chfulln); // Child’s Full Name + $chdob = ($child->getBirthDate()->minJD() + $child->getBirthDate()->maxJD()) / 2; // Child’s Date of Birth (Julian) if (!isset($chdob)) { $chdob = ""; } - $chdod = ($child->getDeathDate()->minJD()+$child->getDeathDate()->maxJD())/2; // Child’s Date of Death (Julian) + $chdod = ($child->getDeathDate()->minJD() + $child->getDeathDate()->maxJD()) / 2; // Child’s Date of Death (Julian) if (!isset($chdod)) { $chdod = ""; } - $chBLD = ($chfulln.", ".$chdob.", ".$chdod); + $chBLD = ($chfulln . ", " . $chdob . ", " . $chdod); array_push($chBLDarray, $chBLD); } } - if ($chBLDarray && $indi->getSex()=="F") { + if ($chBLDarray && $indi->getSex() == "F") { $chBLDarray = implode("::", $chBLDarray); } else { $chBLDarray = ''; @@ -145,24 +145,24 @@ if ($action=="filter") { // NOTES = is equivalent to= function pasterow(id, nam, mnam, label, gend, cond, dom, dob, age, dod, occu, birthpl, fbirthpl, mbirthpl, chilBLD) { // ============================================================================================================================== echo "<a href=\"#\" onclick=\"window.opener.insertRowToTable("; - echo "'".$indi->getXref()."', "; // id - Indi Id - echo "'".addslashes(strip_tags($fulln))."', "; // nam - Name - echo "'".addslashes(strip_tags($fulmn))."', "; // mnam - Married Name + echo "'" . $indi->getXref() . "', "; // id - Indi Id + echo "'" . addslashes(strip_tags($fulln)) . "', "; // nam - Name + echo "'" . addslashes(strip_tags($fulmn)) . "', "; // mnam - Married Name echo "'-', "; // label - Relation to Head of Household - echo "'".$indi->getSex()."', "; // gend - Sex + echo "'" . $indi->getSex() . "', "; // gend - Sex echo "'S', "; // cond - Marital Condition - echo "'".$marrdate."', "; // dom - Date of Marriage - echo "'".(($indi->getBirthDate()->minJD() + $indi->getBirthDate()->maxJD())/2)."' ,"; // dob - Date of Birth - echo "'".(1901-$indi->getbirthyear())."' ,"; // ~age~ - Census Date minus YOB (Preliminary) - echo "'".(($indi->getDeathDate()->minJD() + $indi->getDeathDate()->maxJD())/2)."' ,"; // dod - Date of Death + echo "'" . $marrdate . "', "; // dom - Date of Marriage + echo "'" . (($indi->getBirthDate()->minJD() + $indi->getBirthDate()->maxJD()) / 2) . "' ,"; // dob - Date of Birth + echo "'" . (1901 - $indi->getbirthyear()) . "' ,"; // ~age~ - Census Date minus YOB (Preliminary) + echo "'" . (($indi->getDeathDate()->minJD() + $indi->getDeathDate()->maxJD()) / 2) . "' ,"; // dod - Date of Death echo "'', "; // occu - Occupation - echo "'".WT_Filter::escapeHtml($indi->getbirthplace())."', "; // birthpl - Birthplace - echo "'".$FBP."', "; // fbirthpl - Father’s Birthplace - echo "'".$MBP."', "; // mbirthpl - Mother’s Birthplace - echo "'".$chBLDarray."'"; // chilBLD - Array of Children (name, birthdate, deathdate) + echo "'" . WT_Filter::escapeHtml($indi->getbirthplace()) . "', "; // birthpl - Birthplace + echo "'" . $FBP . "', "; // fbirthpl - Father’s Birthplace + echo "'" . $MBP . "', "; // mbirthpl - Mother’s Birthplace + echo "'" . $chBLDarray . "'"; // chilBLD - Array of Children (name, birthdate, deathdate) echo ");"; echo "return false;\">"; - echo "<b>".$indi->getFullName()."</b> "; // Name Link + echo "<b>" . $indi->getFullName() . "</b> "; // Name Link echo "</span><br><span class=\"list_item\">", WT_Gedcom_Tag::getLabel('BIRT', $indi), " ", $indi->getbirthyear(), " ", $indi->getbirthplace(), "</span>"; echo "</a>"; echo "</li>"; diff --git a/modules_v3/GEDFact_assistant/_MEDIA/media_0_inverselink.php b/modules_v3/GEDFact_assistant/_MEDIA/media_0_inverselink.php index 1936f7412e..2d408305ab 100644 --- a/modules_v3/GEDFact_assistant/_MEDIA/media_0_inverselink.php +++ b/modules_v3/GEDFact_assistant/_MEDIA/media_0_inverselink.php @@ -37,7 +37,7 @@ $controller ->addExternalJavascript(WT_STATIC_URL . 'js/autocomplete.js') ->addInlineJavascript('autocomplete();'); -$paramok = true; +$paramok = true; if (!empty($linktoid)) { $paramok = WT_GedcomRecord::getInstance($linktoid)->canShow(); } @@ -79,7 +79,7 @@ if ($action == 'choose' && $paramok) { echo '<td class="optionbox wrap">'; if (!empty($mediaid)) { //-- Get the title of this existing Media item - $title= + $title = WT_DB::prepare("SELECT m_titl FROM `##media` where m_id=? AND m_file=?") ->execute(array($mediaid, WT_GED_ID)) ->fetchOne(); @@ -90,11 +90,11 @@ if ($action == 'choose' && $paramok) { } echo '<table><tr><td>'; //-- Get the filename of this existing Media item - $filename= + $filename = WT_DB::prepare("SELECT m_filename FROM `##media` where m_id=? AND m_file=?") ->execute(array($mediaid, WT_GED_ID)) ->fetchOne(); - $media=WT_Media::getInstance($mediaid); + $media = WT_Media::getInstance($mediaid); echo $media->displayImage(); echo '</td></tr></table>'; echo '</td></tr>'; @@ -115,10 +115,10 @@ if ($action == 'choose' && $paramok) { $media->linkedIndividuals('OBJE'), $media->linkedFamilies('OBJE'), $media->linkedSources('OBJE'), - $media->linkedNotes('OBJE'), // Invalid GEDCOM - you cannot link a NOTE to an OBJE + $media->linkedNotes('OBJE'), // Invalid GEDCOM - you cannot link a NOTE to an OBJE $media->linkedRepositories('OBJE') // Invalid GEDCOM - you cannot link a REPO to an OBJE ); - $i=1; + $i = 1; foreach ($links as $record) { echo "<tr ><td>"; echo $i++; @@ -136,11 +136,11 @@ if ($action == 'choose' && $paramok) { <?php } elseif ($record instanceof WT_Family) { if ($record->getHusband()) { - $head=$record->getHusband()->getXref(); + $head = $record->getHusband()->getXref(); } elseif ($record->getWife()) { - $head=$record->getWife()->getXref(); + $head = $record->getWife()->getXref(); } else { - $head=''; + $head = ''; } ?> <td align="center"><a href="#" class="icon-button_family" title="<?php echo WT_I18N::translate('Family navigator'); ?>" name="family_'<?php echo $record->getXref(); ?>'" onclick="openFamNav('<?php echo $head; ?>');"></a></td> @@ -161,10 +161,10 @@ if ($action == 'choose' && $paramok) { echo '<tr><td class="descriptionbox wrap">'; echo WT_I18N::translate('Add links'); echo '<td class="optionbox wrap ">'; - if ($linktoid=="") { + if ($linktoid == "") { // ---- } else { - $record=WT_Individual::getInstance($linktoid); + $record = WT_Individual::getInstance($linktoid); echo '<b>', $record->getFullName(), '</b>'; } echo '<table><tr><td>'; @@ -595,7 +595,7 @@ function shiftlinks() { if ($exist_links) { foreach (explode(',', $exist_links) as $remLinkId) { $indi = WT_GedcomRecord::getInstance($remLinkId); - $indi->removeLinks($mediaid, $update_CHAN!='no_change'); + $indi->removeLinks($mediaid, $update_CHAN != 'no_change'); } } // Add new Links ==================================== @@ -604,7 +604,7 @@ function shiftlinks() { // when it is also in the list. foreach (array_unique(explode(',', $more_links)) as $addLinkId) { $indi = WT_GedcomRecord::getInstance($addLinkId); - $indi->createFact('1 OBJE @' . $mediaid . '@', $update_CHAN!='no_change'); + $indi->createFact('1 OBJE @' . $mediaid . '@', $update_CHAN != 'no_change'); } } $controller->addInlineJavascript('closePopupAndReloadParent();'); diff --git a/modules_v3/GEDFact_assistant/_MEDIA/media_1_ctrl.php b/modules_v3/GEDFact_assistant/_MEDIA/media_1_ctrl.php index 3217a2c693..b0c63f7030 100644 --- a/modules_v3/GEDFact_assistant/_MEDIA/media_1_ctrl.php +++ b/modules_v3/GEDFact_assistant/_MEDIA/media_1_ctrl.php @@ -29,13 +29,13 @@ if (!defined('WT_WEBTREES')) { } // Test to see if Base pid is filled in ============================ -if ($pid=="") { +if ($pid == "") { echo "<br><br>"; echo "<b>YOU MUST enter a Base individual ID to be able to \"ADD\" Individual Links</b>"; echo "<br><br>"; } else { - $person=WT_Individual::getInstance($pid); + $person = WT_Individual::getInstance($pid); if ($person->getDeathYear() == 0) { $DeathYr = ""; } else { $DeathYr = $person->getDeathYear(); } if ($person->getBirthYear() == 0) { $BirthYr = ""; } else { $BirthYr = $person->getBirthYear(); } @@ -89,7 +89,7 @@ if ($pid=="") { <?php // Header text with "Head" button ================================================= $headImg = '<i class="headimg vmiddle icon-button_head"></i>'; - $headImg2 = '<i class="headimg2 vmiddle icon-button_head" title="'.WT_I18N::translate('Click to choose individual as head of family.').'"></i>'; + $headImg2 = '<i class="headimg2 vmiddle icon-button_head" title="' . WT_I18N::translate('Click to choose individual as head of family.') . '"></i>'; echo WT_I18N::translate('Click %s to choose individual as head of family.', $headImg); ?> <br><br> @@ -109,7 +109,7 @@ if ($pid=="") { foreach ($families as $family) { $label = $person->getChildFamilyLabel($family); - $people=array( + $people = array( 'husb' =>$family->getHusband(), 'wife' =>$family->getWife(), 'children'=>$family->getChildren(), @@ -120,7 +120,7 @@ if ($pid=="") { // Husband ------------------- if ($people["husb"]) { $fulln = strip_tags($people['husb']->getFullName()); - $menu = new WT_Menu($headImg, "edit_interface.php?action=addmedia_links&noteid=newnote&pid=".$people["husb"]->getXref()."&gedcom=".WT_GEDURL); + $menu = new WT_Menu($headImg, "edit_interface.php?action=addmedia_links&noteid=newnote&pid=" . $people["husb"]->getXref() . "&gedcom=" . WT_GEDURL); print_pedigree_person_nav_media($people["husb"]->getXref()); $slabel = $parentlinks; $submenu = new WT_Menu($slabel); @@ -138,7 +138,7 @@ if ($pid=="") { if (($people["husb"]->canShow())) { ?> <a href='#' onclick='opener.insertRowToTable("<?php - echo $people["husb"]->getXref() ; // pid = PID + echo $people["husb"]->getXref(); // pid = PID ?>", "<?php echo htmlentities($fulln); ?>", "", "", "", "", "", "", "", "");'><?php @@ -156,8 +156,8 @@ if ($pid=="") { } if ($people["wife"]) { - $fulln =strip_tags($people['wife']->getFullName()); - $menu = new WT_Menu($headImg, "edit_interface.php?action=addmedia_links&noteid=newnote&pid=".$people["wife"]->getXref()."&gedcom=".WT_GEDURL); + $fulln = strip_tags($people['wife']->getFullName()); + $menu = new WT_Menu($headImg, "edit_interface.php?action=addmedia_links&noteid=newnote&pid=" . $people["wife"]->getXref() . "&gedcom=" . WT_GEDURL); print_pedigree_person_nav_media($people["wife"]->getXref()); $slabel = $parentlinks; $submenu = new WT_Menu($slabel); @@ -172,7 +172,7 @@ if ($pid=="") { if (($people["wife"]->canShow())) { ?> <a href='#' onclick='opener.insertRowToTable("<?php - echo $people["wife"]->getXref() ; // pid = PID + echo $people["wife"]->getXref(); // pid = PID ?>", "<?php echo htmlentities($fulln); ?>", "", "", "", "", "", "", "", "");'> @@ -193,14 +193,14 @@ if ($pid=="") { if ($people["children"]) { $elderdate = $family->getMarriageDate(); foreach ($people["children"] as $key=>$child) { - $fulln =strip_tags($child->getFullName()); - $menu = new WT_Menu($headImg, "edit_interface.php?action=addmedia_links&noteid=newnote&pid=".$child->getXref()."&gedcom=".WT_GEDURL); + $fulln = strip_tags($child->getFullName()); + $menu = new WT_Menu($headImg, "edit_interface.php?action=addmedia_links&noteid=newnote&pid=" . $child->getXref() . "&gedcom=" . WT_GEDURL); print_pedigree_person_nav_media($child->getXref()); $slabel = $spouselinks; $submenu = new WT_Menu($slabel); $menu->addSubmenu($submenu); - if ($child->getXref()==$pid) { + if ($child->getXref() == $pid) { //Only print Head of Family in Immediate Family Block } else { ?> @@ -213,7 +213,7 @@ if ($pid=="") { if (($child->canShow())) { ?> <a href='#' onclick='opener.insertRowToTable("<?php - echo $child->getXref() ; // pid = PID + echo $child->getXref(); // pid = PID ?>", "<?php echo htmlentities($fulln); ?>", "", "", "", "", "", "", "", "");'><?php @@ -238,7 +238,7 @@ if ($pid=="") { foreach ($person->getChildStepFamilies() as $family) { $label = $person->getStepFamilyLabel($family); - $people=array( + $people = array( 'husb' =>$family->getHusband(), 'wife' =>$family->getWife(), 'children'=>$family->getChildren(), @@ -252,8 +252,8 @@ if ($pid=="") { // Husband ----------------------------- $elderdate = ""; if ($people["husb"]) { - $fulln =strip_tags($people['husb']->getFullName()); - $menu = new WT_Menu($headImg, "edit_interface.php?action=addmedia_links&noteid=newnote&pid=".$people["husb"]->getXref()."&gedcom=".WT_GEDURL); + $fulln = strip_tags($people['husb']->getFullName()); + $menu = new WT_Menu($headImg, "edit_interface.php?action=addmedia_links&noteid=newnote&pid=" . $people["husb"]->getXref() . "&gedcom=" . WT_GEDURL); print_pedigree_person_nav_media($people["husb"]->getXref()); $slabel = $parentlinks; $submenu = new WT_Menu($slabel); @@ -270,7 +270,7 @@ if ($pid=="") { if (($people["husb"]->canShow())) { ?> <a href='#' onclick='opener.insertRowToTable("<?php - echo $people["husb"]->getXref() ; // pid = PID + echo $people["husb"]->getXref(); // pid = PID ?>", "<?php echo htmlentities($fulln); ?>", "", "", "", "", "", "", "", "");'> @@ -290,8 +290,8 @@ if ($pid=="") { // Wife ------------------- if ($people["wife"]) { - $fulln =strip_tags($people['wife']->getFullName()); - $menu = new WT_Menu($headImg, "edit_interface.php?action=addmedia_links&noteid=newnote&pid=".$people["wife"]->getXref()."&gedcom=".WT_GEDURL); + $fulln = strip_tags($people['wife']->getFullName()); + $menu = new WT_Menu($headImg, "edit_interface.php?action=addmedia_links&noteid=newnote&pid=" . $people["wife"]->getXref() . "&gedcom=" . WT_GEDURL); print_pedigree_person_nav_media($people["wife"]->getXref()); $slabel = $parentlinks; $submenu = new WT_Menu($slabel); @@ -308,7 +308,7 @@ if ($pid=="") { if (($people["wife"]->canShow())) { ?> <a href='#' onclick='opener.insertRowToTable("<?php - echo $people["wife"]->getXref() ; // pid = PID + echo $people["wife"]->getXref(); // pid = PID ?>", "<?php echo htmlentities($fulln); ?>", "", "", "", "", "", "", "", "");'> @@ -330,8 +330,8 @@ if ($pid=="") { if ($people["children"]) { $elderdate = $family->getMarriageDate(); foreach ($people["children"] as $key=>$child) { - $fulln =strip_tags($child->getFullName()); - $menu = new WT_Menu($headImg, "edit_interface.php?action=addmedia_links&noteid=newnote&pid=".$child->getXref()."&gedcom=".WT_GEDURL); + $fulln = strip_tags($child->getFullName()); + $menu = new WT_Menu($headImg, "edit_interface.php?action=addmedia_links&noteid=newnote&pid=" . $child->getXref() . "&gedcom=" . WT_GEDURL); print_pedigree_person_nav_media($child->getXref()); $slabel = $spouselinks; $submenu = new WT_Menu($slabel); @@ -347,7 +347,7 @@ if ($pid=="") { if (($child->canShow())) { ?> <a href='#' onclick='opener.insertRowToTable("<?php - echo $child->getXref() ; // pid = PID + echo $child->getXref(); // pid = PID ?>", "<?php echo htmlentities($fulln); ?>", "", "", "", "", "", "", "", "");'> @@ -373,7 +373,7 @@ if ($pid=="") { $families = $person->getSpouseFamilies(); foreach ($families as $family) { - $people=array( + $people = array( 'husb' =>$family->getHusband(), 'wife' =>$family->getWife(), 'children'=>$family->getChildren(), @@ -383,8 +383,8 @@ if ($pid=="") { // Husband ------------------- if ($people["husb"]) { - $fulln =strip_tags($people['husb']->getFullName()); - $menu = new WT_Menu($headImg, "edit_interface.php?action=addmedia_links&noteid=newnote&pid=".$people["husb"]->getXref()."&gedcom=".WT_GEDURL); + $fulln = strip_tags($people['husb']->getFullName()); + $menu = new WT_Menu($headImg, "edit_interface.php?action=addmedia_links&noteid=newnote&pid=" . $people["husb"]->getXref() . "&gedcom=" . WT_GEDURL); print_pedigree_person_nav_media($people["husb"]->getXref()); $slabel = $parentlinks; $submenu = new WT_Menu($slabel); @@ -401,7 +401,7 @@ if ($pid=="") { if (($people["husb"]->canShow())) { ?> <a href='#' onclick='opener.insertRowToTable("<?php - echo $people["husb"]->getXref() ; // pid = PID + echo $people["husb"]->getXref(); // pid = PID ?>", "<?php echo htmlentities($fulln); ?>", "", "", "", "", "", "", "", "");'> @@ -422,8 +422,8 @@ if ($pid=="") { // Wife ------------------- if ($people["wife"]) { - $fulln =strip_tags($people['wife']->getFullName()); - $menu = new WT_Menu($headImg, "edit_interface.php?action=addmedia_links&noteid=newnote&pid=".$people["wife"]->getXref()."&gedcom=".WT_GEDURL); + $fulln = strip_tags($people['wife']->getFullName()); + $menu = new WT_Menu($headImg, "edit_interface.php?action=addmedia_links&noteid=newnote&pid=" . $people["wife"]->getXref() . "&gedcom=" . WT_GEDURL); print_pedigree_person_nav_media($people["wife"]->getXref()); $slabel = $parentlinks; $submenu = new WT_Menu($slabel); @@ -440,7 +440,7 @@ if ($pid=="") { if (($people["wife"]->canShow())) { ?> <a href='#' onclick='opener.insertRowToTable("<?php - echo $people["wife"]->getXref() ; // pid = PID + echo $people["wife"]->getXref(); // pid = PID ?>", "<?php echo htmlentities($fulln); ?>", "", "", "", "", "", "", "", "");'> @@ -459,8 +459,8 @@ if ($pid=="") { // Children foreach ($people["children"] as $key=>$child) { - $fulln =strip_tags($child->getFullName()); - $menu = new WT_Menu($headImg, "edit_interface.php?action=addmedia_links&noteid=newnote&pid=".$child->getXref()."&gedcom=".WT_GEDURL); + $fulln = strip_tags($child->getFullName()); + $menu = new WT_Menu($headImg, "edit_interface.php?action=addmedia_links&noteid=newnote&pid=" . $child->getXref() . "&gedcom=" . WT_GEDURL); print_pedigree_person_nav_media($child->getXref()); $slabel = $spouselinks; $submenu = new WT_Menu($slabel); @@ -475,7 +475,7 @@ if ($pid=="") { if (($child->canShow())) { ?> <a href='#' onclick='opener.insertRowToTable("<?php - echo $child->getXref() ; // pid = PID + echo $child->getXref(); // pid = PID ?>", "<?php echo htmlentities($fulln); // nam = Full Name ?>", "", "", "", "", "", "", "", "");'> @@ -503,7 +503,7 @@ if ($pid=="") { echo '</td>'; echo '</tr>'; echo '</table>'; - echo '</div>';// close "media-links" + echo '</div>'; // close "media-links" } // End IF test for Base pid @@ -520,9 +520,9 @@ function print_pedigree_person_nav_media($pid) { global $spouselinks, $parentlinks, $step_parentlinks, $persons, $person_step, $person_parent; global $natdad, $natmom; - $person=WT_Individual::getInstance($pid); + $person = WT_Individual::getInstance($pid); - $tmp = array('M'=>'','F'=>'F', 'U'=>'NN'); + $tmp = array('M'=>'', 'F'=>'F', 'U'=>'NN'); $isF = $tmp[$person->getSex()]; $spouselinks = ''; $parentlinks = ''; @@ -532,11 +532,11 @@ function print_pedigree_person_nav_media($pid) { //-- draw a box for the family popup $spouselinks .= "<table id=\"flyoutFam\" class=\"person_box$isF\"><tr><td class=\"name2 ltr\">"; - $spouselinks .= "<b>" . WT_I18N::translate('Family') . "</b> (" .$person->getFullName(). ")<br>"; + $spouselinks .= "<b>" . WT_I18N::translate('Family') . "</b> (" . $person->getFullName() . ")<br>"; $parentlinks .= "<table id=\"flyoutPar\" class=\"person_box$isF\"><tr><td class=\"name2 ltr\">"; - $parentlinks .= "<b>" . WT_I18N::translate('Parents') . "</b> (" .$person->getFullName(). ")<br>"; + $parentlinks .= "<b>" . WT_I18N::translate('Parents') . "</b> (" . $person->getFullName() . ")<br>"; $step_parentlinks .= "<table id=\"flyoutStep\" class=\"person_box$isF\"><tr><td class=\"name2 ltr\">"; - $step_parentlinks .= "<b>" . WT_I18N::translate('Parents') . "</b> (" .$person->getFullName(). ")<br>"; + $step_parentlinks .= "<b>" . WT_I18N::translate('Parents') . "</b> (" . $person->getFullName() . ")<br>"; $persons = ''; $person_parent = ''; @@ -554,10 +554,10 @@ function print_pedigree_person_nav_media($pid) { // Parent Husbands Details $person_parent = 'Yes'; if ($husb->canShowName()) { - $fulln =strip_tags($husb->getFullName()); + $fulln = strip_tags($husb->getFullName()); $parentlinks .= "<a href=\"#\" onclick=\"opener.insertRowToTable("; - $parentlinks .= "'".$husb->getXref()."', "; // pid = PID - $parentlinks .= "'".htmlentities($fulln)."', "; // nam = Name + $parentlinks .= "'" . $husb->getXref() . "', "; // pid = PID + $parentlinks .= "'" . htmlentities($fulln) . "', "; // nam = Name $parentlinks .= "'',"; $parentlinks .= "'',"; $parentlinks .= "'',"; @@ -581,12 +581,12 @@ function print_pedigree_person_nav_media($pid) { if ($wife || $children) { if ($wife) { // Parent Wifes Details - $person_parent="Yes"; + $person_parent = "Yes"; if ($wife->canShowName()) { $fulln = strip_tags($wife->getFullName()); $parentlinks .= "<a href=\"#\" onclick=\"opener.insertRowToTable("; - $parentlinks .= "'".$wife->getXref()."',"; // pid = PID - $parentlinks .= "'".htmlentities($fulln)."',"; + $parentlinks .= "'" . $wife->getXref() . "',"; // pid = PID + $parentlinks .= "'" . htmlentities($fulln) . "',"; $parentlinks .= "'',"; $parentlinks .= "'',"; $parentlinks .= "'',"; @@ -622,7 +622,7 @@ function print_pedigree_person_nav_media($pid) { //-- Step Husband Details ------------------------------ $person_step = 'Yes'; if ($husb->canShowName()) { - $parentlinks .= "<a href=\"individual.php?pid=" . $husb->getXref() . "&&gedcom=".WT_GEDURL."\">"; + $parentlinks .= "<a href=\"individual.php?pid=" . $husb->getXref() . "&&gedcom=" . WT_GEDURL . "\">"; $parentlinks .= $husb->getFullName(); $parentlinks .= "</a>"; } else { @@ -660,8 +660,8 @@ function print_pedigree_person_nav_media($pid) { // Spouse if ($spouse && $spouse->canShowName()) { $spouselinks .= "<a href=\"#\" onclick=\"opener.insertRowToTable("; - $spouselinks .= "'".$spouse->getXref()."',"; // pid = PID - $spouselinks .= "'".strip_tags($spouse->getFullName())."',"; + $spouselinks .= "'" . $spouse->getXref() . "',"; // pid = PID + $spouselinks .= "'" . strip_tags($spouse->getFullName()) . "',"; $spouselinks .= "'',"; $spouselinks .= "'',"; $spouselinks .= "'',"; @@ -685,13 +685,13 @@ function print_pedigree_person_nav_media($pid) { $spouselinks .= "<div id='spouseFam'>"; $spouselinks .= "<ul class=\"clist\">"; foreach ($children as $child) { - $persons="Yes"; + $persons = "Yes"; if ($child->canShowName()) { - $fulln =strip_tags($child->getFullName()); + $fulln = strip_tags($child->getFullName()); $spouselinks .= "<li>"; $spouselinks .= "<a href=\"#\" onclick=\"opener.insertRowToTable("; - $spouselinks .= "'".$child->getXref()."',"; - $spouselinks .= "'".htmlentities($fulln)."',"; // nam = Name + $spouselinks .= "'" . $child->getXref() . "',"; + $spouselinks .= "'" . htmlentities($fulln) . "',"; // nam = Name $spouselinks .= "'',"; $spouselinks .= "'',"; $spouselinks .= "'',"; diff --git a/modules_v3/GEDFact_assistant/module.php b/modules_v3/GEDFact_assistant/module.php index 4f6176debc..933e59a61b 100644 --- a/modules_v3/GEDFact_assistant/module.php +++ b/modules_v3/GEDFact_assistant/module.php @@ -35,10 +35,10 @@ class GEDFact_assistant_WT_Module extends WT_Module { /** {@inheritdoc} */ public function modAction($mod_action) { - switch($mod_action) { + switch ($mod_action) { case '_CENS/census_3_find': // TODO: this file should be a method in this class - require WT_ROOT.WT_MODULES_DIR.$this->getName().'/_CENS/census_3_find.php'; + require WT_ROOT . WT_MODULES_DIR . $this->getName() . '/_CENS/census_3_find.php'; break; case 'media_3_find': self::media_3_find(); @@ -127,24 +127,24 @@ class GEDFact_assistant_WT_Module extends WT_Module { echo "<br>"; $filter = trim($filter); - $filter_array=explode(' ', preg_replace('/ {2,}/', ' ', $filter)); + $filter_array = explode(' ', preg_replace('/ {2,}/', ' ', $filter)); echo "<table class=\"tabs_table width90\"><tr>"; - $myindilist=search_indis_names($filter_array, array(WT_GED_ID), 'AND'); + $myindilist = search_indis_names($filter_array, array(WT_GED_ID), 'AND'); if ($myindilist) { echo "<td class=\"list_value_wrap\"><ul>"; usort($myindilist, array('WT_GedcomRecord', 'compare')); foreach ($myindilist as $indi) { $nam = WT_Filter::escapeHtml($indi->getFullName()); echo "<li><a href=\"#\" onclick=\"pasterow( - '".$indi->getXref()."' , - '".$nam."' , - '".$indi->getSex()."' , - '".$indi->getbirthyear()."' , - '".(1901-$indi->getbirthyear())."' , - '".$indi->getbirthplace()."'); return false;\"> - <b>".$indi->getFullName()."</b> "; + '".$indi->getXref() . "' , + '".$nam . "' , + '".$indi->getSex() . "' , + '".$indi->getbirthyear() . "' , + '".(1901 - $indi->getbirthyear()) . "' , + '".$indi->getbirthplace() . "'); return false;\"> + <b>".$indi->getFullName() . "</b> "; - $born=WT_Gedcom_Tag::getLabel('BIRT'); + $born = WT_Gedcom_Tag::getLabel('BIRT'); echo "</span><br><span class=\"list_item\">", $born, " ", $indi->getbirthyear(), " ", $indi->getbirthplace(), "</span></a></li>"; echo "<hr>"; } @@ -169,14 +169,14 @@ class GEDFact_assistant_WT_Module extends WT_Module { ->setPageTitle(WT_I18N::translate('Link to an existing media object')) ->pageHeader(); - $record=WT_GedcomRecord::getInstance($iid2); + $record = WT_GedcomRecord::getInstance($iid2); if ($record) { - $headjs=''; + $headjs = ''; if ($record instanceof WT_Family) { if ($record->getHusband()) { - $headjs=$record->getHusband()->getXref(); + $headjs = $record->getHusband()->getXref(); } elseif ($record->getWife()) { - $headjs=$record->getWife()->getXref(); + $headjs = $record->getWife()->getXref(); } } ?> @@ -297,8 +297,8 @@ class GEDFact_assistant_WT_Module extends WT_Module { $title . "\n" . // The newline allows the framework to expand the details and turn the first line into a link '<p>' . $preamble . '</p>' . '<table class="table-census-assistant">' . - '<thead>' . $thead . '</thead>' . - '<tbody>' . $tbody . '</tbody>' . + '<thead>' . $thead . '</thead>' . + '<tbody>' . $tbody . '</tbody>' . '</table>' . '<p>' . $postamble . '</p>'; } else { diff --git a/modules_v3/batch_update/plugins/married_names.php b/modules_v3/batch_update/plugins/married_names.php index 77dbc71f6e..cfc5406df7 100644 --- a/modules_v3/batch_update/plugins/married_names.php +++ b/modules_v3/batch_update/plugins/married_names.php @@ -67,22 +67,22 @@ class married_names_bu_plugin extends base_plugin { $SURNAME_TRADITION = $WT_TREE->getPreference('SURNAME_TRADITION'); preg_match('/^1 NAME (.*)/m', $gedrec, $match); - $wife_name=$match[1]; - $married_names=array(); + $wife_name = $match[1]; + $married_names = array(); foreach (self::surnamesToAdd($xref, $gedrec) as $surname) { switch ($this->surname) { case 'add': - $married_names[]="\n2 _MARNM ".str_replace('/', '', $wife_name).' /'.$surname.'/'; + $married_names[] = "\n2 _MARNM " . str_replace('/', '', $wife_name) . ' /' . $surname . '/'; break; case 'replace': if ($SURNAME_TRADITION === 'polish') { - $surname=preg_replace(array('/ski$/','/cki$/','/dzki$/'), array('ska', 'cka', 'dzka'), $surname); + $surname = preg_replace(array('/ski$/', '/cki$/', '/dzki$/'), array('ska', 'cka', 'dzka'), $surname); } - $married_names[]="\n2 _MARNM ".preg_replace('!/.*/!', '/'.$surname.'/', $wife_name); + $married_names[] = "\n2 _MARNM " . preg_replace('!/.*/!', '/' . $surname . '/', $wife_name); break; } } - return preg_replace('/(^1 NAME .*([\r\n]+[2-9].*)*)/m', '\\1'.implode('', $married_names), $gedrec, 1); + return preg_replace('/(^1 NAME .*([\r\n]+[2-9].*)*)/m', '\\1' . implode('', $married_names), $gedrec, 1); } /** @@ -92,20 +92,20 @@ class married_names_bu_plugin extends base_plugin { * @return string[] */ private function surnamesToAdd($xref, $gedrec) { - $wife_surnames=self::surnames($xref, $gedrec); - $husb_surnames=array(); - $missing_surnames=array(); + $wife_surnames = self::surnames($xref, $gedrec); + $husb_surnames = array(); + $missing_surnames = array(); preg_match_all('/^1 FAMS @(.+)@/m', $gedrec, $fmatch); foreach ($fmatch[1] as $famid) { - $famrec=batch_update::getLatestRecord($famid, 'FAM'); + $famrec = batch_update::getLatestRecord($famid, 'FAM'); if (preg_match('/^1 MARR/m', $famrec) && preg_match('/^1 HUSB @(.+)@/m', $famrec, $hmatch)) { - $husbrec=batch_update::getLatestRecord($hmatch[1], 'INDI'); - $husb_surnames=array_unique(array_merge($husb_surnames, self::surnames($hmatch[1], $husbrec))); + $husbrec = batch_update::getLatestRecord($hmatch[1], 'INDI'); + $husb_surnames = array_unique(array_merge($husb_surnames, self::surnames($hmatch[1], $husbrec))); } } foreach ($husb_surnames as $husb_surname) { if (!in_array($husb_surname, $wife_surnames)) { - $missing_surnames[]=$husb_surname; + $missing_surnames[] = $husb_surname; } } @@ -144,9 +144,9 @@ class married_names_bu_plugin extends base_plugin { parent::getOptionsForm() . '<tr valign="top"><th>' . WT_I18N::translate('Surname option') . '</th>' . '<td class="optionbox"><select name="surname" onchange="reset_reload();"><option value="replace"' . - ($this->surname=='replace' ? ' selected="selected"' : '') . + ($this->surname == 'replace' ? ' selected="selected"' : '') . '">' . WT_I18N::translate('Wife’s surname replaced by husband’s surname') . '</option><option value="add"' . - ($this->surname=='add' ? ' selected="selected"' : '') . + ($this->surname == 'add' ? ' selected="selected"' : '') . '">' . WT_I18N::translate('Wife’s maiden surname becomes new given name') . '</option></select></td></tr>'; } } diff --git a/modules_v3/charts/module.php b/modules_v3/charts/module.php index 60782253f8..10219a500d 100644 --- a/modules_v3/charts/module.php +++ b/modules_v3/charts/module.php @@ -37,7 +37,7 @@ class charts_WT_Module extends WT_Module implements WT_Module_Block { } /** {@inheritdoc} */ - public function getBlock($block_id, $template=true, $cfg=null) { + public function getBlock($block_id, $template = true, $cfg = null) { global $WT_TREE, $ctype, $PEDIGREE_FULL_DETAILS, $show_full, $controller; $PEDIGREE_ROOT_ID = $WT_TREE->getPreference('PEDIGREE_ROOT_ID'); @@ -74,21 +74,21 @@ class charts_WT_Module extends WT_Module implements WT_Module_Block { $person = WT_Individual::getInstance($pid); } - if ($type!='treenav' && $person) { + if ($type != 'treenav' && $person) { $chartController = new WT_Controller_Hourglass($person->getXref(), 0, false); $controller->addInlineJavascript($chartController->setupJavascript()); } - $id=$this->getName().$block_id; - $class=$this->getName().'_block'; - if ($ctype=='gedcom' && WT_USER_GEDCOM_ADMIN || $ctype=='user' && Auth::check()) { - $title='<i class="icon-admin" title="'.WT_I18N::translate('Configure').'" onclick="modalDialog(\'block_edit.php?block_id='.$block_id.'\', \''.$this->getTitle().'\');"></i>'; + $id = $this->getName() . $block_id; + $class = $this->getName() . '_block'; + if ($ctype == 'gedcom' && WT_USER_GEDCOM_ADMIN || $ctype == 'user' && Auth::check()) { + $title = '<i class="icon-admin" title="' . WT_I18N::translate('Configure') . '" onclick="modalDialog(\'block_edit.php?block_id=' . $block_id . '\', \'' . $this->getTitle() . '\');"></i>'; } else { - $title=''; + $title = ''; } if ($person) { - switch($type) { + switch ($type) { case 'pedigree': $title .= WT_I18N::translate('Pedigree of %s', $person->getFullName()); break; @@ -104,16 +104,16 @@ class charts_WT_Module extends WT_Module implements WT_Module_Block { } $title .= help_link('index_charts', $this->getName()); $content = '<table cellspacing="0" cellpadding="0" border="0"><tr>'; - if ($type=='descendants' || $type=='hourglass') { + if ($type == 'descendants' || $type == 'hourglass') { $content .= "<td valign=\"middle\">"; ob_start(); $chartController->printDescendency($person, 1, false); $content .= ob_get_clean(); $content .= "</td>"; } - if ($type=='pedigree' || $type=='hourglass') { + if ($type == 'pedigree' || $type == 'hourglass') { //-- print out the root person - if ($type!='hourglass') { + if ($type != 'hourglass') { $content .= "<td valign=\"middle\">"; ob_start(); print_pedigree_person($person); @@ -126,22 +126,22 @@ class charts_WT_Module extends WT_Module implements WT_Module_Block { $content .= ob_get_clean(); $content .= "</td>"; } - if ($type=='treenav') { - require_once WT_MODULES_DIR.'tree/module.php'; - require_once WT_MODULES_DIR.'tree/class_treeview.php'; - $mod=new tree_WT_Module; - $tv=new TreeView; + if ($type == 'treenav') { + require_once WT_MODULES_DIR . 'tree/module.php'; + require_once WT_MODULES_DIR . 'tree/class_treeview.php'; + $mod = new tree_WT_Module; + $tv = new TreeView; $content .= '<td>'; - $content .= '<script>jQuery("head").append(\'<link rel="stylesheet" href="'.$mod->css().'" type="text/css" />\');</script>'; - $content .= '<script src="'.$mod->js().'"></script>'; + $content .= '<script>jQuery("head").append(\'<link rel="stylesheet" href="' . $mod->css() . '" type="text/css" />\');</script>'; + $content .= '<script src="' . $mod->js() . '"></script>'; list($html, $js) = $tv->drawViewport($person, 2); - $content .= $html.'<script>'.$js.'</script>'; + $content .= $html . '<script>' . $js . '</script>'; $content .= '</td>'; } $content .= "</tr></table>"; } else { - $content=WT_I18N::translate('You must select an individual and chart type in the block configuration settings.'); + $content = WT_I18N::translate('You must select an individual and chart type in the block configuration settings.'); } // Restore GEDCOM configuration @@ -176,14 +176,14 @@ class charts_WT_Module extends WT_Module implements WT_Module_Block { /** {@inheritdoc} */ public function configureBlock($block_id) { global $WT_TREE, $controller; - require_once WT_ROOT.'includes/functions/functions_edit.php'; + require_once WT_ROOT . 'includes/functions/functions_edit.php'; $PEDIGREE_ROOT_ID = $WT_TREE->getPreference('PEDIGREE_ROOT_ID'); if (WT_Filter::postBool('save') && WT_Filter::checkCsrf()) { set_block_setting($block_id, 'details', WT_Filter::postBool('details')); - set_block_setting($block_id, 'type', WT_Filter::post('type', 'pedigree|descendants|hourglass|treenav', 'pedigree')); - set_block_setting($block_id, 'pid', WT_Filter::post('pid', WT_REGEX_XREF)); + set_block_setting($block_id, 'type', WT_Filter::post('type', 'pedigree|descendants|hourglass|treenav', 'pedigree')); + set_block_setting($block_id, 'pid', WT_Filter::post('pid', WT_REGEX_XREF)); exit; } @@ -217,7 +217,7 @@ class charts_WT_Module extends WT_Module implements WT_Module_Block { <input data-autocomplete-type="INDI" type="text" name="pid" id="pid" value="<?php echo $pid; ?>" size="5"> <?php echo print_findindi_link('pid'); - $root=WT_Individual::getInstance($pid); + $root = WT_Individual::getInstance($pid); if ($root) { echo ' <span class="list_item">', $root->getFullName(), $root->format_first_major_fact(WT_EVENTS_BIRT, 1), '</span>'; } diff --git a/modules_v3/clippings/clippings_ctrl.php b/modules_v3/clippings/clippings_ctrl.php index 1a68fc0290..ea46ec33b4 100644 --- a/modules_v3/clippings/clippings_ctrl.php +++ b/modules_v3/clippings/clippings_ctrl.php @@ -30,8 +30,8 @@ if (!defined('WT_WEBTREES')) { exit; } -require_once WT_ROOT.'includes/functions/functions_export.php'; -require_once WT_ROOT.'library/pclzip.lib.php'; +require_once WT_ROOT . 'includes/functions/functions_export.php'; +require_once WT_ROOT . 'library/pclzip.lib.php'; /** * Main controller class for the Clippings page. @@ -48,7 +48,7 @@ class WT_Controller_Clippings { var $conv_path; var $privatize_export; var $Zip; - var $level1; // number of levels of ancestors + var $level1; // number of levels of ancestors var $level2; var $level3; // number of levels of descendents @@ -149,9 +149,9 @@ class WT_Controller_Clippings { } elseif ($this->action == 'remove') { unset ($WT_SESSION->cart[WT_GED_ID][$this->id]); } elseif ($this->action == 'empty') { - $WT_SESSION->cart[WT_GED_ID]=array(); + $WT_SESSION->cart[WT_GED_ID] = array(); } elseif ($this->action == 'download') { - $media = array (); + $media = array(); $mediacount = 0; $filetext = gedcom_header(WT_GEDCOM); // Include SUBM/SUBN records, if they exist @@ -160,21 +160,21 @@ class WT_Controller_Clippings { ->execute(array('SUBN', WT_GED_ID)) ->fetchOne(); if ($subn) { - $filetext .= $subn."\n"; + $filetext .= $subn . "\n"; } $subm = WT_DB::prepare("SELECT o_gedcom FROM `##other` WHERE o_type=? AND o_file=?") ->execute(array('SUBM', WT_GED_ID)) ->fetchOne(); if ($subm) { - $filetext .= $subm."\n"; + $filetext .= $subm . "\n"; } if ($convert == "yes") { $filetext = str_replace("UTF-8", "ANSI", $filetext); $filetext = utf8_decode($filetext); } - switch($this->privatize_export) { + switch ($this->privatize_export) { case 'gedadmin': $access_level = WT_PRIV_NONE; break; @@ -195,19 +195,19 @@ class WT_Controller_Clippings { if ($object) { $record = $object->privatizeGedcom($access_level); // Remove links to objects that aren't in the cart - preg_match_all('/\n1 '.WT_REGEX_TAG.' @('.WT_REGEX_XREF.')@(\n[2-9].*)*/', $record, $matches, PREG_SET_ORDER); + preg_match_all('/\n1 ' . WT_REGEX_TAG . ' @(' . WT_REGEX_XREF . ')@(\n[2-9].*)*/', $record, $matches, PREG_SET_ORDER); foreach ($matches as $match) { if (!array_key_exists($match[1], $WT_SESSION->cart[WT_GED_ID])) { $record = str_replace($match[0], '', $record); } } - preg_match_all('/\n2 '.WT_REGEX_TAG.' @('.WT_REGEX_XREF.')@(\n[3-9].*)*/', $record, $matches, PREG_SET_ORDER); + preg_match_all('/\n2 ' . WT_REGEX_TAG . ' @(' . WT_REGEX_XREF . ')@(\n[3-9].*)*/', $record, $matches, PREG_SET_ORDER); foreach ($matches as $match) { if (!array_key_exists($match[1], $WT_SESSION->cart[WT_GED_ID])) { $record = str_replace($match[0], '', $record); } } - preg_match_all('/\n3 '.WT_REGEX_TAG.' @('.WT_REGEX_XREF.')@(\n[4-9].*)*/', $record, $matches, PREG_SET_ORDER); + preg_match_all('/\n3 ' . WT_REGEX_TAG . ' @(' . WT_REGEX_XREF . ')@(\n[4-9].*)*/', $record, $matches, PREG_SET_ORDER); foreach ($matches as $match) { if (!array_key_exists($match[1], $WT_SESSION->cart[WT_GED_ID])) { $record = str_replace($match[0], '', $record); @@ -220,25 +220,25 @@ class WT_Controller_Clippings { } switch ($object::RECORD_TYPE) { case 'INDI': - $filetext .= $record."\n"; + $filetext .= $record . "\n"; $filetext .= "1 SOUR @WEBTREES@\n"; - $filetext .= "2 PAGE ".WT_SERVER_NAME.WT_SCRIPT_PATH.$object->getRawUrl()."\n"; + $filetext .= "2 PAGE " . WT_SERVER_NAME . WT_SCRIPT_PATH . $object->getRawUrl() . "\n"; break; case 'FAM': - $filetext .= $record."\n"; + $filetext .= $record . "\n"; $filetext .= "1 SOUR @WEBTREES@\n"; - $filetext .= "2 PAGE ".WT_SERVER_NAME.WT_SCRIPT_PATH.$object->getRawUrl()."\n"; + $filetext .= "2 PAGE " . WT_SERVER_NAME . WT_SCRIPT_PATH . $object->getRawUrl() . "\n"; break; case 'SOUR': - $filetext .= $record."\n"; - $filetext .= "1 NOTE ".WT_SERVER_NAME.WT_SCRIPT_PATH.$object->getRawUrl()."\n"; + $filetext .= $record . "\n"; + $filetext .= "1 NOTE " . WT_SERVER_NAME . WT_SCRIPT_PATH . $object->getRawUrl() . "\n"; break; default: $ft = preg_match_all("/\n\d FILE (.+)/", $savedRecord, $match, PREG_SET_ORDER); for ($k = 0; $k < $ft; $k++) { // Skip external files and non-existant files if (file_exists(WT_DATA_DIR . $MEDIA_DIRECTORY . $match[$k][1])) { - $media[$mediacount] = array ( + $media[$mediacount] = array( PCLZIP_ATT_FILE_NAME => WT_DATA_DIR . $MEDIA_DIRECTORY . $match[$k][1], PCLZIP_ATT_FILE_NEW_FULL_NAME => $match[$k][1], ); @@ -254,7 +254,7 @@ class WT_Controller_Clippings { if ($this->IncludeMedia == "yes") { $this->media_list = $media; } - $filetext .= "0 @WEBTREES@ SOUR\n1 TITL ".WT_SERVER_NAME.WT_SCRIPT_PATH."\n"; + $filetext .= "0 @WEBTREES@ SOUR\n1 TITL " . WT_SERVER_NAME . WT_SCRIPT_PATH . "\n"; if ($user_id = $WT_TREE->getPreference('CONTACT_EMAIL')) { $user = User::find($user_id); $filetext .= "1 AUTH " . $user->getRealName() . "\n"; @@ -271,31 +271,31 @@ class WT_Controller_Clippings { * Loads everything in the clippings cart into a zip file. */ function zipCart() { - $tempFileName = 'clipping'.rand().'.ged'; - $fp = fopen(WT_DATA_DIR.$tempFileName, "wb"); + $tempFileName = 'clipping' . rand() . '.ged'; + $fp = fopen(WT_DATA_DIR . $tempFileName, "wb"); if ($fp) { - flock($fp,LOCK_EX); - fwrite($fp,$this->download_data); - flock($fp,LOCK_UN); + flock($fp, LOCK_EX); + fwrite($fp, $this->download_data); + flock($fp, LOCK_UN); fclose($fp); - $zipName = "clippings".rand(0, 1500).".zip"; - $fname = WT_DATA_DIR.$zipName; - $comment = "Created by ".WT_WEBTREES." ".WT_VERSION." on ".date("d M Y")."."; + $zipName = "clippings" . rand(0, 1500) . ".zip"; + $fname = WT_DATA_DIR . $zipName; + $comment = "Created by " . WT_WEBTREES . " " . WT_VERSION . " on " . date("d M Y") . "."; $archive = new PclZip($fname); // add the ged file to the root of the zip file (strip off the data folder) - $this->media_list[]= array (PCLZIP_ATT_FILE_NAME => WT_DATA_DIR.$tempFileName, PCLZIP_ATT_FILE_NEW_FULL_NAME => $tempFileName); + $this->media_list[] = array(PCLZIP_ATT_FILE_NAME => WT_DATA_DIR . $tempFileName, PCLZIP_ATT_FILE_NEW_FULL_NAME => $tempFileName); $v_list = $archive->create($this->media_list, PCLZIP_OPT_COMMENT, $comment); if ($v_list == 0) { - echo "Error : ".$archive->errorInfo(true)."</td></tr>"; + echo "Error : " . $archive->errorInfo(true) . "</td></tr>"; } else { - $openedFile = fopen($fname,"rb"); - $this->download_data = fread($openedFile,filesize($fname)); + $openedFile = fopen($fname, "rb"); + $this->download_data = fread($openedFile, filesize($fname)); fclose($openedFile); unlink($fname); } - unlink(WT_DATA_DIR.$tempFileName); + unlink(WT_DATA_DIR . $tempFileName); } else { - echo WT_I18N::translate('Cannot create')." ".WT_DATA_DIR."$tempFileName ".WT_I18N::translate('Check access rights on this directory.')."<br><br>"; + echo WT_I18N::translate('Cannot create') . " " . WT_DATA_DIR . "$tempFileName " . WT_I18N::translate('Check access rights on this directory.') . "<br><br>"; } } @@ -329,11 +329,11 @@ class WT_Controller_Clippings { global $WT_SESSION; if ($record->canShowName()) { - $WT_SESSION->cart[WT_GED_ID][$record->getXref()]=true; + $WT_SESSION->cart[WT_GED_ID][$record->getXref()] = true; // Add directly linked records - preg_match_all('/\n\d (?:OBJE|NOTE|SOUR|REPO) @('.WT_REGEX_XREF.')@/', $record->getGedcom(), $matches); + preg_match_all('/\n\d (?:OBJE|NOTE|SOUR|REPO) @(' . WT_REGEX_XREF . ')@/', $record->getGedcom(), $matches); foreach ($matches[1] as $match) { - $WT_SESSION->cart[WT_GED_ID][$match]=true; + $WT_SESSION->cart[WT_GED_ID][$match] = true; } } } @@ -355,8 +355,8 @@ class WT_Controller_Clippings { $this->addClipping($child); foreach ($child->getSpouseFamilies() as $child_family) { $this->addClipping($child_family); - if ($level>0) { - $this->addFamilyDescendancy($child_family, $level-1); // recurse on the childs family + if ($level > 0) { + $this->addFamilyDescendancy($child_family, $level - 1); // recurse on the childs family } } } @@ -391,11 +391,11 @@ class WT_Controller_Clippings { return; } $this->addClipping($person); - if ($level>0) { + if ($level > 0) { foreach ($person->getChildFamilies() as $family) { $this->addClipping($family); - $this->addAncestorsToCart($family->getHusband(), $level-1); - $this->addAncestorsToCart($family->getWife(), $level-1); + $this->addAncestorsToCart($family->getHusband(), $level - 1); + $this->addAncestorsToCart($family->getWife(), $level - 1); } } } @@ -410,11 +410,11 @@ class WT_Controller_Clippings { if (!$person) { return; } - if ($level>0) { + if ($level > 0) { foreach ($person->getChildFamilies() as $family) { $this->addFamilyMembers($family); - $this->addAncestorsToCartFamilies($family->getHusband(), $level-1); - $this->addAncestorsToCartFamilies($family->getWife(), $level-1); + $this->addAncestorsToCartFamilies($family->getHusband(), $level - 1); + $this->addAncestorsToCartFamilies($family->getWife(), $level - 1); } } } @@ -428,29 +428,29 @@ class WT_Controller_Clippings { * @return integer */ static function compareClippings($a, $b) { - $a=WT_GedcomRecord::getInstance($a); - $b=WT_GedcomRecord::getInstance($b); + $a = WT_GedcomRecord::getInstance($a); + $b = WT_GedcomRecord::getInstance($b); if ($a && $b) { switch ($a::RECORD_TYPE) { - case 'INDI': $t1=1; break; - case 'FAM': $t1=2; break; - case 'SOUR': $t1=3; break; - case 'REPO': $t1=4; break; - case 'OBJE': $t1=5; break; - case 'NOTE': $t1=6; break; - default: $t1=7; break; + case 'INDI': $t1 = 1; break; + case 'FAM': $t1 = 2; break; + case 'SOUR': $t1 = 3; break; + case 'REPO': $t1 = 4; break; + case 'OBJE': $t1 = 5; break; + case 'NOTE': $t1 = 6; break; + default: $t1 = 7; break; } switch ($b::RECORD_TYPE) { - case 'INDI': $t2=1; break; - case 'FAM': $t2=2; break; - case 'SOUR': $t2=3; break; - case 'REPO': $t2=4; break; - case 'OBJE': $t2=5; break; - case 'NOTE': $t2=6; break; - default: $t2=7; break; + case 'INDI': $t2 = 1; break; + case 'FAM': $t2 = 2; break; + case 'SOUR': $t2 = 3; break; + case 'REPO': $t2 = 4; break; + case 'OBJE': $t2 = 5; break; + case 'NOTE': $t2 = 6; break; + default: $t2 = 7; break; } - if ($t1!=$t2) { - return $t1-$t2; + if ($t1 != $t2) { + return $t1 - $t2; } else { return WT_GedcomRecord::compare($a, $b); } diff --git a/modules_v3/clippings/module.php b/modules_v3/clippings/module.php index 98e7605c64..17c1df9ef0 100644 --- a/modules_v3/clippings/module.php +++ b/modules_v3/clippings/module.php @@ -40,9 +40,9 @@ class clippings_WT_Module extends WT_Module implements WT_Module_Menu, WT_Module /** {@inheritdoc} */ public function modAction($mod_action) { - switch($mod_action) { + switch ($mod_action) { case 'ajax': - $html=$this->getSidebarAjaxContent(); + $html = $this->getSidebarAjaxContent(); Zend_Session::writeClose(); header('Content-Type: text/html; charset=UTF-8'); echo $html; @@ -50,10 +50,10 @@ class clippings_WT_Module extends WT_Module implements WT_Module_Menu, WT_Module case 'index': global $MAX_PEDIGREE_GENERATIONS, $controller, $WT_SESSION, $GEDCOM_MEDIA_PATH; - require_once WT_ROOT.WT_MODULES_DIR.'clippings/clippings_ctrl.php'; - require_once WT_ROOT.'includes/functions/functions_export.php'; + require_once WT_ROOT . WT_MODULES_DIR . 'clippings/clippings_ctrl.php'; + require_once WT_ROOT . 'includes/functions/functions_export.php'; - $clip_ctrl=new WT_Controller_Clippings; + $clip_ctrl = new WT_Controller_Clippings; $controller = new WT_Controller_Page; $controller @@ -70,9 +70,9 @@ class clippings_WT_Module extends WT_Module implements WT_Module_Menu, WT_Module echo '<h2>', WT_I18N::translate('Family tree clippings cart'), '</h2>'; } - if ($clip_ctrl->action=='add') { + if ($clip_ctrl->action == 'add') { $person = WT_GedcomRecord::getInstance($clip_ctrl->id); - echo '<h3><a href="', $person->getHtmlUrl(), '">'.$person->getFullName(), '</a></h3>'; + echo '<h3><a href="', $person->getHtmlUrl(), '">' . $person->getFullName(), '</a></h3>'; if ($clip_ctrl->type === 'FAM') { ?> <form action="module.php" method="get"> <input type="hidden" name="mod" value="clippings"> @@ -111,7 +111,7 @@ class clippings_WT_Module extends WT_Module implements WT_Module_Menu, WT_Module <tr><td class="topbottombar"><input type="submit" value="<?php echo WT_I18N::translate('Continue adding'); ?>"> </table> </form> - <?php } elseif ($clip_ctrl->type === 'SOUR') { ?> + <?php } elseif ($clip_ctrl->type === 'SOUR') { ?> <form action="module.php" method="get"> <input type="hidden" name="mod" value="clippings"> <input type="hidden" name="mod_action" value="index"> @@ -128,12 +128,12 @@ class clippings_WT_Module extends WT_Module implements WT_Module_Menu, WT_Module <?php } } - if ($clip_ctrl->privCount>0) { - echo "<span class=\"error\">".WT_I18N::translate('Some items could not be added due to privacy restrictions')."</span><br><br>"; + if ($clip_ctrl->privCount > 0) { + echo "<span class=\"error\">" . WT_I18N::translate('Some items could not be added due to privacy restrictions') . "</span><br><br>"; } if (!$WT_SESSION->cart[WT_GED_ID]) { - if ($clip_ctrl->action!='add') { + if ($clip_ctrl->action != 'add') { echo WT_I18N::translate('The clippings cart allows you to take extracts (“clippings”) from this family tree and bundle them up into a single file for downloading and subsequent importing into your own genealogy program. The downloadable file is recorded in GEDCOM format.<br><ul><li>How to take clippings?<br>This is really simple. Whenever you see a clickable name (individual, family, or source) you can go to the Details page of that name. There you will see the <b>Add to clippings cart</b> option. When you click that link you will be offered several options to download.</li><li>How to download?<br>Once you have items in your cart, you can download them just by clicking the “Download” link. Follow the instructions and links.</li></ul>'); ?> @@ -169,7 +169,7 @@ class clippings_WT_Module extends WT_Module implements WT_Module_Menu, WT_Module } else { // Keep track of the INDI from the parent page, otherwise it will // get lost after ajax updates - $pid=WT_Filter::get('pid', WT_REGEX_XREF); + $pid = WT_Filter::get('pid', WT_REGEX_XREF); if ($clip_ctrl->action != 'download' && $clip_ctrl->action != 'add') { ?> <table><tr><td class="width33" valign="top" rowspan="3"> @@ -260,16 +260,16 @@ class clippings_WT_Module extends WT_Module implements WT_Module_Menu, WT_Module </tr> <?php foreach (array_keys($WT_SESSION->cart[WT_GED_ID]) as $xref) { - $record=WT_GedcomRecord::getInstance($xref); + $record = WT_GedcomRecord::getInstance($xref); if ($record) { switch ($record::RECORD_TYPE) { - case 'INDI': $icon='icon-indis'; break; - case 'FAM': $icon='icon-sfamily'; break; - case 'SOUR': $icon='icon-source'; break; - case 'REPO': $icon='icon-repository'; break; - case 'NOTE': $icon='icon-note'; break; - case 'OBJE': $icon='icon-media'; break; - default: $icon='icon-clippings'; break; + case 'INDI': $icon = 'icon-indis'; break; + case 'FAM': $icon = 'icon-sfamily'; break; + case 'SOUR': $icon = 'icon-source'; break; + case 'REPO': $icon = 'icon-repository'; break; + case 'NOTE': $icon = 'icon-note'; break; + case 'OBJE': $icon = 'icon-media'; break; + default: $icon = 'icon-clippings'; break; } ?> <tr><td class="list_value"> @@ -308,13 +308,13 @@ class clippings_WT_Module extends WT_Module implements WT_Module_Menu, WT_Module return null; } //-- main clippings menu item - $menu = new WT_Menu($this->getTitle(), 'module.php?mod=clippings&mod_action=index&ged='.WT_GEDURL, 'menu-clippings'); + $menu = new WT_Menu($this->getTitle(), 'module.php?mod=clippings&mod_action=index&ged=' . WT_GEDURL, 'menu-clippings'); if (isset($controller->record)) { - $submenu = new WT_Menu($this->getTitle(), 'module.php?mod=clippings&mod_action=index&ged='.WT_GEDURL, 'menu-clippingscart'); + $submenu = new WT_Menu($this->getTitle(), 'module.php?mod=clippings&mod_action=index&ged=' . WT_GEDURL, 'menu-clippingscart'); $menu->addSubmenu($submenu); } if (!empty($controller->record) && $controller->record->canShow()) { - $submenu = new WT_Menu(WT_I18N::translate('Add to clippings cart'), 'module.php?mod=clippings&mod_action=index&action=add&id='.$controller->record->getXref(), 'menu-clippingsadd'); + $submenu = new WT_Menu(WT_I18N::translate('Add to clippings cart'), 'module.php?mod=clippings&mod_action=index&action=add&id=' . $controller->record->getXref(), 'menu-clippingsadd'); $menu->addSubmenu($submenu); } return $menu; @@ -332,7 +332,7 @@ class clippings_WT_Module extends WT_Module implements WT_Module_Menu, WT_Module if ($SEARCH_SPIDER) { return false; } else { - require_once WT_ROOT.WT_MODULES_DIR.'clippings/clippings_ctrl.php'; + require_once WT_ROOT . WT_MODULES_DIR . 'clippings/clippings_ctrl.php'; // Creating a controller has the side effect of initialising the cart new WT_Controller_Clippings; @@ -352,12 +352,12 @@ class clippings_WT_Module extends WT_Module implements WT_Module_Menu, WT_Module }); '); - return '<div id="sb_clippings_content">' . $this->getCartList() . '</div>'; + return '<div id="sb_clippings_content">' . $this->getCartList() . '</div>'; } /** {@inheritdoc} */ public function getSidebarAjaxContent() { - require_once WT_ROOT.WT_MODULES_DIR.'clippings/clippings_ctrl.php'; + require_once WT_ROOT . WT_MODULES_DIR . 'clippings/clippings_ctrl.php'; global $WT_SESSION; @@ -406,7 +406,7 @@ class clippings_WT_Module extends WT_Module implements WT_Module_Menu, WT_Module } elseif ($remove) { unset ($WT_SESSION->cart[WT_GED_ID][$remove]); } elseif (isset($_REQUEST['empty'])) { - $WT_SESSION->cart[WT_GED_ID] = array (); + $WT_SESSION->cart[WT_GED_ID] = array(); } elseif (isset($_REQUEST['download'])) { return $this->downloadForm($clip_ctrl); } @@ -423,52 +423,52 @@ class clippings_WT_Module extends WT_Module implements WT_Module_Menu, WT_Module // Keep track of the INDI from the parent page, otherwise it will // get lost after ajax updates - $pid=WT_Filter::get('pid', WT_REGEX_XREF); + $pid = WT_Filter::get('pid', WT_REGEX_XREF); if (!$WT_SESSION->cart[WT_GED_ID]) { - $out=WT_I18N::translate('Your clippings cart is empty.'); + $out = WT_I18N::translate('Your clippings cart is empty.'); } else { - $out='<ul>'; + $out = '<ul>'; foreach (array_keys($WT_SESSION->cart[WT_GED_ID]) as $xref) { - $record=WT_GedcomRecord::getInstance($xref); - if ($record && ($record::RECORD_TYPE=='INDI' || $record::RECORD_TYPE=='FAM')) { + $record = WT_GedcomRecord::getInstance($xref); + if ($record && ($record::RECORD_TYPE == 'INDI' || $record::RECORD_TYPE == 'FAM')) { switch ($record::RECORD_TYPE) { - case 'INDI': $icon='icon-indis'; break; - case 'FAM': $icon='icon-sfamily'; break; + case 'INDI': $icon = 'icon-indis'; break; + case 'FAM': $icon = 'icon-sfamily'; break; } $out .= '<li>'; if (!empty($icon)) { - $out .= '<i class="'.$icon.'"></i>'; + $out .= '<i class="' . $icon . '"></i>'; } - $out .= '<a href="'.$record->getHtmlUrl().'">'; + $out .= '<a href="' . $record->getHtmlUrl() . '">'; if ($record::RECORD_TYPE == 'INDI') { - $out .=$record->getSexImage(); + $out .= $record->getSexImage(); } - $out .= ' '.$record->getFullName().' '; + $out .= ' ' . $record->getFullName() . ' '; if ($record::RECORD_TYPE == 'INDI' && $record->canShow()) { - $out .= ' ('.$record->getLifeSpan().')'; + $out .= ' (' . $record->getLifeSpan() . ')'; } $out .= '</a>'; - $out .= '<a class="icon-remove remove_cart" href="module.php?mod='.$this->getName().'&mod_action=ajax&sb_action=clippings&remove='.$xref.'&pid='.$pid.'" title="'.WT_I18N::translate('Remove').'"></a>'; - $out .='</li>'; + $out .= '<a class="icon-remove remove_cart" href="module.php?mod=' . $this->getName() . '&mod_action=ajax&sb_action=clippings&remove=' . $xref . '&pid=' . $pid . '" title="' . WT_I18N::translate('Remove') . '"></a>'; + $out .= '</li>'; } } - $out.='</ul>'; + $out .= '</ul>'; } if ($WT_SESSION->cart[WT_GED_ID]) { - $out.= - '<br><a href="module.php?mod='.$this->getName().'&mod_action=ajax&sb_action=clippings&empty=true&pid='.$pid.'" class="remove_cart">'. - WT_I18N::translate('Empty the clippings cart'). - '</a>'.help_link('empty_cart', $this->getName()). - '<br>'. - '<a href="module.php?mod='.$this->getName().'&mod_action=ajax&sb_action=clippings&download=true&pid='.$pid.'" class="add_cart">'. - WT_I18N::translate('Download'). + $out .= + '<br><a href="module.php?mod=' . $this->getName() . '&mod_action=ajax&sb_action=clippings&empty=true&pid=' . $pid . '" class="remove_cart">' . + WT_I18N::translate('Empty the clippings cart') . + '</a>' . help_link('empty_cart', $this->getName()) . + '<br>' . + '<a href="module.php?mod=' . $this->getName() . '&mod_action=ajax&sb_action=clippings&download=true&pid=' . $pid . '" class="add_cart">' . + WT_I18N::translate('Download') . '</a>'; } - $record=WT_Individual::getInstance($pid); + $record = WT_Individual::getInstance($pid); if ($record && !array_key_exists($record->getXref(), $WT_SESSION->cart[WT_GED_ID])) { - $out .= '<br><a href="module.php?mod='.$this->getName().'&mod_action=ajax&sb_action=clippings&add='.$pid.'&pid='.$pid.'" class="add_cart"><i class="icon-clippings"></i> '.WT_I18N::translate('Add %s to the clippings cart', $record->getFullName()).'</a>'; + $out .= '<br><a href="module.php?mod=' . $this->getName() . '&mod_action=ajax&sb_action=clippings&add=' . $pid . '&pid=' . $pid . '" class="add_cart"><i class="icon-clippings"></i> ' . WT_I18N::translate('Add %s to the clippings cart', $record->getFullName()) . '</a>'; } return $out; } @@ -481,64 +481,64 @@ class clippings_WT_Module extends WT_Module implements WT_Module_Menu, WT_Module public function askAddOptions(WT_Individual $person) { global $MAX_PEDIGREE_GENERATIONS; - $out = '<h3><a href="'.$person->getHtmlUrl().'">'.$person->getFullName().'</a></h3>'; + $out = '<h3><a href="' . $person->getHtmlUrl() . '">' . $person->getFullName() . '</a></h3>'; $out .= '<script>'; $out .= 'function radAncestors(elementid) {var radFamilies=document.getElementById(elementid);radFamilies.checked=true;} function continueAjax(frm) { var others = jQuery("input[name=\'others\']:checked").val(); - var link = "module.php?mod='.$this->getName().'&mod_action=ajax&sb_action=clippings&add1="+frm.pid.value+"&others="+others+"&level1="+frm.level1.value+"&level2="+frm.level2.value+"&level3="+frm.level3.value; + var link = "module.php?mod='.$this->getName() . '&mod_action=ajax&sb_action=clippings&add1="+frm.pid.value+"&others="+others+"&level1="+frm.level1.value+"&level2="+frm.level2.value+"&level3="+frm.level3.value; jQuery("#sb_clippings_content").load(link); }'; $out .= '</script>'; - if ($person::RECORD_TYPE=='FAM') { + if ($person::RECORD_TYPE == 'FAM') { $out .= '<form action="module.php" method="get" onsubmit="continueAjax(this); return false;"> <input type="hidden" name="mod" value="clippings"> <input type="hidden" name="mod_action" value="index"> <table> - <tr><td class="topbottombar">'.WT_I18N::translate('Which other links from this family would you like to add?').' - <input type="hidden" name="pid" value="'.$person->getXref().'"> - <input type="hidden" name="type" value="'.$person::RECORD_TYPE.'"> + <tr><td class="topbottombar">'.WT_I18N::translate('Which other links from this family would you like to add?') . ' + <input type="hidden" name="pid" value="'.$person->getXref() . '"> + <input type="hidden" name="type" value="'.$person::RECORD_TYPE . '"> <input type="hidden" name="action" value="add1"></td></tr> - <tr><td class="optionbox"><input type="radio" name="others" checked value="none">'.WT_I18N::translate('Add just this family record.').'</td></tr> - <tr><td class="optionbox"><input type="radio" name="others" value="parents">'.WT_I18N::translate('Add parents’ records together with this family record.').'</td></tr> - <tr><td class="optionbox"><input type="radio" name="others" value="members">'.WT_I18N::translate('Add parents’ and children’s records together with this family record.').'</td></tr> - <tr><td class="optionbox"><input type="radio" name="others" value="descendants">'.WT_I18N::translate('Add parents’ and all descendants’ records together with this family record.').'</td></tr> - <tr><td class="topbottombar"><input type="submit" value="'.WT_I18N::translate('Continue adding').'"></td></tr> + <tr><td class="optionbox"><input type="radio" name="others" checked value="none">'.WT_I18N::translate('Add just this family record.') . '</td></tr> + <tr><td class="optionbox"><input type="radio" name="others" value="parents">'.WT_I18N::translate('Add parents’ records together with this family record.') . '</td></tr> + <tr><td class="optionbox"><input type="radio" name="others" value="members">'.WT_I18N::translate('Add parents’ and children’s records together with this family record.') . '</td></tr> + <tr><td class="optionbox"><input type="radio" name="others" value="descendants">'.WT_I18N::translate('Add parents’ and all descendants’ records together with this family record.') . '</td></tr> + <tr><td class="topbottombar"><input type="submit" value="'.WT_I18N::translate('Continue adding') . '"></td></tr> </table> </form>'; - } elseif ($person::RECORD_TYPE=='INDI') { + } elseif ($person::RECORD_TYPE == 'INDI') { $out .= '<form action="module.php" method="get" onsubmit="continueAjax(this); return false;"> <input type="hidden" name="mod" value="clippings"> <input type="hidden" name="mod_action" value="index"> - '.WT_I18N::translate('Which links from this individual would you also like to add?').' - <input type="hidden" name="pid" value="'.$person->getXref().'"> - <input type="hidden" name="type" value="'.$person::RECORD_TYPE.'"> + '.WT_I18N::translate('Which links from this individual would you also like to add?') . ' + <input type="hidden" name="pid" value="'.$person->getXref() . '"> + <input type="hidden" name="type" value="'.$person::RECORD_TYPE . '"> <input type="hidden" name="action" value="add1"> <ul> - <li><input type="radio" name="others" checked value="none">'.WT_I18N::translate('Add just this individual.').'</li> - <li><input type="radio" name="others" value="parents">'.WT_I18N::translate('Add this individual, his parents, and siblings.').'</li> - <li><input type="radio" name="others" value="ancestors" id="ancestors">'.WT_I18N::translate('Add this individual and his direct line ancestors.').'<br> - '.WT_I18N::translate('Number of generations:').'<input type="text" size="4" name="level1" value="'.$MAX_PEDIGREE_GENERATIONS.'" onfocus="radAncestors(\'ancestors\');"></li> - <li><input type="radio" name="others" value="ancestorsfamilies" id="ancestorsfamilies">'.WT_I18N::translate('Add this individual, his direct line ancestors, and their families.').'<br> - '.WT_I18N::translate('Number of generations:').' <input type="text" size="4" name="level2" value="'. $MAX_PEDIGREE_GENERATIONS.'" onfocus="radAncestors(\'ancestorsfamilies\');"></li> - <li><input type="radio" name="others" value="members">'.WT_I18N::translate('Add this individual, his spouse, and children.').'</li> - <li><input type="radio" name="others" value="descendants" id="descendants">'.WT_I18N::translate('Add this individual, his spouse, and all descendants.').'<br > - '.WT_I18N::translate('Number of generations:').' <input type="text" size="4" name="level3" value="'.$MAX_PEDIGREE_GENERATIONS.'" onfocus="radAncestors(\'descendants\');"></li> + <li><input type="radio" name="others" checked value="none">'.WT_I18N::translate('Add just this individual.') . '</li> + <li><input type="radio" name="others" value="parents">'.WT_I18N::translate('Add this individual, his parents, and siblings.') . '</li> + <li><input type="radio" name="others" value="ancestors" id="ancestors">'.WT_I18N::translate('Add this individual and his direct line ancestors.') . '<br> + '.WT_I18N::translate('Number of generations:') . '<input type="text" size="4" name="level1" value="' . $MAX_PEDIGREE_GENERATIONS . '" onfocus="radAncestors(\'ancestors\');"></li> + <li><input type="radio" name="others" value="ancestorsfamilies" id="ancestorsfamilies">'.WT_I18N::translate('Add this individual, his direct line ancestors, and their families.') . '<br> + '.WT_I18N::translate('Number of generations:') . ' <input type="text" size="4" name="level2" value="' . $MAX_PEDIGREE_GENERATIONS . '" onfocus="radAncestors(\'ancestorsfamilies\');"></li> + <li><input type="radio" name="others" value="members">'.WT_I18N::translate('Add this individual, his spouse, and children.') . '</li> + <li><input type="radio" name="others" value="descendants" id="descendants">'.WT_I18N::translate('Add this individual, his spouse, and all descendants.') . '<br > + '.WT_I18N::translate('Number of generations:') . ' <input type="text" size="4" name="level3" value="' . $MAX_PEDIGREE_GENERATIONS . '" onfocus="radAncestors(\'descendants\');"></li> </ul> - <input type="submit" value="'.WT_I18N::translate('Continue adding').'"> + <input type="submit" value="'.WT_I18N::translate('Continue adding') . '"> </form>'; - } else if ($person::RECORD_TYPE == 'SOUR') { + } else if ($person::RECORD_TYPE == 'SOUR') { $out .= '<form action="module.php" method="get" onsubmit="continueAjax(this); return false;"> <input type="hidden" name="mod" value="clippings"> <input type="hidden" name="mod_action" value="index"> <table> - <tr><td class="topbottombar">'.WT_I18N::translate('Which records linked to this source should be added?').' - <input type="hidden" name="pid" value="'.$person->getXref().'"> - <input type="hidden" name="type" value="'.$person::RECORD_TYPE.'"> + <tr><td class="topbottombar">'.WT_I18N::translate('Which records linked to this source should be added?') . ' + <input type="hidden" name="pid" value="'.$person->getXref() . '"> + <input type="hidden" name="type" value="'.$person::RECORD_TYPE . '"> <input type="hidden" name="action" value="add1"></td></tr> - <tr><td class="optionbox"><input type="radio" name="others" checked value="none">'.WT_I18N::translate('Add just this source.').'</td></tr> - <tr><td class="optionbox"><input type="radio" name="others" value="linked">'.WT_I18N::translate('Add this source and families/individuals linked to it.').'</td></tr> - <tr><td class="topbottombar"><input type="submit" value="'.WT_I18N::translate('Continue adding').'"> + <tr><td class="optionbox"><input type="radio" name="others" checked value="none">'.WT_I18N::translate('Add just this source.') . '</td></tr> + <tr><td class="optionbox"><input type="radio" name="others" value="linked">'.WT_I18N::translate('Add this source and families/individuals linked to it.') . '</td></tr> + <tr><td class="topbottombar"><input type="submit" value="'.WT_I18N::translate('Continue adding') . '"> </table> </form>'; } @@ -553,7 +553,7 @@ class clippings_WT_Module extends WT_Module implements WT_Module_Menu, WT_Module */ public function downloadForm(WT_Controller_Clippings $clip_ctrl) { global $GEDCOM_MEDIA_PATH; - $pid=WT_Filter::get('pid', WT_REGEX_XREF); + $pid = WT_Filter::get('pid', WT_REGEX_XREF); $out = '<script>'; $out .= 'function cancelDownload() { @@ -564,53 +564,53 @@ class clippings_WT_Module extends WT_Module implements WT_Module_Menu, WT_Module $out .= '<form method="get" action="module.php"> <input type="hidden" name="mod" value="clippings"> <input type="hidden" name="mod_action" value="index"> - <input type="hidden" name="pid" value="'.$pid.'"> + <input type="hidden" name="pid" value="'.$pid . '"> <input type="hidden" name="action" value="download"> <table> - <tr><td colspan="2" class="topbottombar"><h2>'.WT_I18N::translate('Download').'</h2></td></tr> - <tr><td class="descriptionbox width50 wrap">'.WT_I18N::translate('Zip file(s)').help_link('zip').'</td> + <tr><td colspan="2" class="topbottombar"><h2>'.WT_I18N::translate('Download') . '</h2></td></tr> + <tr><td class="descriptionbox width50 wrap">'.WT_I18N::translate('Zip file(s)') . help_link('zip') . '</td> <td class="optionbox"><input type="checkbox" name="Zip" value="yes" checked="checked"></td></tr> - <tr><td class="descriptionbox width50 wrap">'.WT_I18N::translate('Include media (automatically zips files)').help_link('include_media').'</td> + <tr><td class="descriptionbox width50 wrap">'.WT_I18N::translate('Include media (automatically zips files)') . help_link('include_media') . '</td> <td class="optionbox"><input type="checkbox" name="IncludeMedia" value="yes" checked="checked"></td></tr> '; if (WT_USER_GEDCOM_ADMIN) { - $out.= - '<tr><td class="descriptionbox width50 wrap">'.WT_I18N::translate('Apply privacy settings?').help_link('apply_privacy').'</td>'. - '<td class="optionbox">'. - ' <input type="radio" name="privatize_export" value="none" checked="checked"> '.WT_I18N::translate('None').'<br>'. - ' <input type="radio" name="privatize_export" value="gedadmin"> '.WT_I18N::translate('Manager').'<br>'. - ' <input type="radio" name="privatize_export" value="user"> '.WT_I18N::translate('Member').'<br>'. - ' <input type="radio" name="privatize_export" value="visitor"> '.WT_I18N::translate('Visitor'). + $out .= + '<tr><td class="descriptionbox width50 wrap">' . WT_I18N::translate('Apply privacy settings?') . help_link('apply_privacy') . '</td>' . + '<td class="optionbox">' . + ' <input type="radio" name="privatize_export" value="none" checked="checked"> ' . WT_I18N::translate('None') . '<br>' . + ' <input type="radio" name="privatize_export" value="gedadmin"> ' . WT_I18N::translate('Manager') . '<br>' . + ' <input type="radio" name="privatize_export" value="user"> ' . WT_I18N::translate('Member') . '<br>' . + ' <input type="radio" name="privatize_export" value="visitor"> ' . WT_I18N::translate('Visitor') . '</td></tr>'; } elseif (WT_USER_CAN_ACCESS) { - $out.= - '<tr><td class="descriptionbox width50 wrap">'.WT_I18N::translate('Apply privacy settings?').help_link('apply_privacy').'</td>'. - '<td class="list_value">'. - ' <input type="radio" name="privatize_export" value="user" checked="checked"> '.WT_I18N::translate('Member').'<br>'. - ' <input type="radio" name="privatize_export" value="visitor"> '.WT_I18N::translate('Visitor'). + $out .= + '<tr><td class="descriptionbox width50 wrap">' . WT_I18N::translate('Apply privacy settings?') . help_link('apply_privacy') . '</td>' . + '<td class="list_value">' . + ' <input type="radio" name="privatize_export" value="user" checked="checked"> ' . WT_I18N::translate('Member') . '<br>' . + ' <input type="radio" name="privatize_export" value="visitor"> ' . WT_I18N::translate('Visitor') . '</td></tr>'; } - $out .=' - <tr><td class="descriptionbox width50 wrap">'.WT_I18N::translate('Convert from UTF-8 to ANSI (ISO-8859-1)').help_link('utf8_ansi').'</td> + $out .= ' + <tr><td class="descriptionbox width50 wrap">'.WT_I18N::translate('Convert from UTF-8 to ANSI (ISO-8859-1)') . help_link('utf8_ansi') . '</td> <td class="optionbox"><input type="checkbox" name="convert" value="yes"></td></tr> <tr> - <td class="descriptionbox width50 wrap">'.WT_I18N::translate('Add the GEDCOM media path to filenames').help_link('GEDCOM_MEDIA_PATH').'</td> + <td class="descriptionbox width50 wrap">'.WT_I18N::translate('Add the GEDCOM media path to filenames') . help_link('GEDCOM_MEDIA_PATH') . '</td> <td class="optionbox"> <input type="checkbox" name="conv_path" value="' . WT_Filter::escapeHtml($GEDCOM_MEDIA_PATH) . '"> <span dir="auto">' . WT_Filter::escapeHtml($GEDCOM_MEDIA_PATH) . '</span></td> </tr> - <input type="hidden" name="conv_path" value="'.$clip_ctrl->conv_path.'"> + <input type="hidden" name="conv_path" value="'.$clip_ctrl->conv_path . '"> </td></tr> <tr><td class="topbottombar" colspan="2"> - <input type="button" value="'.WT_I18N::translate('Cancel').'" onclick="cancelDownload();"> - <input type="submit" value="'.WT_I18N::translate('Download').'"> + <input type="button" value="'.WT_I18N::translate('Cancel') . '" onclick="cancelDownload();"> + <input type="submit" value="'.WT_I18N::translate('Download') . '"> </form>'; return $out; diff --git a/modules_v3/families/module.php b/modules_v3/families/module.php index d6ec9a8cbc..af3c4b479d 100644 --- a/modules_v3/families/module.php +++ b/modules_v3/families/module.php @@ -70,7 +70,7 @@ class families_WT_Module extends WT_Module implements WT_Module_Sidebar { if ($search) { return $this->search($search); - } elseif ($alpha=='@' || $alpha==',' || $surname) { + } elseif ($alpha == '@' || $alpha == ',' || $surname) { return $this->getSurnameFams($alpha, $surname); } elseif ($alpha) { return $this->getAlphaSurnames($alpha, $surname); @@ -111,7 +111,7 @@ class families_WT_Module extends WT_Module implements WT_Module_Sidebar { if (!famloadedNames[surname]) { jQuery.ajax({ - url: "module.php?mod='.$this->getName().'&mod_action=ajax&sb_action=families&alpha="+alpha+"&surname="+surname, + url: "module.php?mod='.$this->getName() . '&mod_action=ajax&sb_action=families&alpha="+alpha+"&surname="+surname, cache: false, success: function(html) { jQuery("#sb_fam_"+surname+" div").html(html); @@ -134,27 +134,27 @@ class families_WT_Module extends WT_Module implements WT_Module_Sidebar { return false; }); '); - $out= - '<form method="post" action="module.php?mod='.$this->getName().'&mod_action=ajax" onsubmit="return false;">'. - '<input type="search" name="sb_fam_name" id="sb_fam_name" placeholder="'.WT_I18N::translate('Search').'">'. + $out = + '<form method="post" action="module.php?mod=' . $this->getName() . '&mod_action=ajax" onsubmit="return false;">' . + '<input type="search" name="sb_fam_name" id="sb_fam_name" placeholder="' . WT_I18N::translate('Search') . '">' . '<p>'; foreach ($initials as $letter=>$count) { switch ($letter) { case '@': - $html=$UNKNOWN_NN; + $html = $UNKNOWN_NN; break; case ',': - $html=WT_I18N::translate('None'); + $html = WT_I18N::translate('None'); break; case ' ': - $html=' '; + $html = ' '; break; default: - $html=$letter; + $html = $letter; break; } - $html='<a href="module.php?mod='.$this->getName().'&mod_action=ajax&sb_action=families&alpha='.urlencode($letter).'" class="sb_fam_letter">'.$html.'</a>'; - $out .= $html." "; + $html = '<a href="module.php?mod=' . $this->getName() . '&mod_action=ajax&sb_action=families&alpha=' . urlencode($letter) . '" class="sb_fam_letter">' . $html . '</a>'; + $out .= $html . " "; } $out .= '</p>'; @@ -169,12 +169,12 @@ class families_WT_Module extends WT_Module implements WT_Module_Sidebar { * * @return string */ - public function getAlphaSurnames($alpha, $surname1='') { + public function getAlphaSurnames($alpha, $surname1 = '') { $surnames = WT_Query_Name::surnames('', $alpha, true, true, WT_GED_ID); $out = '<ul>'; foreach (array_keys($surnames) as $surname) { $out .= '<li id="sb_fam_' . $surname . '" class="sb_fam_surname_li"><a href="' . $surname . '" title="' . $surname . '" alt="' . $alpha . '" class="sb_fam_surname">' . $surname . '</a>'; - if (!empty($surname1) && $surname1==$surname) { + if (!empty($surname1) && $surname1 == $surname) { $out .= '<div class="name_tree_div_visible">'; $out .= $this->getSurnameFams($alpha, $surname1); $out .= '</div>'; @@ -194,15 +194,15 @@ class families_WT_Module extends WT_Module implements WT_Module_Sidebar { * @return string */ public function getSurnameFams($alpha, $surname) { - $families=WT_Query_Name::families($surname, $alpha, '', true, WT_GED_ID); + $families = WT_Query_Name::families($surname, $alpha, '', true, WT_GED_ID); $out = '<ul>'; foreach ($families as $family) { if ($family->canShowName()) { - $out .= '<li><a href="'.$family->getHtmlUrl().'">'.$family->getFullName().' '; + $out .= '<li><a href="' . $family->getHtmlUrl() . '">' . $family->getFullName() . ' '; if ($family->canShow()) { - $marriage_year=$family->getMarriageYear(); + $marriage_year = $family->getMarriageYear(); if ($marriage_year) { - $out.=' ('.$marriage_year.')'; + $out .= ' (' . $marriage_year . ')'; } } $out .= '</a></li>'; @@ -218,16 +218,16 @@ class families_WT_Module extends WT_Module implements WT_Module_Sidebar { * @return string */ public function search($query) { - if (strlen($query)<2) { + if (strlen($query) < 2) { return ''; } //-- search for INDI names - $rows=WT_DB::prepare( - "SELECT i_id AS xref". - " FROM `##individuals`, `##name`". - " WHERE (i_id LIKE ? OR n_sort LIKE ?)". - " AND i_id=n_id AND i_file=n_file AND i_file=?". + $rows = WT_DB::prepare( + "SELECT i_id AS xref" . + " FROM `##individuals`, `##name`" . + " WHERE (i_id LIKE ? OR n_sort LIKE ?)" . + " AND i_id=n_id AND i_file=n_file AND i_file=?" . " ORDER BY n_sort" ) ->execute(array("%{$query}%", "%{$query}%", WT_GED_ID)) @@ -237,32 +237,32 @@ class families_WT_Module extends WT_Module implements WT_Module_Sidebar { $ids[] = $row->xref; } - $vars=array(); + $vars = array(); if (empty($ids)) { //-- no match : search for FAM id $where = "f_id LIKE ?"; - $vars[]="%{$query}%"; + $vars[] = "%{$query}%"; } else { //-- search for spouses - $qs=implode(',', array_fill(0, count($ids), '?')); + $qs = implode(',', array_fill(0, count($ids), '?')); $where = "(f_husb IN ($qs) OR f_wife IN ($qs))"; - $vars=array_merge($vars, $ids, $ids); + $vars = array_merge($vars, $ids, $ids); } - $vars[]=WT_GED_ID; - $rows=WT_DB::prepare("SELECT f_id AS xref, f_file AS gedcom_id, f_gedcom AS gedcom FROM `##families` WHERE {$where} AND f_file=?") + $vars[] = WT_GED_ID; + $rows = WT_DB::prepare("SELECT f_id AS xref, f_file AS gedcom_id, f_gedcom AS gedcom FROM `##families` WHERE {$where} AND f_file=?") ->execute($vars) ->fetchAll(); $out = '<ul>'; foreach ($rows as $row) { - $family=WT_Family::getInstance($row->xref, $row->gedcom_id, $row->gedcom); + $family = WT_Family::getInstance($row->xref, $row->gedcom_id, $row->gedcom); if ($family->canShowName()) { - $out .= '<li><a href="'.$family->getHtmlUrl().'">'.$family->getFullName().' '; + $out .= '<li><a href="' . $family->getHtmlUrl() . '">' . $family->getFullName() . ' '; if ($family->canShow()) { - $marriage_year=$family->getMarriageYear(); + $marriage_year = $family->getMarriageYear(); if ($marriage_year) { - $out.=' ('.$marriage_year.')'; + $out .= ' (' . $marriage_year . ')'; } } $out .= '</a></li>'; diff --git a/modules_v3/faq/help_text.php b/modules_v3/faq/help_text.php index b779c4618a..217e695b35 100644 --- a/modules_v3/faq/help_text.php +++ b/modules_v3/faq/help_text.php @@ -21,48 +21,48 @@ // along with this program; if not, write to the Free Software // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA -if (!defined('WT_WEBTREES') || !defined('WT_SCRIPT_NAME') || WT_SCRIPT_NAME!='help_text.php') { +if (!defined('WT_WEBTREES') || !defined('WT_SCRIPT_NAME') || WT_SCRIPT_NAME != 'help_text.php') { header('HTTP/1.0 403 Forbidden'); exit; } switch ($help) { case 'add_faq_item': - $title=WT_I18N::translate('Frequently asked questions'); - $text= - WT_I18N::translate('FAQs are lists of questions and answers, which allow you to explain the site’s rules, policies, and procedures to your visitors. Questions are typically concerned with privacy, copyright, user-accounts, unsuitable content, requirement for source-citations, etc.'). - '<br><br>'. + $title = WT_I18N::translate('Frequently asked questions'); + $text = + WT_I18N::translate('FAQs are lists of questions and answers, which allow you to explain the site’s rules, policies, and procedures to your visitors. Questions are typically concerned with privacy, copyright, user-accounts, unsuitable content, requirement for source-citations, etc.') . + '<br><br>' . WT_I18N::translate('You may use HTML to format the answer and to add links to other websites.'); break; case 'add_faq_order': - $title=WT_I18N::translate('FAQ position'); - $text=WT_I18N::translate('This field controls the order in which the FAQ items are displayed.<br><br>You do not have to enter the numbers sequentially. If you leave holes in the numbering scheme, you can insert other items later. For example, if you use the numbers 1, 6, 11, 16, you can later insert items with the missing sequence numbers. Negative numbers and zero are allowed, and can be used to insert items in front of the first one.<br><br>When more than one FAQ item has the same position number, only one of these items will be visible.'); + $title = WT_I18N::translate('FAQ position'); + $text = WT_I18N::translate('This field controls the order in which the FAQ items are displayed.<br><br>You do not have to enter the numbers sequentially. If you leave holes in the numbering scheme, you can insert other items later. For example, if you use the numbers 1, 6, 11, 16, you can later insert items with the missing sequence numbers. Negative numbers and zero are allowed, and can be used to insert items in front of the first one.<br><br>When more than one FAQ item has the same position number, only one of these items will be visible.'); break; case 'add_faq_visibility': - $title=WT_I18N::translate('FAQ visibility'); - $text=WT_I18N::translate('A FAQ item can be displayed on just one of the family trees, or on all the family trees.'); + $title = WT_I18N::translate('FAQ visibility'); + $text = WT_I18N::translate('A FAQ item can be displayed on just one of the family trees, or on all the family trees.'); break; case 'delete_faq_item': - $title=WT_I18N::translate('Delete FAQ item'); - $text=WT_I18N::translate('This option will let you delete an item from the FAQ page'); + $title = WT_I18N::translate('Delete FAQ item'); + $text = WT_I18N::translate('This option will let you delete an item from the FAQ page'); break; case 'edit_faq_item': - $title=WT_I18N::translate('Edit FAQ item'); - $text=WT_I18N::translate('This option will let you edit an item on the FAQ page.'); + $title = WT_I18N::translate('Edit FAQ item'); + $text = WT_I18N::translate('This option will let you edit an item on the FAQ page.'); break; case 'movedown_faq_item': - $title=WT_I18N::translate('Move FAQ item down'); - $text=WT_I18N::translate('This option will let you move an item downwards on the FAQ page.<br><br>Each time you use this option, the FAQ position number of this item is increased by one. You can achieve the same effect by editing the item in question and changing the FAQ position field. When more than one FAQ item has the same position number, only one of these items will be visible.'); + $title = WT_I18N::translate('Move FAQ item down'); + $text = WT_I18N::translate('This option will let you move an item downwards on the FAQ page.<br><br>Each time you use this option, the FAQ position number of this item is increased by one. You can achieve the same effect by editing the item in question and changing the FAQ position field. When more than one FAQ item has the same position number, only one of these items will be visible.'); break; case 'moveup_faq_item': - $title=WT_I18N::translate('Move FAQ item up'); - $text=WT_I18N::translate('This option will let you move an item upwards on the FAQ page.<br><br>Each time you use this option, the FAQ position number of this item is reduced by one. You can achieve the same effect by editing the item in question and changing the FAQ position field. When more than one FAQ item has the same position number, only one of these items will be visible.'); + $title = WT_I18N::translate('Move FAQ item up'); + $text = WT_I18N::translate('This option will let you move an item upwards on the FAQ page.<br><br>Each time you use this option, the FAQ position number of this item is reduced by one. You can achieve the same effect by editing the item in question and changing the FAQ position field. When more than one FAQ item has the same position number, only one of these items will be visible.'); break; } diff --git a/modules_v3/gedcom_favorites/module.php b/modules_v3/gedcom_favorites/module.php index 04d418ed0b..d26879cd7b 100644 --- a/modules_v3/gedcom_favorites/module.php +++ b/modules_v3/gedcom_favorites/module.php @@ -41,7 +41,7 @@ class gedcom_favorites_WT_Module extends WT_Module implements WT_Module_Block { } /** {@inheritdoc} */ - public function getBlock($block_id, $template=true, $cfg=null) { + public function getBlock($block_id, $template = true, $cfg = null) { global $ctype, $show_full, $PEDIGREE_FULL_DETAILS, $controller; self::updateSchema(); // make sure the favorites table has been created @@ -109,9 +109,9 @@ class gedcom_favorites_WT_Module extends WT_Module implements WT_Module_Block { $userfavs = array(); } - $id=$this->getName().$block_id; - $class=$this->getName().'_block'; - $title=$this->getTitle(); + $id = $this->getName() . $block_id; + $class = $this->getName() . '_block'; + $title = $this->getTitle(); if (Auth::check()) { $controller @@ -123,22 +123,22 @@ class gedcom_favorites_WT_Module extends WT_Module implements WT_Module_Block { if ($userfavs) { foreach ($userfavs as $key=>$favorite) { if (isset($favorite['id'])) { - $key=$favorite['id']; + $key = $favorite['id']; } - $removeFavourite = '<a class="font9" href="index.php?ctype='.$ctype.'&action=deletefav&favorite_id='.$key.'" onclick="return confirm(\''.WT_I18N::translate('Are you sure you want to remove this item from your list of favorites?').'\');">'.WT_I18N::translate('Remove').'</a> '; - if ($favorite['type']=='URL') { - $content .= '<div id="boxurl'.$key.'.0" class="person_box">'; - if ($ctype=='user' || WT_USER_GEDCOM_ADMIN) { + $removeFavourite = '<a class="font9" href="index.php?ctype=' . $ctype . '&action=deletefav&favorite_id=' . $key . '" onclick="return confirm(\'' . WT_I18N::translate('Are you sure you want to remove this item from your list of favorites?') . '\');">' . WT_I18N::translate('Remove') . '</a> '; + if ($favorite['type'] == 'URL') { + $content .= '<div id="boxurl' . $key . '.0" class="person_box">'; + if ($ctype == 'user' || WT_USER_GEDCOM_ADMIN) { $content .= $removeFavourite; } - $content .= '<a href="'.$favorite['url'].'"><b>'.$favorite['title'].'</b></a>'; - $content .= '<br>'.$favorite['note']; + $content .= '<a href="' . $favorite['url'] . '"><b>' . $favorite['title'] . '</b></a>'; + $content .= '<br>' . $favorite['note']; $content .= '</div>'; } else { - $record=WT_GedcomRecord::getInstance($favorite['gid']); + $record = WT_GedcomRecord::getInstance($favorite['gid']); if ($record && $record->canShow()) { if ($record instanceof WT_Individual) { - $content .= '<div id="box'.$favorite["gid"].'.0" class="person_box action_header'; + $content .= '<div id="box' . $favorite["gid"] . '.0" class="person_box action_header'; switch ($record->getsex()) { case 'M': break; @@ -150,54 +150,54 @@ class gedcom_favorites_WT_Module extends WT_Module implements WT_Module_Block { break; } $content .= '">'; - if ($ctype=="user" || WT_USER_GEDCOM_ADMIN) { + if ($ctype == "user" || WT_USER_GEDCOM_ADMIN) { $content .= $removeFavourite; } $content .= Theme::theme()->individualBoxLarge($record); $content .= $favorite['note']; $content .= '</div>'; } else { - $content .= '<div id="box'.$favorite['gid'].'.0" class="person_box">'; - if ($ctype=='user' || WT_USER_GEDCOM_ADMIN) { + $content .= '<div id="box' . $favorite['gid'] . '.0" class="person_box">'; + if ($ctype == 'user' || WT_USER_GEDCOM_ADMIN) { $content .= $removeFavourite; } $content .= $record->format_list('span'); - $content .= '<br>'.$favorite['note']; + $content .= '<br>' . $favorite['note']; $content .= '</div>'; } } } } } - if ($ctype=='user' || WT_USER_GEDCOM_ADMIN) { + if ($ctype == 'user' || WT_USER_GEDCOM_ADMIN) { $uniqueID = Uuid::uuid4(); // This block can theoretically appear multiple times, so use a unique ID. $content .= '<div class="add_fav_head">'; - $content .= '<a href="#" onclick="return expand_layer(\'add_fav'.$uniqueID.'\');">'.WT_I18N::translate('Add a new favorite').'<i id="add_fav'.$uniqueID.'_img" class="icon-plus"></i></a>'; + $content .= '<a href="#" onclick="return expand_layer(\'add_fav' . $uniqueID . '\');">' . WT_I18N::translate('Add a new favorite') . '<i id="add_fav' . $uniqueID . '_img" class="icon-plus"></i></a>'; $content .= '</div>'; - $content .= '<div id="add_fav'.$uniqueID.'" style="display: none;">'; + $content .= '<div id="add_fav' . $uniqueID . '" style="display: none;">'; $content .= '<form name="addfavform" method="get" action="index.php">'; $content .= '<input type="hidden" name="action" value="addfav">'; - $content .= '<input type="hidden" name="ctype" value="'.$ctype.'">'; - $content .= '<input type="hidden" name="ged" value="'.WT_GEDCOM.'">'; + $content .= '<input type="hidden" name="ctype" value="' . $ctype . '">'; + $content .= '<input type="hidden" name="ged" value="' . WT_GEDCOM . '">'; $content .= '<div class="add_fav_ref">'; - $content .= '<input type="radio" name="fav_category" value="record" checked="checked" onclick="jQuery(\'#gid'.$uniqueID.'\').removeAttr(\'disabled\'); jQuery(\'#url, #favtitle\').attr(\'disabled\',\'disabled\').val(\'\');">'; - $content .= '<label for="gid'.$uniqueID.'">'.WT_I18N::translate('Enter an individual, family, or source ID').'</label>'; - $content .= '<input class="pedigree_form" data-autocomplete-type="IFSRO" type="text" name="gid" id="gid'.$uniqueID.'" size="5" value="">'; - $content .= ' '.print_findindi_link('gid'.$uniqueID); - $content .= ' '.print_findfamily_link('gid'.$uniqueID); - $content .= ' '.print_findsource_link('gid'.$uniqueID); - $content .= ' '.print_findrepository_link('gid'.$uniqueID); - $content .= ' '.print_findnote_link('gid'.$uniqueID); - $content .= ' '.print_findmedia_link('gid'.$uniqueID); + $content .= '<input type="radio" name="fav_category" value="record" checked="checked" onclick="jQuery(\'#gid' . $uniqueID . '\').removeAttr(\'disabled\'); jQuery(\'#url, #favtitle\').attr(\'disabled\',\'disabled\').val(\'\');">'; + $content .= '<label for="gid' . $uniqueID . '">' . WT_I18N::translate('Enter an individual, family, or source ID') . '</label>'; + $content .= '<input class="pedigree_form" data-autocomplete-type="IFSRO" type="text" name="gid" id="gid' . $uniqueID . '" size="5" value="">'; + $content .= ' ' . print_findindi_link('gid' . $uniqueID); + $content .= ' ' . print_findfamily_link('gid' . $uniqueID); + $content .= ' ' . print_findsource_link('gid' . $uniqueID); + $content .= ' ' . print_findrepository_link('gid' . $uniqueID); + $content .= ' ' . print_findnote_link('gid' . $uniqueID); + $content .= ' ' . print_findmedia_link('gid' . $uniqueID); $content .= '</div>'; $content .= '<div class="add_fav_url">'; - $content .= '<input type="radio" name="fav_category" value="url" onclick="jQuery(\'#url, #favtitle\').removeAttr(\'disabled\'); jQuery(\'#gid'.$uniqueID.'\').attr(\'disabled\',\'disabled\').val(\'\');">'; - $content .= '<input type="text" name="url" id="url" size="20" value="" placeholder="'.WT_Gedcom_Tag::getLabel('URL').'" disabled="disabled"> '; - $content .= '<input type="text" name="favtitle" id="favtitle" size="20" value="" placeholder="'.WT_I18N::translate('Title').'" disabled="disabled">'; - $content .= '<p>'.WT_I18N::translate('Enter an optional note about this favorite').'</p>'; + $content .= '<input type="radio" name="fav_category" value="url" onclick="jQuery(\'#url, #favtitle\').removeAttr(\'disabled\'); jQuery(\'#gid' . $uniqueID . '\').attr(\'disabled\',\'disabled\').val(\'\');">'; + $content .= '<input type="text" name="url" id="url" size="20" value="" placeholder="' . WT_Gedcom_Tag::getLabel('URL') . '" disabled="disabled"> '; + $content .= '<input type="text" name="favtitle" id="favtitle" size="20" value="" placeholder="' . WT_I18N::translate('Title') . '" disabled="disabled">'; + $content .= '<p>' . WT_I18N::translate('Enter an optional note about this favorite') . '</p>'; $content .= '<textarea name="favnote" rows="6" cols="50"></textarea>'; $content .= '</div>'; - $content .= '<input type="submit" value="'.WT_I18N::translate('Add').'">'; + $content .= '<input type="submit" value="' . WT_I18N::translate('Add') . '">'; $content .= '</form></div>'; } @@ -236,13 +236,13 @@ class gedcom_favorites_WT_Module extends WT_Module implements WT_Module_Block { /** {@inheritdoc} */ public function configureBlock($block_id) { if (WT_Filter::postBool('save') && WT_Filter::checkCsrf()) { - set_block_setting($block_id, 'block', WT_Filter::postBool('block')); + set_block_setting($block_id, 'block', WT_Filter::postBool('block')); exit; } - require_once WT_ROOT.'includes/functions/functions_edit.php'; + require_once WT_ROOT . 'includes/functions/functions_edit.php'; - $block=get_block_setting($block_id, 'block', false); + $block = get_block_setting($block_id, 'block', false); echo '<tr><td class="descriptionbox wrap width33">'; echo /* I18N: label for a yes/no option */ WT_I18N::translate('Add a scrollbar when block contents grow'); echo '</td><td class="optionbox">'; @@ -279,19 +279,19 @@ class gedcom_favorites_WT_Module extends WT_Module implements WT_Module_Block { //-- make sure this is not a duplicate entry $sql = "SELECT SQL_NO_CACHE 1 FROM `##favorite` WHERE"; if (!empty($favorite['gid'])) { - $sql.=" xref=?"; - $vars=array($favorite['gid']); + $sql .= " xref=?"; + $vars = array($favorite['gid']); } else { - $sql.=" url=?"; - $vars=array($favorite['url']); + $sql .= " url=?"; + $vars = array($favorite['url']); } - $sql.=" AND gedcom_id=?"; - $vars[]=$favorite['gedcom_id']; + $sql .= " AND gedcom_id=?"; + $vars[] = $favorite['gedcom_id']; if ($favorite['user_id']) { - $sql.=" AND user_id=?"; - $vars[]=$favorite['user_id']; + $sql .= " AND user_id=?"; + $vars[] = $favorite['user_id']; } else { - $sql.=" AND user_id IS NULL"; + $sql .= " AND user_id IS NULL"; } if (WT_DB::prepare($sql)->execute($vars)->fetchOne()) { @@ -316,7 +316,7 @@ class gedcom_favorites_WT_Module extends WT_Module implements WT_Module_Block { return WT_DB::prepare( - "SELECT SQL_CACHE favorite_id AS id, user_id, gedcom_id, xref AS gid, favorite_type AS type, title, note, url". + "SELECT SQL_CACHE favorite_id AS id, user_id, gedcom_id, xref AS gid, favorite_type AS type, title, note, url" . " FROM `##favorite` WHERE gedcom_id=? AND user_id IS NULL") ->execute(array($gedcom_id)) ->fetchAll(PDO::FETCH_ASSOC); @@ -328,7 +328,7 @@ class gedcom_favorites_WT_Module extends WT_Module implements WT_Module_Block { protected static function updateSchema() { // Create tables, if not already present try { - WT_DB::updateSchema(WT_ROOT.WT_MODULES_DIR.'gedcom_favorites/db_schema/', 'FV_SCHEMA_VERSION', 4); + WT_DB::updateSchema(WT_ROOT . WT_MODULES_DIR . 'gedcom_favorites/db_schema/', 'FV_SCHEMA_VERSION', 4); } catch (PDOException $ex) { // The schema update scripts should never fail. If they do, there is no clean recovery. die($ex); diff --git a/modules_v3/gedcom_stats/module.php b/modules_v3/gedcom_stats/module.php index ff248c2731..a615fb56fa 100644 --- a/modules_v3/gedcom_stats/module.php +++ b/modules_v3/gedcom_stats/module.php @@ -37,82 +37,82 @@ class gedcom_stats_WT_Module extends WT_Module implements WT_Module_Block { } /** {@inheritdoc} */ - public function getBlock($block_id, $template=true, $cfg=null) { + public function getBlock($block_id, $template = true, $cfg = null) { global $WT_TREE, $ctype; - $show_last_update =get_block_setting($block_id, 'show_last_update', true); - $show_common_surnames=get_block_setting($block_id, 'show_common_surnames', true); - $stat_indi =get_block_setting($block_id, 'stat_indi', true); - $stat_fam =get_block_setting($block_id, 'stat_fam', true); - $stat_sour =get_block_setting($block_id, 'stat_sour', true); - $stat_media =get_block_setting($block_id, 'stat_media', true); - $stat_repo =get_block_setting($block_id, 'stat_repo', true); - $stat_surname =get_block_setting($block_id, 'stat_surname', true); - $stat_events =get_block_setting($block_id, 'stat_events', true); - $stat_users =get_block_setting($block_id, 'stat_users', true); - $stat_first_birth =get_block_setting($block_id, 'stat_first_birth', true); - $stat_last_birth =get_block_setting($block_id, 'stat_last_birth', true); - $stat_first_death =get_block_setting($block_id, 'stat_first_death', true); - $stat_last_death =get_block_setting($block_id, 'stat_last_death', true); - $stat_long_life =get_block_setting($block_id, 'stat_long_life', true); - $stat_avg_life =get_block_setting($block_id, 'stat_avg_life', true); - $stat_most_chil =get_block_setting($block_id, 'stat_most_chil', true); - $stat_avg_chil =get_block_setting($block_id, 'stat_avg_chil', true); - $stat_link =get_block_setting($block_id, 'stat_link', true); - $block =get_block_setting($block_id, 'block', false); + $show_last_update = get_block_setting($block_id, 'show_last_update', true); + $show_common_surnames = get_block_setting($block_id, 'show_common_surnames', true); + $stat_indi = get_block_setting($block_id, 'stat_indi', true); + $stat_fam = get_block_setting($block_id, 'stat_fam', true); + $stat_sour = get_block_setting($block_id, 'stat_sour', true); + $stat_media = get_block_setting($block_id, 'stat_media', true); + $stat_repo = get_block_setting($block_id, 'stat_repo', true); + $stat_surname = get_block_setting($block_id, 'stat_surname', true); + $stat_events = get_block_setting($block_id, 'stat_events', true); + $stat_users = get_block_setting($block_id, 'stat_users', true); + $stat_first_birth = get_block_setting($block_id, 'stat_first_birth', true); + $stat_last_birth = get_block_setting($block_id, 'stat_last_birth', true); + $stat_first_death = get_block_setting($block_id, 'stat_first_death', true); + $stat_last_death = get_block_setting($block_id, 'stat_last_death', true); + $stat_long_life = get_block_setting($block_id, 'stat_long_life', true); + $stat_avg_life = get_block_setting($block_id, 'stat_avg_life', true); + $stat_most_chil = get_block_setting($block_id, 'stat_most_chil', true); + $stat_avg_chil = get_block_setting($block_id, 'stat_avg_chil', true); + $stat_link = get_block_setting($block_id, 'stat_link', true); + $block = get_block_setting($block_id, 'block', false); if ($cfg) { foreach (array('show_common_surnames', 'stat_indi', 'stat_fam', 'stat_sour', 'stat_media', 'stat_surname', 'stat_events', 'stat_users', 'stat_first_birth', 'stat_last_birth', 'stat_first_death', 'stat_last_death', 'stat_long_life', 'stat_avg_life', 'stat_most_chil', 'stat_avg_chil', 'stat_link', 'block') as $name) { if (array_key_exists($name, $cfg)) { - $$name=$cfg[$name]; + $$name = $cfg[$name]; } } } - $id=$this->getName().$block_id; - $class=$this->getName().'_block'; + $id = $this->getName() . $block_id; + $class = $this->getName() . '_block'; if ($ctype === 'gedcom' && WT_USER_GEDCOM_ADMIN || $ctype === 'user' && Auth::check()) { - $title='<i class="icon-admin" title="'.WT_I18N::translate('Configure').'" onclick="modalDialog(\'block_edit.php?block_id='.$block_id.'\', \''.$this->getTitle().'\');"></i>'; + $title = '<i class="icon-admin" title="' . WT_I18N::translate('Configure') . '" onclick="modalDialog(\'block_edit.php?block_id=' . $block_id . '\', \'' . $this->getTitle() . '\');"></i>'; } else { - $title=''; + $title = ''; } - $title.=$this->getTitle(); + $title .= $this->getTitle(); - $stats=new WT_Stats(WT_GEDCOM); + $stats = new WT_Stats(WT_GEDCOM); - $content = '<b>'.WT_TREE_TITLE.'</b><br>'; + $content = '<b>' . WT_TREE_TITLE . '</b><br>'; if ($show_last_update) { - $content .= '<div>'./* I18N: %s is a date */ WT_I18N::translate('This family tree was last updated on %s.', strip_tags($stats->gedcomUpdated())).'</div>'; + $content .= '<div>' . /* I18N: %s is a date */ WT_I18N::translate('This family tree was last updated on %s.', strip_tags($stats->gedcomUpdated())) . '</div>'; } $content .= '<table><tr><td class="width20"><table class="facts_table">'; if ($stat_indi) { - $content.='<tr><td class="facts_label">'.WT_I18N::translate('Individuals').'</td><td class="facts_value stats_value"><a href="'."indilist.php?surname_sublist=no&ged=".WT_GEDURL.'">'.$stats->totalIndividuals().'</a></td></tr>'; - $content.='<tr><td class="facts_label">'.WT_I18N::translate('Males').'</td><td class="facts_value stats_value">'.$stats->totalSexMales().'<br>'.$stats->totalSexMalesPercentage().'</td></tr>'; - $content.='<tr><td class="facts_label">'.WT_I18N::translate('Females').'</td><td class="facts_value stats_value">'.$stats->totalSexFemales().'<br>'.$stats->totalSexFemalesPercentage().'</td></tr>'; + $content .= '<tr><td class="facts_label">' . WT_I18N::translate('Individuals') . '</td><td class="facts_value stats_value"><a href="' . "indilist.php?surname_sublist=no&ged=" . WT_GEDURL . '">' . $stats->totalIndividuals() . '</a></td></tr>'; + $content .= '<tr><td class="facts_label">' . WT_I18N::translate('Males') . '</td><td class="facts_value stats_value">' . $stats->totalSexMales() . '<br>' . $stats->totalSexMalesPercentage() . '</td></tr>'; + $content .= '<tr><td class="facts_label">' . WT_I18N::translate('Females') . '</td><td class="facts_value stats_value">' . $stats->totalSexFemales() . '<br>' . $stats->totalSexFemalesPercentage() . '</td></tr>'; } if ($stat_surname) { - $content .= '<tr><td class="facts_label">'.WT_I18N::translate('Total surnames').'</td><td class="facts_value stats_value"><a href="indilist.php?show_all=yes&surname_sublist=yes&ged='.WT_GEDURL.'">'.$stats->totalSurnames().'</a></td></tr>'; + $content .= '<tr><td class="facts_label">' . WT_I18N::translate('Total surnames') . '</td><td class="facts_value stats_value"><a href="indilist.php?show_all=yes&surname_sublist=yes&ged=' . WT_GEDURL . '">' . $stats->totalSurnames() . '</a></td></tr>'; } if ($stat_fam) { - $content .= '<tr><td class="facts_label">'.WT_I18N::translate('Families').'</td><td class="facts_value stats_value"><a href="famlist.php?ged='.WT_GEDURL.'">'.$stats->totalFamilies().'</a></td></tr>'; + $content .= '<tr><td class="facts_label">' . WT_I18N::translate('Families') . '</td><td class="facts_value stats_value"><a href="famlist.php?ged=' . WT_GEDURL . '">' . $stats->totalFamilies() . '</a></td></tr>'; } if ($stat_sour) { - $content .= '<tr><td class="facts_label">'.WT_I18N::translate('Sources').'</td><td class="facts_value stats_value"><a href="sourcelist.php?ged='.WT_GEDURL.'">'.$stats->totalSources().'</a></td></tr>'; + $content .= '<tr><td class="facts_label">' . WT_I18N::translate('Sources') . '</td><td class="facts_value stats_value"><a href="sourcelist.php?ged=' . WT_GEDURL . '">' . $stats->totalSources() . '</a></td></tr>'; } if ($stat_media) { - $content .= '<tr><td class="facts_label">'.WT_I18N::translate('Media objects').'</td><td class="facts_value stats_value"><a href="medialist.php?ged='.WT_GEDURL.'">'.$stats->totalMedia().'</a></td></tr>'; + $content .= '<tr><td class="facts_label">' . WT_I18N::translate('Media objects') . '</td><td class="facts_value stats_value"><a href="medialist.php?ged=' . WT_GEDURL . '">' . $stats->totalMedia() . '</a></td></tr>'; } if ($stat_repo) { - $content .= '<tr><td class="facts_label">'.WT_I18N::translate('Repositories').'</td><td class="facts_value stats_value"><a href="repolist.php?ged='.WT_GEDURL.'">'.$stats->totalRepositories().'</a></td></tr>'; + $content .= '<tr><td class="facts_label">' . WT_I18N::translate('Repositories') . '</td><td class="facts_value stats_value"><a href="repolist.php?ged=' . WT_GEDURL . '">' . $stats->totalRepositories() . '</a></td></tr>'; } if ($stat_events) { - $content .= '<tr><td class="facts_label">'.WT_I18N::translate('Total events').'</td><td class="facts_value stats_value">'.$stats->totalEvents().'</td></tr>'; + $content .= '<tr><td class="facts_label">' . WT_I18N::translate('Total events') . '</td><td class="facts_value stats_value">' . $stats->totalEvents() . '</td></tr>'; } if ($stat_users) { - $content .= '<tr><td class="facts_label">'.WT_I18N::translate('Total users').'</td><td class="facts_value stats_value">'; + $content .= '<tr><td class="facts_label">' . WT_I18N::translate('Total users') . '</td><td class="facts_value stats_value">'; if (WT_USER_GEDCOM_ADMIN) { - $content .= '<a href="admin_users.php">'.$stats->totalUsers().'</a>'; + $content .= '<a href="admin_users.php">' . $stats->totalUsers() . '</a>'; } else { $content .= $stats->totalUsers(); } @@ -122,59 +122,59 @@ class gedcom_stats_WT_Module extends WT_Module implements WT_Module_Block { $content .= '</table></td><td><table class="facts_table">'; } if ($stat_first_birth) { - $content .= '<tr><td class="facts_label">'.WT_I18N::translate('Earliest birth year').'</td><td class="facts_value stats_value">'.$stats->firstBirthYear().'</td>'; + $content .= '<tr><td class="facts_label">' . WT_I18N::translate('Earliest birth year') . '</td><td class="facts_value stats_value">' . $stats->firstBirthYear() . '</td>'; if (!$block) { - $content .= '<td class="facts_value">'.$stats->firstBirth().'</td>'; + $content .= '<td class="facts_value">' . $stats->firstBirth() . '</td>'; } $content .= '</tr>'; } if ($stat_last_birth) { - $content .= '<tr><td class="facts_label">'.WT_I18N::translate('Latest birth year').'</td><td class="facts_value stats_value">'.$stats->lastBirthYear().'</td>'; + $content .= '<tr><td class="facts_label">' . WT_I18N::translate('Latest birth year') . '</td><td class="facts_value stats_value">' . $stats->lastBirthYear() . '</td>'; if (!$block) { - $content .= '<td class="facts_value">'.$stats->lastBirth().'</td>'; + $content .= '<td class="facts_value">' . $stats->lastBirth() . '</td>'; } $content .= '</tr>'; } if ($stat_first_death) { - $content .= '<tr><td class="facts_label">'.WT_I18N::translate('Earliest death year').'</td><td class="facts_value stats_value">'.$stats->firstDeathYear().'</td>'; + $content .= '<tr><td class="facts_label">' . WT_I18N::translate('Earliest death year') . '</td><td class="facts_value stats_value">' . $stats->firstDeathYear() . '</td>'; if (!$block) { - $content .= '<td class="facts_value">'.$stats->firstDeath().'</td>'; + $content .= '<td class="facts_value">' . $stats->firstDeath() . '</td>'; } $content .= '</tr>'; } if ($stat_last_death) { - $content .= '<tr><td class="facts_label">'.WT_I18N::translate('Latest death year').'</td><td class="facts_value stats_value">'.$stats->lastDeathYear().' + $content .= '<tr><td class="facts_label">' . WT_I18N::translate('Latest death year') . '</td><td class="facts_value stats_value">' . $stats->lastDeathYear() . ' </td>'; if (!$block) { - $content .= '<td class="facts_value">'.$stats->lastDeath().'</td>'; + $content .= '<td class="facts_value">' . $stats->lastDeath() . '</td>'; } - $content .='</tr>'; + $content .= '</tr>'; } if ($stat_long_life) { - $content .= '<tr><td class="facts_label">'.WT_I18N::translate('Individual who lived the longest').'</td><td class="facts_value stats_value">'.$stats->LongestLifeAge().'</td>'; + $content .= '<tr><td class="facts_label">' . WT_I18N::translate('Individual who lived the longest') . '</td><td class="facts_value stats_value">' . $stats->LongestLifeAge() . '</td>'; if (!$block) { - $content .= '<td class="facts_value">'.$stats->LongestLife().'</td>'; + $content .= '<td class="facts_value">' . $stats->LongestLife() . '</td>'; } $content .= '</tr>'; } if ($stat_avg_life) { - $content .= '<tr><td class="facts_label">'.WT_I18N::translate('Average age at death').'</td><td class="facts_value stats_value">'.$stats->averageLifespan().'</td>'; + $content .= '<tr><td class="facts_label">' . WT_I18N::translate('Average age at death') . '</td><td class="facts_value stats_value">' . $stats->averageLifespan() . '</td>'; if (!$block) { - $content .= '<td class="facts_value">'.WT_I18N::translate('Males').': '.$stats->averageLifespanMale(); - $content .= ' '.WT_I18N::translate('Females').': '.$stats->averageLifespanFemale().'</td>'; + $content .= '<td class="facts_value">' . WT_I18N::translate('Males') . ': ' . $stats->averageLifespanMale(); + $content .= ' ' . WT_I18N::translate('Females') . ': ' . $stats->averageLifespanFemale() . '</td>'; } $content .= '</tr>'; } if ($stat_most_chil && !$block) { - $content .= '<tr><td class="facts_label">'.WT_I18N::translate('Family with the most children').'</td><td class="facts_value stats_value">'.$stats->largestFamilySize().'</td>'; + $content .= '<tr><td class="facts_label">' . WT_I18N::translate('Family with the most children') . '</td><td class="facts_value stats_value">' . $stats->largestFamilySize() . '</td>'; if (!$block) { - $content .= '<td class="facts_value">'.$stats->largestFamily().'</td>'; + $content .= '<td class="facts_value">' . $stats->largestFamily() . '</td>'; } $content .= '</tr>'; } if ($stat_avg_chil) { - $content .= '<tr><td class="facts_label">'.WT_I18N::translate('Average number of children per family').'</td><td class="facts_value stats_value">'.$stats->averageChildren().'</td>'; + $content .= '<tr><td class="facts_label">' . WT_I18N::translate('Average number of children per family') . '</td><td class="facts_value stats_value">' . $stats->averageChildren() . '</td>'; if (!$block) { $content .= '<td class="facts_value"></td>'; } @@ -182,21 +182,21 @@ class gedcom_stats_WT_Module extends WT_Module implements WT_Module_Block { } $content .= '</table></td></tr></table>'; if ($stat_link) { - $content .= '<a href="statistics.php?ged='.WT_GEDURL.'"><b>'.WT_I18N::translate('View statistics as graphs').'</b></a><br>'; + $content .= '<a href="statistics.php?ged=' . WT_GEDURL . '"><b>' . WT_I18N::translate('View statistics as graphs') . '</b></a><br>'; } // NOTE: Print the most common surnames if ($show_common_surnames) { $surnames = get_common_surnames($WT_TREE->getPreference('COMMON_NAMES_THRESHOLD')); - if (count($surnames)>0) { - $content .= '<p><b>'.WT_I18N::translate('Most common surnames').'</b></p>'; + if (count($surnames) > 0) { + $content .= '<p><b>' . WT_I18N::translate('Most common surnames') . '</b></p>'; $content .= '<div class="common_surnames">'; - $i=0; + $i = 0; foreach ($surnames as $indexval => $surname) { - if (stristr($surname['name'], '@N.N')===false) { - if ($i>0) { + if (stristr($surname['name'], '@N.N') === false) { + if ($i > 0) { $content .= ', '; } - $content .= '<a href="'."indilist.php?ged=".WT_GEDURL."&surname=".rawurlencode($surname['name']).'">'.$surname['name'].'</a>'; + $content .= '<a href="' . "indilist.php?ged=" . WT_GEDURL . "&surname=" . rawurlencode($surname['name']) . '">' . $surname['name'] . '</a>'; $i++; } } @@ -229,61 +229,61 @@ class gedcom_stats_WT_Module extends WT_Module implements WT_Module_Block { /** {@inheritdoc} */ public function configureBlock($block_id) { if (WT_Filter::postBool('save') && WT_Filter::checkCsrf()) { - set_block_setting($block_id, 'show_last_update', WT_Filter::postBool('show_last_update')); + set_block_setting($block_id, 'show_last_update', WT_Filter::postBool('show_last_update')); set_block_setting($block_id, 'show_common_surnames', WT_Filter::postBool('show_common_surnames')); - set_block_setting($block_id, 'stat_indi', WT_Filter::postBool('stat_indi')); - set_block_setting($block_id, 'stat_fam', WT_Filter::postBool('stat_fam')); - set_block_setting($block_id, 'stat_sour', WT_Filter::postBool('stat_sour')); - set_block_setting($block_id, 'stat_other', WT_Filter::postBool('stat_other')); - set_block_setting($block_id, 'stat_media', WT_Filter::postBool('stat_media')); - set_block_setting($block_id, 'stat_repo', WT_Filter::postBool('stat_repo')); - set_block_setting($block_id, 'stat_surname', WT_Filter::postBool('stat_surname')); - set_block_setting($block_id, 'stat_events', WT_Filter::postBool('stat_events')); - set_block_setting($block_id, 'stat_users', WT_Filter::postBool('stat_users')); - set_block_setting($block_id, 'stat_first_birth', WT_Filter::postBool('stat_first_birth')); - set_block_setting($block_id, 'stat_last_birth', WT_Filter::postBool('stat_last_birth')); - set_block_setting($block_id, 'stat_first_death', WT_Filter::postBool('stat_first_death')); - set_block_setting($block_id, 'stat_last_death', WT_Filter::postBool('stat_last_death')); - set_block_setting($block_id, 'stat_long_life', WT_Filter::postBool('stat_long_life')); - set_block_setting($block_id, 'stat_avg_life', WT_Filter::postBool('stat_avg_life')); - set_block_setting($block_id, 'stat_most_chil', WT_Filter::postBool('stat_most_chil')); - set_block_setting($block_id, 'stat_avg_chil', WT_Filter::postBool('stat_avg_chil')); + set_block_setting($block_id, 'stat_indi', WT_Filter::postBool('stat_indi')); + set_block_setting($block_id, 'stat_fam', WT_Filter::postBool('stat_fam')); + set_block_setting($block_id, 'stat_sour', WT_Filter::postBool('stat_sour')); + set_block_setting($block_id, 'stat_other', WT_Filter::postBool('stat_other')); + set_block_setting($block_id, 'stat_media', WT_Filter::postBool('stat_media')); + set_block_setting($block_id, 'stat_repo', WT_Filter::postBool('stat_repo')); + set_block_setting($block_id, 'stat_surname', WT_Filter::postBool('stat_surname')); + set_block_setting($block_id, 'stat_events', WT_Filter::postBool('stat_events')); + set_block_setting($block_id, 'stat_users', WT_Filter::postBool('stat_users')); + set_block_setting($block_id, 'stat_first_birth', WT_Filter::postBool('stat_first_birth')); + set_block_setting($block_id, 'stat_last_birth', WT_Filter::postBool('stat_last_birth')); + set_block_setting($block_id, 'stat_first_death', WT_Filter::postBool('stat_first_death')); + set_block_setting($block_id, 'stat_last_death', WT_Filter::postBool('stat_last_death')); + set_block_setting($block_id, 'stat_long_life', WT_Filter::postBool('stat_long_life')); + set_block_setting($block_id, 'stat_avg_life', WT_Filter::postBool('stat_avg_life')); + set_block_setting($block_id, 'stat_most_chil', WT_Filter::postBool('stat_most_chil')); + set_block_setting($block_id, 'stat_avg_chil', WT_Filter::postBool('stat_avg_chil')); exit; } - require_once WT_ROOT.'includes/functions/functions_edit.php'; + require_once WT_ROOT . 'includes/functions/functions_edit.php'; - $show_last_update=get_block_setting($block_id, 'show_last_update', true); + $show_last_update = get_block_setting($block_id, 'show_last_update', true); echo '<tr><td class="descriptionbox wrap width33">'; echo /* I18N: label for yes/no option */ WT_I18N::translate('Show date of last update?'); echo '</td><td class="optionbox">'; echo edit_field_yes_no('show_last_update', $show_last_update); echo '</td></tr>'; - $show_common_surnames=get_block_setting($block_id, 'show_common_surnames', true); + $show_common_surnames = get_block_setting($block_id, 'show_common_surnames', true); echo '<tr><td class="descriptionbox wrap width33">'; echo WT_I18N::translate('Show common surnames?'); echo '</td><td class="optionbox">'; echo edit_field_yes_no('show_common_surnames', $show_common_surnames); echo '</td></tr>'; - $stat_indi =get_block_setting($block_id, 'stat_indi', true); - $stat_fam =get_block_setting($block_id, 'stat_fam', true); - $stat_sour =get_block_setting($block_id, 'stat_sour', true); - $stat_other =get_block_setting($block_id, 'stat_other', true); - $stat_media =get_block_setting($block_id, 'stat_media', true); - $stat_repo =get_block_setting($block_id, 'stat_repo', true); - $stat_surname =get_block_setting($block_id, 'stat_surname', true); - $stat_events =get_block_setting($block_id, 'stat_events', true); - $stat_users =get_block_setting($block_id, 'stat_users', true); - $stat_first_birth =get_block_setting($block_id, 'stat_first_birth', true); - $stat_last_birth =get_block_setting($block_id, 'stat_last_birth', true); - $stat_first_death =get_block_setting($block_id, 'stat_first_death', true); - $stat_last_death =get_block_setting($block_id, 'stat_last_death', true); - $stat_long_life =get_block_setting($block_id, 'stat_long_life', true); - $stat_avg_life =get_block_setting($block_id, 'stat_avg_life', true); - $stat_most_chil =get_block_setting($block_id, 'stat_most_chil', true); - $stat_avg_chil =get_block_setting($block_id, 'stat_avg_chil', true); + $stat_indi = get_block_setting($block_id, 'stat_indi', true); + $stat_fam = get_block_setting($block_id, 'stat_fam', true); + $stat_sour = get_block_setting($block_id, 'stat_sour', true); + $stat_other = get_block_setting($block_id, 'stat_other', true); + $stat_media = get_block_setting($block_id, 'stat_media', true); + $stat_repo = get_block_setting($block_id, 'stat_repo', true); + $stat_surname = get_block_setting($block_id, 'stat_surname', true); + $stat_events = get_block_setting($block_id, 'stat_events', true); + $stat_users = get_block_setting($block_id, 'stat_users', true); + $stat_first_birth = get_block_setting($block_id, 'stat_first_birth', true); + $stat_last_birth = get_block_setting($block_id, 'stat_last_birth', true); + $stat_first_death = get_block_setting($block_id, 'stat_first_death', true); + $stat_last_death = get_block_setting($block_id, 'stat_last_death', true); + $stat_long_life = get_block_setting($block_id, 'stat_long_life', true); + $stat_avg_life = get_block_setting($block_id, 'stat_avg_life', true); + $stat_most_chil = get_block_setting($block_id, 'stat_most_chil', true); + $stat_avg_chil = get_block_setting($block_id, 'stat_avg_chil', true); ?> <tr> <td class="descriptionbox wrap width33"><?php echo WT_I18N::translate('Select the stats to show in this block'); ?></td> diff --git a/modules_v3/googlemap/help_text.php b/modules_v3/googlemap/help_text.php index 8438a11dec..687fcfc102 100644 --- a/modules_v3/googlemap/help_text.php +++ b/modules_v3/googlemap/help_text.php @@ -21,85 +21,85 @@ // along with this program; if not, write to the Free Software // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA -if (!defined('WT_WEBTREES') || !defined('WT_SCRIPT_NAME') || WT_SCRIPT_NAME!='help_text.php') { +if (!defined('WT_WEBTREES') || !defined('WT_SCRIPT_NAME') || WT_SCRIPT_NAME != 'help_text.php') { header('HTTP/1.0 403 Forbidden'); exit; } switch ($help) { case 'GM_MAP_ZOOM': - $title=WT_I18N::translate('Zoom level of map'); - $text=WT_I18N::translate('Minimum and maximum zoom level for the Google map. 1 is the full map, 15 is single house. Note that 15 is only available in certain areas.'); + $title = WT_I18N::translate('Zoom level of map'); + $text = WT_I18N::translate('Minimum and maximum zoom level for the Google map. 1 is the full map, 15 is single house. Note that 15 is only available in certain areas.'); break; case 'GM_PRECISION': - $title=WT_I18N::translate('Precision of the latitude and longitude'); - $text=WT_I18N::translate('This specifies the precision of the different levels when entering new geographic locations. For example a country will be specified with precision 0 (=0 digits after the decimal point), while a town needs 3 or 4 digits.'); + $title = WT_I18N::translate('Precision of the latitude and longitude'); + $text = WT_I18N::translate('This specifies the precision of the different levels when entering new geographic locations. For example a country will be specified with precision 0 (=0 digits after the decimal point), while a town needs 3 or 4 digits.'); break; case 'GM_NAME_PREFIX_SUFFIX': - $title=WT_I18N::translate('Optional prefixes and suffixes'); - $text=WT_I18N::translate('Some place names may be written with optional prefixes and suffixes. For example “Orange” versus “Orange County”. If the family tree contains the full place names, but the geographic database contains the short place names, then you should specify a list of the prefixes and suffixes to be disregarded. Multiple options should be separated with semicolons. For example “County;County of” or “Township;Twp;Twp.”.'); + $title = WT_I18N::translate('Optional prefixes and suffixes'); + $text = WT_I18N::translate('Some place names may be written with optional prefixes and suffixes. For example “Orange” versus “Orange County”. If the family tree contains the full place names, but the geographic database contains the short place names, then you should specify a list of the prefixes and suffixes to be disregarded. Multiple options should be separated with semicolons. For example “County;County of” or “Township;Twp;Twp.”.'); break; case 'GM_COORD': - $title=WT_I18N::translate('Display map coordinates'); - $text=WT_I18N::translate('This options sets whether latitude and longitude are displayed on the pop-up window attached to map markers.'); + $title = WT_I18N::translate('Display map coordinates'); + $text = WT_I18N::translate('This options sets whether latitude and longitude are displayed on the pop-up window attached to map markers.'); break; // Help texts for places_edit.php case 'PLE_PRECISION': - $title=WT_I18N::translate('Enter precision'); - $text=WT_I18N::translate('Here you can enter the precision. Based on this setting the number of digits that will be used in the latitude and longitude is determined.'); + $title = WT_I18N::translate('Enter precision'); + $text = WT_I18N::translate('Here you can enter the precision. Based on this setting the number of digits that will be used in the latitude and longitude is determined.'); break; case 'PLE_ZOOM': - $title=WT_I18N::translate('Enter zoom level'); - $text=WT_I18N::translate('Here the zoom level can be entered. This value will be used as the minimal value when displaying this geographic location on a map.'); + $title = WT_I18N::translate('Enter zoom level'); + $text = WT_I18N::translate('Here the zoom level can be entered. This value will be used as the minimal value when displaying this geographic location on a map.'); break; case 'PLE_ICON': - $title=WT_I18N::translate('Select an icon'); - $text=WT_I18N::translate('Here an icon can be set or removed. Using this link a flag can be selected. When this geographic location is shown, this flag will be displayed.'); + $title = WT_I18N::translate('Select an icon'); + $text = WT_I18N::translate('Here an icon can be set or removed. Using this link a flag can be selected. When this geographic location is shown, this flag will be displayed.'); break; case 'PLE_FLAGS': - $title=WT_I18N::translate('Select flag'); - $text=WT_I18N::translate('Using the pull down menu it is possible to select a country, of which a flag can be selected. If no flags are shown, then there are no flags defined for this country.'); + $title = WT_I18N::translate('Select flag'); + $text = WT_I18N::translate('Using the pull down menu it is possible to select a country, of which a flag can be selected. If no flags are shown, then there are no flags defined for this country.'); break; case 'PLIF_LOCALFILE': - $title=WT_I18N::translate('Enter filename'); - $text=WT_I18N::translate('Select a file from the list of files already on the server which contains the place locations in CSV format.'); + $title = WT_I18N::translate('Enter filename'); + $text = WT_I18N::translate('Select a file from the list of files already on the server which contains the place locations in CSV format.'); break; case 'PLE_ACTIVE': - $title=WT_I18N::translate('Show inactive places'); - $text= - '<p>'. - WT_I18N::translate('By default, the list shows only those places which can be found in your family trees. You may have details for other places, such as those imported in bulk from an external file. Selecting this option will show all places, including ones that are not currently used.'). - '</p><p class="warning">'. - WT_I18N::translate('If you have a large number of inactive places, it can be slow to generate the list.'). + $title = WT_I18N::translate('Show inactive places'); + $text = + '<p>' . + WT_I18N::translate('By default, the list shows only those places which can be found in your family trees. You may have details for other places, such as those imported in bulk from an external file. Selecting this option will show all places, including ones that are not currently used.') . + '</p><p class="warning">' . + WT_I18N::translate('If you have a large number of inactive places, it can be slow to generate the list.') . '</p>'; break; // Help text for Place Hierarchy display case 'GM_DISP_SHORT_PLACE': - $title=WT_I18N::translate('Display short placenames'); - $text=WT_I18N::translate('Here you can choose between two types of displaying places names in hierarchy. If set Yes the place has short name or actual level name, if No - full name.<br><b>Examples:<br>Full name: </b>Chicago, Illinois, USA<br><b>Short name: </b>Chicago<br><b>Full name: </b>Illinois, USA<br><b>Short name: </b>Illinois'); + $title = WT_I18N::translate('Display short placenames'); + $text = WT_I18N::translate('Here you can choose between two types of displaying places names in hierarchy. If set Yes the place has short name or actual level name, if No - full name.<br><b>Examples:<br>Full name: </b>Chicago, Illinois, USA<br><b>Short name: </b>Chicago<br><b>Full name: </b>Illinois, USA<br><b>Short name: </b>Illinois'); break; // Pedigree map case 'PEDIGREE_MAP_hidelines': - $title=WT_I18N::translate('Hide lines'); - $text=WT_I18N::translate('Hide the lines connecting the child to each parent if they exist on the map.'); + $title = WT_I18N::translate('Hide lines'); + $text = WT_I18N::translate('Hide the lines connecting the child to each parent if they exist on the map.'); break; case 'PEDIGREE_MAP_hideflags': - $title=WT_I18N::translate('Hide flags'); - $text=WT_I18N::translate('Hide the flags that are configured in the googlemap module. Usually these are for countries and states. This serves as a visual cue that the markers around the flag are from the general area, and not the specific spot.'); + $title = WT_I18N::translate('Hide flags'); + $text = WT_I18N::translate('Hide the flags that are configured in the googlemap module. Usually these are for countries and states. This serves as a visual cue that the markers around the flag are from the general area, and not the specific spot.'); break; } diff --git a/modules_v3/html/module.php b/modules_v3/html/module.php index 292caec0bc..b2717834d6 100644 --- a/modules_v3/html/module.php +++ b/modules_v3/html/module.php @@ -37,11 +37,11 @@ class html_WT_Module extends WT_Module implements WT_Module_Block { } /** {@inheritdoc} */ - public function getBlock($block_id, $template=true, $cfg=null) { + public function getBlock($block_id, $template = true, $cfg = null) { global $ctype, $GEDCOM; // Only show this block for certain languages - $languages=get_block_setting($block_id, 'languages'); + $languages = get_block_setting($block_id, 'languages'); if ($languages && !in_array(WT_LOCALE, explode(',', $languages))) { return; } @@ -49,17 +49,17 @@ class html_WT_Module extends WT_Module implements WT_Module_Block { /* * Select GEDCOM */ - $gedcom=get_block_setting($block_id, 'gedcom'); - switch($gedcom) { + $gedcom = get_block_setting($block_id, 'gedcom'); + switch ($gedcom) { case '__current__': break; case '': break; case '__default__': - $GEDCOM=WT_Site::getPreference('DEFAULT_GEDCOM'); + $GEDCOM = WT_Site::getPreference('DEFAULT_GEDCOM'); if (!$GEDCOM) { foreach (WT_Tree::getAll() as $tree) { - $GEDCOM=$tree->tree_name; + $GEDCOM = $tree->tree_name; break; } } @@ -75,7 +75,7 @@ class html_WT_Module extends WT_Module implements WT_Module_Block { $title_tmp = get_block_setting($block_id, 'title'); $html = get_block_setting($block_id, 'html'); - if ( (strpos($title_tmp, '#')!==false) || (strpos($html, '#')!==false) ) { + if ((strpos($title_tmp, '#') !== false) || (strpos($html, '#') !== false)) { $stats = new WT_Stats($GEDCOM); $title_tmp = $stats->embedTags($title_tmp); $html = $stats->embedTags($html); @@ -89,19 +89,19 @@ class html_WT_Module extends WT_Module implements WT_Module_Block { /* * Start Of Output */ - $id=$this->getName().$block_id; - $class=$this->getName().'_block'; + $id = $this->getName() . $block_id; + $class = $this->getName() . '_block'; if ($ctype === 'gedcom' && WT_USER_GEDCOM_ADMIN || $ctype === 'user' && Auth::check()) { - $title='<i class="icon-admin" title="'.WT_I18N::translate('Configure').'" onclick="modalDialog(\'block_edit.php?block_id='.$block_id.'\', \''.$this->getTitle().'\');"></i>'; + $title = '<i class="icon-admin" title="' . WT_I18N::translate('Configure') . '" onclick="modalDialog(\'block_edit.php?block_id=' . $block_id . '\', \'' . $this->getTitle() . '\');"></i>'; } else { - $title=''; + $title = ''; } - $title.=$title_tmp; + $title .= $title_tmp; $content = $html; if (get_block_setting($block_id, 'show_timestamp', false)) { - $content.='<br>'.format_timestamp(get_block_setting($block_id, 'timestamp', WT_TIMESTAMP)); + $content .= '<br>' . format_timestamp(get_block_setting($block_id, 'timestamp', WT_TIMESTAMP)); } if ($template) { @@ -132,24 +132,24 @@ class html_WT_Module extends WT_Module implements WT_Module_Block { /** {@inheritdoc} */ public function configureBlock($block_id) { if (WT_Filter::postBool('save') && WT_Filter::checkCsrf()) { - set_block_setting($block_id, 'gedcom', WT_Filter::post('gedcom')); - set_block_setting($block_id, 'title', WT_Filter::post('title')); - set_block_setting($block_id, 'html', WT_Filter::post('html')); + set_block_setting($block_id, 'gedcom', WT_Filter::post('gedcom')); + set_block_setting($block_id, 'title', WT_Filter::post('title')); + set_block_setting($block_id, 'html', WT_Filter::post('html')); set_block_setting($block_id, 'show_timestamp', WT_Filter::postBool('show_timestamp')); - set_block_setting($block_id, 'timestamp', WT_Filter::post('timestamp')); - $languages=array(); + set_block_setting($block_id, 'timestamp', WT_Filter::post('timestamp')); + $languages = array(); foreach (WT_I18N::installed_languages() as $code=>$name) { - if (WT_Filter::postBool('lang_'.$code)) { - $languages[]=$code; + if (WT_Filter::postBool('lang_' . $code)) { + $languages[] = $code; } } set_block_setting($block_id, 'languages', implode(',', $languages)); exit; } - require_once WT_ROOT.'includes/functions/functions_edit.php'; + require_once WT_ROOT . 'includes/functions/functions_edit.php'; - $templates=array( + $templates = array( WT_I18N::translate('Keyword examples')=> '#getAllTagsTable#', @@ -165,43 +165,43 @@ class html_WT_Module extends WT_Module implements WT_Module_Block { <td valign="top" class="width20"> <table cellspacing="1" cellpadding="0"> <tr> - <td class="facts_label">'.WT_I18N::translate('Individuals').'</td> + <td class="facts_label">'.WT_I18N::translate('Individuals') . '</td> <td class="facts_value" align="right"><a href="indilist.php?surname_sublist=no">#totalIndividuals#</a></td> </tr> <tr> - <td class="facts_label">'.WT_I18N::translate('Males').'</td> + <td class="facts_label">'.WT_I18N::translate('Males') . '</td> <td class="facts_value" align="right">#totalSexMales#<br>#totalSexMalesPercentage#</td> </tr> <tr> - <td class="facts_label">'.WT_I18N::translate('Females').'</td> + <td class="facts_label">'.WT_I18N::translate('Females') . '</td> <td class="facts_value" align="right">#totalSexFemales#<br>#totalSexFemalesPercentage#</td> </tr> <tr> - <td class="facts_label">'.WT_I18N::translate('Total surnames').'</td> - <td class="facts_value" align="right"><a href="indilist.php?show_all=yes&surname_sublist=yes&ged='.WT_GEDURL.'">#totalSurnames#</a></td> + <td class="facts_label">'.WT_I18N::translate('Total surnames') . '</td> + <td class="facts_value" align="right"><a href="indilist.php?show_all=yes&surname_sublist=yes&ged='.WT_GEDURL . '">#totalSurnames#</a></td> </tr> <tr> - <td class="facts_label">'. WT_I18N::translate('Families').'</td> - <td class="facts_value" align="right"><a href="famlist.php?ged='.WT_GEDURL.'">#totalFamilies#</a></td> + <td class="facts_label">'. WT_I18N::translate('Families') . '</td> + <td class="facts_value" align="right"><a href="famlist.php?ged='.WT_GEDURL . '">#totalFamilies#</a></td> </tr> <tr> - <td class="facts_label">'.WT_I18N::translate('Sources').'</td> - <td class="facts_value" align="right"><a href="sourcelist.php?ged='.WT_GEDURL.'">#totalSources#</a></td> + <td class="facts_label">'.WT_I18N::translate('Sources') . '</td> + <td class="facts_value" align="right"><a href="sourcelist.php?ged='.WT_GEDURL . '">#totalSources#</a></td> </tr> <tr> - <td class="facts_label">'.WT_I18N::translate('Media objects').'</td> - <td class="facts_value" align="right"><a href="medialist.php?ged='.WT_GEDURL.'">#totalMedia#</a></td> + <td class="facts_label">'.WT_I18N::translate('Media objects') . '</td> + <td class="facts_value" align="right"><a href="medialist.php?ged='.WT_GEDURL . '">#totalMedia#</a></td> </tr> <tr> - <td class="facts_label">'.WT_I18N::translate('Repositories').'</td> - <td class="facts_value" align="right"><a href="repolist.php?ged='.WT_GEDURL.'">#totalRepositories#</a></td> + <td class="facts_label">'.WT_I18N::translate('Repositories') . '</td> + <td class="facts_value" align="right"><a href="repolist.php?ged='.WT_GEDURL . '">#totalRepositories#</a></td> </tr> <tr> - <td class="facts_label">'.WT_I18N::translate('Total events').'</td> + <td class="facts_label">'.WT_I18N::translate('Total events') . '</td> <td class="facts_value" align="right">#totalEvents#</td> </tr> <tr> - <td class="facts_label">'.WT_I18N::translate('Total users').'</td> + <td class="facts_label">'.WT_I18N::translate('Total users') . '</td> <td class="facts_value" align="right">#totalUsers#</td> </tr> </table> @@ -210,42 +210,42 @@ class html_WT_Module extends WT_Module implements WT_Module_Block { <td valign="top"> <table cellspacing="1" cellpadding="0" border="0"> <tr> - <td class="facts_label">'.WT_I18N::translate('Earliest birth year').'</td> + <td class="facts_label">'.WT_I18N::translate('Earliest birth year') . '</td> <td class="facts_value" align="right">#firstBirthYear#</td> <td class="facts_value">#firstBirth#</td> </tr> <tr> - <td class="facts_label">'.WT_I18N::translate('Latest birth year').'</td> + <td class="facts_label">'.WT_I18N::translate('Latest birth year') . '</td> <td class="facts_value" align="right">#lastBirthYear#</td> <td class="facts_value">#lastBirth#</td> </tr> <tr> - <td class="facts_label">'.WT_I18N::translate('Earliest death year').'</td> + <td class="facts_label">'.WT_I18N::translate('Earliest death year') . '</td> <td class="facts_value" align="right">#firstDeathYear#</td> <td class="facts_value">#firstDeath#</td> </tr> <tr> - <td class="facts_label">'.WT_I18N::translate('Latest death year').'</td> + <td class="facts_label">'.WT_I18N::translate('Latest death year') . '</td> <td class="facts_value" align="right">#lastDeathYear#</td> <td class="facts_value">#lastDeath#</td> </tr> <tr> - <td class="facts_label">'.WT_I18N::translate('Individual who lived the longest').'</td> + <td class="facts_label">'.WT_I18N::translate('Individual who lived the longest') . '</td> <td class="facts_value" align="right">#longestLifeAge#</td> <td class="facts_value">#longestLife#</td> </tr> <tr> - <td class="facts_label">'.WT_I18N::translate('Average age at death').'</td> + <td class="facts_label">'.WT_I18N::translate('Average age at death') . '</td> <td class="facts_value" align="right">#averageLifespan#</td> <td class="facts_value"></td> </tr> <tr> - <td class="facts_label">'.WT_I18N::translate('Family with the most children').'</td> + <td class="facts_label">'.WT_I18N::translate('Family with the most children') . '</td> <td class="facts_value" align="right">#largestFamilySize#</td> <td class="facts_value">#largestFamily#</td> </tr> <tr> - <td class="facts_label">'.WT_I18N::translate('Average number of children per family'). '</td> + <td class="facts_label">'.WT_I18N::translate('Average number of children per family') . '</td> <td class="facts_value" align="right">#averageChildren#</td> <td class="facts_value"></td> </tr> @@ -253,13 +253,13 @@ class html_WT_Module extends WT_Module implements WT_Module_Block { </td> </tr> </table><br> - <span style="font-weight: bold;">' .WT_I18N::translate('Most common surnames').'</span><br> + <span style="font-weight: bold;">' .WT_I18N::translate('Most common surnames') . '</span><br> #commonSurnames# </div>' ); - $title=get_block_setting($block_id, 'title'); - $html=get_block_setting($block_id, 'html'); + $title = get_block_setting($block_id, 'title'); + $html = get_block_setting($block_id, 'html'); // title echo '<tr><td class="descriptionbox wrap">', WT_Gedcom_Tag::getLabel('TITL'), @@ -272,9 +272,9 @@ class html_WT_Module extends WT_Module implements WT_Module_Block { '</td><td class="optionbox">'; // The CK editor needs lots of help to load/save data :-( if (array_key_exists('ckeditor', WT_Module::getActiveModules())) { - $ckeditor_onchange='CKEDITOR.instances.html.setData(document.block.html.value);'; + $ckeditor_onchange = 'CKEDITOR.instances.html.setData(document.block.html.value);'; } else { - $ckeditor_onchange=''; + $ckeditor_onchange = ''; } echo '<select name="template" onchange="document.block.html.value=document.block.template.options[document.block.template.selectedIndex].value;', $ckeditor_onchange, '">'; echo '<option value="', WT_Filter::escapeHtml($html), '">', WT_I18N::translate('Custom'), '</option>'; @@ -284,10 +284,10 @@ class html_WT_Module extends WT_Module implements WT_Module_Block { echo '</select></td></tr>'; // gedcom - $gedcom=get_block_setting($block_id, 'gedcom'); + $gedcom = get_block_setting($block_id, 'gedcom'); if (count(WT_Tree::getAll()) > 1) { - if ($gedcom == '__current__') {$sel_current = ' selected="selected"';} else {$sel_current = '';} - if ($gedcom == '__default__') {$sel_default = ' selected="selected"';} else {$sel_default = '';} + if ($gedcom == '__current__') {$sel_current = ' selected="selected"'; } else {$sel_current = ''; } + if ($gedcom == '__default__') {$sel_default = ' selected="selected"'; } else {$sel_default = ''; } echo '<tr><td class="descriptionbox wrap">', WT_I18N::translate('Family tree'), '</td><td class="optionbox">', @@ -295,7 +295,7 @@ class html_WT_Module extends WT_Module implements WT_Module_Block { '<option value="__current__"', $sel_current, '>', WT_I18N::translate('Current'), '</option>', '<option value="__default__"', $sel_default, '>', WT_I18N::translate('Default'), '</option>'; foreach (WT_Tree::getAll() as $tree) { - if ($tree->tree_name == $gedcom) {$sel = ' selected="selected"';} else {$sel = '';} + if ($tree->tree_name == $gedcom) {$sel = ' selected="selected"'; } else {$sel = ''; } echo '<option value="', $tree->tree_name, '"', $sel, ' dir="auto">', $tree->tree_title_html, '</option>'; } echo '</select></td></tr>'; @@ -310,7 +310,7 @@ class html_WT_Module extends WT_Module implements WT_Module_Block { echo '<textarea name="html" class="html-edit" rows="10" style="width:98%;">', WT_Filter::escapeHtml($html), '</textarea>'; echo '</td></tr>'; - $show_timestamp=get_block_setting($block_id, 'show_timestamp', false); + $show_timestamp = get_block_setting($block_id, 'show_timestamp', false); echo '<tr><td class="descriptionbox wrap">'; echo WT_I18N::translate('Show the date and time of update'); echo '</td><td class="optionbox">'; @@ -318,7 +318,7 @@ class html_WT_Module extends WT_Module implements WT_Module_Block { echo '<input type="hidden" name="timestamp" value="', WT_TIMESTAMP, '">'; echo '</td></tr>'; - $languages=get_block_setting($block_id, 'languages'); + $languages = get_block_setting($block_id, 'languages'); echo '<tr><td class="descriptionbox wrap">'; echo WT_I18N::translate('Show this block for which languages?'); echo '</td><td class="optionbox">'; diff --git a/modules_v3/personal_facts/module.php b/modules_v3/personal_facts/module.php index 55b8130c41..28eaebad6a 100644 --- a/modules_v3/personal_facts/module.php +++ b/modules_v3/personal_facts/module.php @@ -123,7 +123,7 @@ class personal_facts_WT_Module extends WT_Module implements WT_Module_Tab { echo ' checked="checked"'; } echo ' onclick="jQuery(\'tr.rela\').toggle();"><label for="checkbox_rela_facts">', WT_I18N::translate('Events of close relatives'), '</label>'; - if (file_exists(WT_Site::getPreference('INDEX_DIRECTORY').'histo.'.WT_LOCALE.'.php')) { + if (file_exists(WT_Site::getPreference('INDEX_DIRECTORY') . 'histo.' . WT_LOCALE . '.php')) { echo ' <input id="checkbox_histo" type="checkbox"'; if ($EXPAND_HISTO_EVENTS) { echo ' checked="checked"'; @@ -151,7 +151,7 @@ class personal_facts_WT_Module extends WT_Module implements WT_Module_Tab { } - return '<div id="'.$this->getName().'_content">'.ob_get_clean().'</div>'; + return '<div id="' . $this->getName() . '_content">' . ob_get_clean() . '</div>'; } /** {@inheritdoc} */ @@ -191,10 +191,10 @@ class personal_facts_WT_Module extends WT_Module implements WT_Module_Tab { foreach ($spouse->getFacts(WT_EVENTS_DEAT) as $fact) { $fact_date = $fact->getDate(); - if ($fact_date->isOK() && WT_Date::Compare($birt_date, $fact_date)<=0 && WT_Date::Compare($fact_date, $deat_date)<=0) { + if ($fact_date->isOK() && WT_Date::Compare($birt_date, $fact_date) <= 0 && WT_Date::Compare($fact_date, $deat_date) <= 0) { // Convert the event to a close relatives event. $rela_fact = clone($fact); - $rela_fact->setTag('_'.$fact->getTag().'_SPOU'); + $rela_fact->setTag('_' . $fact->getTag() . '_SPOU'); $facts[] = $rela_fact; } } @@ -252,22 +252,22 @@ class personal_facts_WT_Module extends WT_Module implements WT_Module_Tab { // For each child in the family foreach ($family->getChildren() as $child) { - if ($child->getXref()==$person->getXref()) { + if ($child->getXref() == $person->getXref()) { // We are not our own sibling! continue; } // add child’s birth - if (strpos($SHOW_RELATIVES_EVENTS, '_BIRT'.str_replace('_HSIB', '_SIBL', $option))!==false) { + if (strpos($SHOW_RELATIVES_EVENTS, '_BIRT' . str_replace('_HSIB', '_SIBL', $option)) !== false) { foreach ($child->getFacts(WT_EVENTS_BIRT) as $fact) { - $sgdate=$fact->getDate(); + $sgdate = $fact->getDate(); // Always show _BIRT_CHIL, even if the dates are not known - if ($option=='_CHIL' || $sgdate->isOK() && WT_Date::Compare($birt_date, $sgdate)<=0 && WT_Date::Compare($sgdate, $deat_date)<=0) { - if ($option=='_GCHI' && $relation=='dau') { + if ($option == '_CHIL' || $sgdate->isOK() && WT_Date::Compare($birt_date, $sgdate) <= 0 && WT_Date::Compare($sgdate, $deat_date) <= 0) { + if ($option == '_GCHI' && $relation == 'dau') { // Convert the event to a close relatives event. $rela_fact = clone($fact); $rela_fact->setTag('_' . $fact->getTag() . '_GCH1'); $facts[] = $rela_fact; - } elseif ($option=='_GCHI' && $relation=='son') { + } elseif ($option == '_GCHI' && $relation == 'son') { // Convert the event to a close relatives event. $rela_fact = clone($fact); $rela_fact->setTag('_' . $fact->getTag() . '_GCH2'); @@ -282,16 +282,16 @@ class personal_facts_WT_Module extends WT_Module implements WT_Module_Tab { } } // add child’s death - if (strpos($SHOW_RELATIVES_EVENTS, '_DEAT'.str_replace('_HSIB', '_SIBL', $option))!==false) { + if (strpos($SHOW_RELATIVES_EVENTS, '_DEAT' . str_replace('_HSIB', '_SIBL', $option)) !== false) { foreach ($child->getFacts(WT_EVENTS_DEAT) as $fact) { - $sgdate=$fact->getDate(); - if ($sgdate->isOK() && WT_Date::Compare($birt_date, $sgdate)<=0 && WT_Date::Compare($sgdate, $deat_date)<=0) { - if ($option=='_GCHI' && $relation=='dau') { + $sgdate = $fact->getDate(); + if ($sgdate->isOK() && WT_Date::Compare($birt_date, $sgdate) <= 0 && WT_Date::Compare($sgdate, $deat_date) <= 0) { + if ($option == '_GCHI' && $relation == 'dau') { // Convert the event to a close relatives event. $rela_fact = clone($fact); $rela_fact->setTag('_' . $fact->getTag() . '_GCH1'); $facts[] = $rela_fact; - } elseif ($option=='_GCHI' && $relation=='son') { + } elseif ($option == '_GCHI' && $relation == 'son') { // Convert the event to a close relatives event. $rela_fact = clone($fact); $rela_fact->setTag('_' . $fact->getTag() . '_GCH2'); @@ -306,17 +306,17 @@ class personal_facts_WT_Module extends WT_Module implements WT_Module_Tab { } } // add child’s marriage - if (strstr($SHOW_RELATIVES_EVENTS, '_MARR'.str_replace('_HSIB', '_SIBL', $option))) { + if (strstr($SHOW_RELATIVES_EVENTS, '_MARR' . str_replace('_HSIB', '_SIBL', $option))) { foreach ($child->getSpouseFamilies() as $sfamily) { foreach ($sfamily->getFacts(WT_EVENTS_MARR) as $fact) { - $sgdate=$fact->getDate(); - if ($sgdate->isOK() && WT_Date::Compare($birt_date, $sgdate)<=0 && WT_Date::Compare($sgdate, $deat_date)<=0) { - if ($option=='_GCHI' && $relation=='dau') { + $sgdate = $fact->getDate(); + if ($sgdate->isOK() && WT_Date::Compare($birt_date, $sgdate) <= 0 && WT_Date::Compare($sgdate, $deat_date) <= 0) { + if ($option == '_GCHI' && $relation == 'dau') { // Convert the event to a close relatives event. $rela_fact = clone($fact); $rela_fact->setTag('_' . $fact->getTag() . '_GCH1'); $facts[] = $rela_fact; - } elseif ($option=='_GCHI' && $relation=='son') { + } elseif ($option == '_GCHI' && $relation == 'son') { // Convert the event to a close relatives event. $rela_fact = clone($fact); $rela_fact->setTag('_' . $fact->getTag() . '_GCH2'); @@ -369,7 +369,7 @@ class personal_facts_WT_Module extends WT_Module implements WT_Module_Tab { } } // Add grandparents - foreach (self::parentFacts($spouse, $spouse->getSex()=='F' ? 3 : 2) as $fact) { + foreach (self::parentFacts($spouse, $spouse->getSex() == 'F' ? 3 : 2) as $fact) { $facts[] = $fact; } } @@ -379,21 +379,21 @@ class personal_facts_WT_Module extends WT_Module implements WT_Module_Tab { // add father/mother marriages foreach ($person->getChildFamilies() as $sfamily) { foreach ($sfamily->getFacts(WT_EVENTS_MARR) as $fact) { - if ($fact->getDate()->isOK() && WT_Date::Compare($birt_date, $fact->getDate())<=0 && WT_Date::Compare($fact->getDate(), $deat_date)<=0) { + if ($fact->getDate()->isOK() && WT_Date::Compare($birt_date, $fact->getDate()) <= 0 && WT_Date::Compare($fact->getDate(), $deat_date) <= 0) { // marriage of parents (to each other) $rela_fact = clone($fact); - $rela_fact->setTag('_'.$fact->getTag().'_FAMC'); + $rela_fact->setTag('_' . $fact->getTag() . '_FAMC'); $facts[] = $rela_fact; } } } foreach ($person->getChildStepFamilies() as $sfamily) { foreach ($sfamily->getFacts(WT_EVENTS_MARR) as $fact) { - if ($fact->getDate()->isOK() && WT_Date::Compare($birt_date, $fact->getDate())<=0 && WT_Date::Compare($fact->getDate(), $deat_date)<=0) { + if ($fact->getDate()->isOK() && WT_Date::Compare($birt_date, $fact->getDate()) <= 0 && WT_Date::Compare($fact->getDate(), $deat_date) <= 0) { // marriage of a parent (to another spouse) // Convert the event to a close relatives event $rela_fact = clone($fact); - $rela_fact->setTag('_'.$fact->getTag().'_PARE'); + $rela_fact->setTag('_' . $fact->getTag() . '_PARE'); $facts[] = $rela_fact; } } @@ -403,26 +403,26 @@ class personal_facts_WT_Module extends WT_Module implements WT_Module_Tab { foreach ($person->getChildFamilies() as $family) { foreach ($family->getSpouses() as $parent) { - if (strstr($SHOW_RELATIVES_EVENTS, '_DEAT'.($sosa==1 ? '_PARE' : '_GPAR'))) { + if (strstr($SHOW_RELATIVES_EVENTS, '_DEAT' . ($sosa == 1 ? '_PARE' : '_GPAR'))) { foreach ($parent->getFacts(WT_EVENTS_DEAT) as $fact) { - if ($fact->getDate()->isOK() && WT_Date::Compare($birt_date, $fact->getDate())<=0 && WT_Date::Compare($fact->getDate(), $deat_date)<=0) { + if ($fact->getDate()->isOK() && WT_Date::Compare($birt_date, $fact->getDate()) <= 0 && WT_Date::Compare($fact->getDate(), $deat_date) <= 0) { switch ($sosa) { case 1: // Convert the event to a close relatives event. $rela_fact = clone($fact); - $rela_fact->setTag('_'.$fact->getTag().'_PARE'); + $rela_fact->setTag('_' . $fact->getTag() . '_PARE'); $facts[] = $rela_fact; break; case 2: // Convert the event to a close relatives event $rela_fact = clone($fact); - $rela_fact->setTag('_'.$fact->getTag().'_GPA1'); + $rela_fact->setTag('_' . $fact->getTag() . '_GPA1'); $facts[] = $rela_fact; break; case 3: // Convert the event to a close relatives event $rela_fact = clone($fact); - $rela_fact->setTag('_'.$fact->getTag().'_GPA2'); + $rela_fact->setTag('_' . $fact->getTag() . '_GPA2'); $facts[] = $rela_fact; break; } @@ -461,7 +461,7 @@ class personal_facts_WT_Module extends WT_Module implements WT_Module_Tab { $fact = new WT_Fact($hist, $person, 'histo'); $sdate = $fact->getDate(); - if ($sdate->isOK() && WT_Date::Compare($birt_date, $sdate)<=0 && WT_Date::Compare($sdate, $deat_date)<=0) { + if ($sdate->isOK() && WT_Date::Compare($birt_date, $sdate) <= 0 && WT_Date::Compare($sdate, $deat_date) <= 0) { $facts[] = $fact; } } @@ -481,7 +481,7 @@ class personal_facts_WT_Module extends WT_Module implements WT_Module_Tab { private static function associateFacts(WT_Individual $person) { $facts = array(); - $associates=array_merge( + $associates = array_merge( $person->linkedIndividuals('ASSO'), $person->linkedIndividuals('_ASSO'), $person->linkedFamilies('ASSO'), @@ -495,21 +495,21 @@ class personal_facts_WT_Module extends WT_Module implements WT_Module_Tab { } if ($arec && trim($arec, '@') === $person->getXref()) { // Extract the important details from the fact - $factrec='1 '.$fact->getTag(); + $factrec = '1 ' . $fact->getTag(); if (preg_match('/\n2 DATE .*/', $fact->getGedcom(), $match)) { - $factrec.=$match[0]; + $factrec .= $match[0]; } if (preg_match('/\n2 PLAC .*/', $fact->getGedcom(), $match)) { - $factrec.=$match[0]; + $factrec .= $match[0]; } if ($associate instanceof WT_Family) { foreach ($associate->getSpouses() as $spouse) { - $factrec.="\n2 _ASSO @".$spouse->getXref().'@'; + $factrec .= "\n2 _ASSO @" . $spouse->getXref() . '@'; } } else { - $factrec.="\n2 _ASSO @".$associate->getXref().'@'; + $factrec .= "\n2 _ASSO @" . $associate->getXref() . '@'; // CHR/BAPM events are commonly used. Generate the reverse relationship - if (preg_match('/^(?:BAPM|CHR)$/', $fact->getTag()) && preg_match('/2 _?ASSO @('.$person->getXref().')@\n3 RELA god(?:parent|mother|father)/', $fact->getGedcom())) { + if (preg_match('/^(?:BAPM|CHR)$/', $fact->getTag()) && preg_match('/2 _?ASSO @(' . $person->getXref() . ')@\n3 RELA god(?:parent|mother|father)/', $fact->getGedcom())) { switch ($associate->getSex()) { case 'M': $factrec .= "\n3 RELA godson"; diff --git a/modules_v3/random_media/module.php b/modules_v3/random_media/module.php index e71eb686a4..853f29f0ac 100644 --- a/modules_v3/random_media/module.php +++ b/modules_v3/random_media/module.php @@ -37,70 +37,70 @@ class random_media_WT_Module extends WT_Module implements WT_Module_Block { } /** {@inheritdoc} */ - public function getBlock($block_id, $template=true, $cfg=null) { + public function getBlock($block_id, $template = true, $cfg = null) { global $ctype; - $filter =get_block_setting($block_id, 'filter', 'all'); - $controls=get_block_setting($block_id, 'controls', true); - $start =get_block_setting($block_id, 'start', false) || WT_Filter::getBool('start'); - $block =get_block_setting($block_id, 'block', true); + $filter = get_block_setting($block_id, 'filter', 'all'); + $controls = get_block_setting($block_id, 'controls', true); + $start = get_block_setting($block_id, 'start', false) || WT_Filter::getBool('start'); + $block = get_block_setting($block_id, 'block', true); // We can apply the filters using SQL // Do not use "ORDER BY RAND()" - it is very slow on large tables. Use PHP::array_rand() instead. - $all_media=WT_DB::prepare( + $all_media = WT_DB::prepare( "SELECT m_id FROM `##media`" . " WHERE m_file = ?" . " AND m_ext IN (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, '')" . " AND m_type IN (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, '')" )->execute(array( WT_GED_ID, - get_block_setting($block_id, 'filter_avi', false) ? 'avi' : NULL, - get_block_setting($block_id, 'filter_bmp', true ) ? 'bmp' : NULL, - get_block_setting($block_id, 'filter_gif', true ) ? 'gif' : NULL, - get_block_setting($block_id, 'filter_jpeg', true ) ? 'jpg' : NULL, - get_block_setting($block_id, 'filter_jpeg', true ) ? 'jpeg' : NULL, - get_block_setting($block_id, 'filter_mp3', false) ? 'mp3' : NULL, - get_block_setting($block_id, 'filter_ole', true ) ? 'ole' : NULL, - get_block_setting($block_id, 'filter_pcx', true ) ? 'pcx' : NULL, - get_block_setting($block_id, 'filter_pdf', false) ? 'pdf' : NULL, - get_block_setting($block_id, 'filter_png', true ) ? 'png' : NULL, - get_block_setting($block_id, 'filter_tiff', true ) ? 'tiff' : NULL, - get_block_setting($block_id, 'filter_wav', false) ? 'wav' : NULL, - get_block_setting($block_id, 'filter_audio', false) ? 'audio' : NULL, - get_block_setting($block_id, 'filter_book', true ) ? 'book' : NULL, - get_block_setting($block_id, 'filter_card', true ) ? 'card' : NULL, - get_block_setting($block_id, 'filter_certificate', true ) ? 'certificate' : NULL, - get_block_setting($block_id, 'filter_coat', true ) ? 'coat' : NULL, - get_block_setting($block_id, 'filter_document', true ) ? 'document' : NULL, - get_block_setting($block_id, 'filter_electronic', true ) ? 'electronic' : NULL, - get_block_setting($block_id, 'filter_fiche', true ) ? 'fiche' : NULL, - get_block_setting($block_id, 'filter_film', true ) ? 'film' : NULL, - get_block_setting($block_id, 'filter_magazine', true ) ? 'magazine' : NULL, - get_block_setting($block_id, 'filter_manuscript', true ) ? 'manuscript' : NULL, - get_block_setting($block_id, 'filter_map', true ) ? 'map' : NULL, - get_block_setting($block_id, 'filter_newspaper', true ) ? 'newspaper' : NULL, - get_block_setting($block_id, 'filter_other', true ) ? 'other' : NULL, - get_block_setting($block_id, 'filter_painting', true ) ? 'painting' : NULL, - get_block_setting($block_id, 'filter_photo', true ) ? 'photo' : NULL, - get_block_setting($block_id, 'filter_tombstone', true ) ? 'tombstone' : NULL, - get_block_setting($block_id, 'filter_video', false) ? 'video' : NULL, + get_block_setting($block_id, 'filter_avi', false) ? 'avi' : NULL, + get_block_setting($block_id, 'filter_bmp', true) ? 'bmp' : NULL, + get_block_setting($block_id, 'filter_gif', true) ? 'gif' : NULL, + get_block_setting($block_id, 'filter_jpeg', true) ? 'jpg' : NULL, + get_block_setting($block_id, 'filter_jpeg', true) ? 'jpeg' : NULL, + get_block_setting($block_id, 'filter_mp3', false) ? 'mp3' : NULL, + get_block_setting($block_id, 'filter_ole', true) ? 'ole' : NULL, + get_block_setting($block_id, 'filter_pcx', true) ? 'pcx' : NULL, + get_block_setting($block_id, 'filter_pdf', false) ? 'pdf' : NULL, + get_block_setting($block_id, 'filter_png', true) ? 'png' : NULL, + get_block_setting($block_id, 'filter_tiff', true) ? 'tiff' : NULL, + get_block_setting($block_id, 'filter_wav', false) ? 'wav' : NULL, + get_block_setting($block_id, 'filter_audio', false) ? 'audio' : NULL, + get_block_setting($block_id, 'filter_book', true) ? 'book' : NULL, + get_block_setting($block_id, 'filter_card', true) ? 'card' : NULL, + get_block_setting($block_id, 'filter_certificate', true) ? 'certificate' : NULL, + get_block_setting($block_id, 'filter_coat', true) ? 'coat' : NULL, + get_block_setting($block_id, 'filter_document', true) ? 'document' : NULL, + get_block_setting($block_id, 'filter_electronic', true) ? 'electronic' : NULL, + get_block_setting($block_id, 'filter_fiche', true) ? 'fiche' : NULL, + get_block_setting($block_id, 'filter_film', true) ? 'film' : NULL, + get_block_setting($block_id, 'filter_magazine', true) ? 'magazine' : NULL, + get_block_setting($block_id, 'filter_manuscript', true) ? 'manuscript' : NULL, + get_block_setting($block_id, 'filter_map', true) ? 'map' : NULL, + get_block_setting($block_id, 'filter_newspaper', true) ? 'newspaper' : NULL, + get_block_setting($block_id, 'filter_other', true) ? 'other' : NULL, + get_block_setting($block_id, 'filter_painting', true) ? 'painting' : NULL, + get_block_setting($block_id, 'filter_photo', true) ? 'photo' : NULL, + get_block_setting($block_id, 'filter_tombstone', true) ? 'tombstone' : NULL, + get_block_setting($block_id, 'filter_video', false) ? 'video' : NULL, ))->fetchOneColumn(); // Keep looking through the media until a suitable one is found. - $random_media=null; + $random_media = null; while ($all_media) { - $n=array_rand($all_media); - $media=WT_Media::getInstance($all_media[$n]); + $n = array_rand($all_media); + $media = WT_Media::getInstance($all_media[$n]); if ($media->canShow() && !$media->isExternal()) { // Check if it is linked to a suitable individual foreach ($media->linkedIndividuals('OBJE') as $indi) { if ( $filter === 'all' || - $filter === 'indi' && strpos($indi->getGedcom(), "\n1 OBJE @" . $media->getXref() . '@') !==false || - $filter === 'event' && strpos($indi->getGedcom(), "\n2 OBJE @" . $media->getXref() . '@') !==false + $filter === 'indi' && strpos($indi->getGedcom(), "\n1 OBJE @" . $media->getXref() . '@') !== false || + $filter === 'event' && strpos($indi->getGedcom(), "\n2 OBJE @" . $media->getXref() . '@') !== false ) { // Found one :-) - $random_media=$media; + $random_media = $media; break 2; } } @@ -108,14 +108,14 @@ class random_media_WT_Module extends WT_Module implements WT_Module_Block { unset($all_media[$n]); }; - $id=$this->getName().$block_id; - $class=$this->getName().'_block'; + $id = $this->getName() . $block_id; + $class = $this->getName() . '_block'; if ($ctype === 'gedcom' && WT_USER_GEDCOM_ADMIN || $ctype === 'user' && Auth::check()) { - $title='<i class="icon-admin" title="'.WT_I18N::translate('Configure').'" onclick="modalDialog(\'block_edit.php?block_id='.$block_id.'\', \''.$this->getTitle().'\');"></i>'; + $title = '<i class="icon-admin" title="' . WT_I18N::translate('Configure') . '" onclick="modalDialog(\'block_edit.php?block_id=' . $block_id . '\', \'' . $this->getTitle() . '\');"></i>'; } else { - $title=''; + $title = ''; } - $title.=$this->getTitle(); + $title .= $this->getTitle(); if ($random_media) { $content = "<div id=\"random_picture_container$block_id\">"; @@ -125,9 +125,9 @@ class random_media_WT_Module extends WT_Module implements WT_Module_Block { } else { $icon_class = 'icon-media-play'; } - $content .= '<div dir="ltr" class="center" id="random_picture_controls' . $block_id .'"><br>'; - $content .= "<a href=\"#\" onclick=\"togglePlay(); return false;\" id=\"play_stop\" class=\"".$icon_class."\" title=\"".WT_I18N::translate('Play')."/".WT_I18N::translate('Stop').'"></a>'; - $content .= '<a href="#" onclick="jQuery(\'#block_'.$block_id.'\').load(\'index.php?ctype='.$ctype.'&action=ajax&block_id='.$block_id.'\');return false;" title="'.WT_I18N::translate('Next image').'" class="icon-media-next"></a>'; + $content .= '<div dir="ltr" class="center" id="random_picture_controls' . $block_id . '"><br>'; + $content .= "<a href=\"#\" onclick=\"togglePlay(); return false;\" id=\"play_stop\" class=\"" . $icon_class . "\" title=\"" . WT_I18N::translate('Play') . "/" . WT_I18N::translate('Stop') . '"></a>'; + $content .= '<a href="#" onclick="jQuery(\'#block_' . $block_id . '\').load(\'index.php?ctype=' . $ctype . '&action=ajax&block_id=' . $block_id . '\');return false;" title="' . WT_I18N::translate('Next image') . '" class="icon-media-next"></a>'; $content .= '</div><script> var play = false; function togglePlay() { @@ -149,7 +149,7 @@ class random_media_WT_Module extends WT_Module implements WT_Module_Block { } function reload_image() { if (play) { - jQuery("#block_'.$block_id.'").load("index.php?ctype='.$ctype.'&action=ajax&block_id='.$block_id.'&start=1"); + jQuery("#block_'.$block_id . '").load("index.php?ctype=' . $ctype . '&action=ajax&block_id=' . $block_id . '&start=1"); } } </script>'; @@ -157,7 +157,7 @@ class random_media_WT_Module extends WT_Module implements WT_Module_Block { if ($start) { $content .= '<script>togglePlay();</script>'; } - $content .= '<div class="center" id="random_picture_content'.$block_id.'">'; + $content .= '<div class="center" id="random_picture_content' . $block_id . '">'; $content .= '<table id="random_picture_box"><tr><td'; if ($block) { @@ -173,15 +173,15 @@ class random_media_WT_Module extends WT_Module implements WT_Module_Block { } else { $content .= '</td><td class="details2">'; } - $content .= '<a href="'.$random_media->getHtmlUrl().'"><b>'. $random_media->getFullName() .'</b></a><br>'; + $content .= '<a href="' . $random_media->getHtmlUrl() . '"><b>' . $random_media->getFullName() . '</b></a><br>'; foreach ($random_media->linkedIndividuals('OBJE') as $individual) { - $content .= '<a href="' . $individual->getHtmlUrl() . '">' . WT_I18N::translate('View person') . ' — ' . $individual->getFullname().'</a><br>'; + $content .= '<a href="' . $individual->getHtmlUrl() . '">' . WT_I18N::translate('View person') . ' — ' . $individual->getFullname() . '</a><br>'; } foreach ($random_media->linkedFamilies('OBJE') as $family) { - $content .= '<a href="' . $family->getHtmlUrl() . '">' . WT_I18N::translate('View family') . ' — ' . $family->getFullname().'</a><br>'; + $content .= '<a href="' . $family->getHtmlUrl() . '">' . WT_I18N::translate('View family') . ' — ' . $family->getFullname() . '</a><br>'; } foreach ($random_media->linkedSources('OBJE') as $source) { - $content .= '<a href="' . $source->getHtmlUrl() . '">' . WT_I18N::translate('View source') . ' — ' . $source->getFullname().'</a><br>'; + $content .= '<a href="' . $source->getHtmlUrl() . '">' . WT_I18N::translate('View source') . ' — ' . $source->getFullname() . '</a><br>'; } $content .= '<br><div class="indent">'; $content .= print_fact_notes($random_media->getGedcom(), "1", false); @@ -217,51 +217,51 @@ class random_media_WT_Module extends WT_Module implements WT_Module_Block { /** {@inheritdoc} */ public function configureBlock($block_id) { if (WT_Filter::postBool('save') && WT_Filter::checkCsrf()) { - set_block_setting($block_id, 'filter', WT_Filter::post('filter', 'indi|event|all', 'all')); - set_block_setting($block_id, 'controls', WT_Filter::postBool('controls')); - set_block_setting($block_id, 'start', WT_Filter::postBool('start')); - set_block_setting($block_id, 'filter_avi', WT_Filter::postBool('filter_avi')); - set_block_setting($block_id, 'filter_bmp', WT_Filter::postBool('filter_bmp')); - set_block_setting($block_id, 'filter_gif', WT_Filter::postBool('filter_gif')); - set_block_setting($block_id, 'filter_jpeg', WT_Filter::postBool('filter_jpeg')); - set_block_setting($block_id, 'filter_mp3', WT_Filter::postBool('filter_mp3')); - set_block_setting($block_id, 'filter_ole', WT_Filter::postBool('filter_ole')); - set_block_setting($block_id, 'filter_pcx', WT_Filter::postBool('filter_pcx')); - set_block_setting($block_id, 'filter_pdf', WT_Filter::postBool('filter_pdf')); - set_block_setting($block_id, 'filter_png', WT_Filter::postBool('filter_png')); - set_block_setting($block_id, 'filter_tiff', WT_Filter::postBool('filter_tiff')); - set_block_setting($block_id, 'filter_wav', WT_Filter::postBool('filter_wav')); - set_block_setting($block_id, 'filter_audio', WT_Filter::postBool('filter_audio')); - set_block_setting($block_id, 'filter_book', WT_Filter::postBool('filter_book')); - set_block_setting($block_id, 'filter_card', WT_Filter::postBool('filter_card')); + set_block_setting($block_id, 'filter', WT_Filter::post('filter', 'indi|event|all', 'all')); + set_block_setting($block_id, 'controls', WT_Filter::postBool('controls')); + set_block_setting($block_id, 'start', WT_Filter::postBool('start')); + set_block_setting($block_id, 'filter_avi', WT_Filter::postBool('filter_avi')); + set_block_setting($block_id, 'filter_bmp', WT_Filter::postBool('filter_bmp')); + set_block_setting($block_id, 'filter_gif', WT_Filter::postBool('filter_gif')); + set_block_setting($block_id, 'filter_jpeg', WT_Filter::postBool('filter_jpeg')); + set_block_setting($block_id, 'filter_mp3', WT_Filter::postBool('filter_mp3')); + set_block_setting($block_id, 'filter_ole', WT_Filter::postBool('filter_ole')); + set_block_setting($block_id, 'filter_pcx', WT_Filter::postBool('filter_pcx')); + set_block_setting($block_id, 'filter_pdf', WT_Filter::postBool('filter_pdf')); + set_block_setting($block_id, 'filter_png', WT_Filter::postBool('filter_png')); + set_block_setting($block_id, 'filter_tiff', WT_Filter::postBool('filter_tiff')); + set_block_setting($block_id, 'filter_wav', WT_Filter::postBool('filter_wav')); + set_block_setting($block_id, 'filter_audio', WT_Filter::postBool('filter_audio')); + set_block_setting($block_id, 'filter_book', WT_Filter::postBool('filter_book')); + set_block_setting($block_id, 'filter_card', WT_Filter::postBool('filter_card')); set_block_setting($block_id, 'filter_certificate', WT_Filter::postBool('filter_certificate')); - set_block_setting($block_id, 'filter_coat', WT_Filter::postBool('filter_coat')); - set_block_setting($block_id, 'filter_document', WT_Filter::postBool('filter_document')); - set_block_setting($block_id, 'filter_electronic', WT_Filter::postBool('filter_electronic')); - set_block_setting($block_id, 'filter_fiche', WT_Filter::postBool('filter_fiche')); - set_block_setting($block_id, 'filter_film', WT_Filter::postBool('filter_film')); - set_block_setting($block_id, 'filter_magazine', WT_Filter::postBool('filter_magazine')); - set_block_setting($block_id, 'filter_manuscript', WT_Filter::postBool('filter_manuscript')); - set_block_setting($block_id, 'filter_map', WT_Filter::postBool('filter_map')); - set_block_setting($block_id, 'filter_newspaper', WT_Filter::postBool('filter_newspaper')); - set_block_setting($block_id, 'filter_other', WT_Filter::postBool('filter_other')); - set_block_setting($block_id, 'filter_painting', WT_Filter::postBool('filter_painting')); - set_block_setting($block_id, 'filter_photo', WT_Filter::postBool('filter_photo')); - set_block_setting($block_id, 'filter_tombstone', WT_Filter::postBool('filter_tombstone')); - set_block_setting($block_id, 'filter_video', WT_Filter::postBool('filter_video')); + set_block_setting($block_id, 'filter_coat', WT_Filter::postBool('filter_coat')); + set_block_setting($block_id, 'filter_document', WT_Filter::postBool('filter_document')); + set_block_setting($block_id, 'filter_electronic', WT_Filter::postBool('filter_electronic')); + set_block_setting($block_id, 'filter_fiche', WT_Filter::postBool('filter_fiche')); + set_block_setting($block_id, 'filter_film', WT_Filter::postBool('filter_film')); + set_block_setting($block_id, 'filter_magazine', WT_Filter::postBool('filter_magazine')); + set_block_setting($block_id, 'filter_manuscript', WT_Filter::postBool('filter_manuscript')); + set_block_setting($block_id, 'filter_map', WT_Filter::postBool('filter_map')); + set_block_setting($block_id, 'filter_newspaper', WT_Filter::postBool('filter_newspaper')); + set_block_setting($block_id, 'filter_other', WT_Filter::postBool('filter_other')); + set_block_setting($block_id, 'filter_painting', WT_Filter::postBool('filter_painting')); + set_block_setting($block_id, 'filter_photo', WT_Filter::postBool('filter_photo')); + set_block_setting($block_id, 'filter_tombstone', WT_Filter::postBool('filter_tombstone')); + set_block_setting($block_id, 'filter_video', WT_Filter::postBool('filter_video')); exit; } - require_once WT_ROOT.'includes/functions/functions_edit.php'; + require_once WT_ROOT . 'includes/functions/functions_edit.php'; - $filter=get_block_setting($block_id, 'filter', 'all'); + $filter = get_block_setting($block_id, 'filter', 'all'); echo '<tr><td class="descriptionbox wrap width33">'; echo WT_I18N::translate('Show only individuals, events, or all?'); echo '</td><td class="optionbox">'; echo select_edit_control('filter', array('indi'=>WT_I18N::translate('Individuals'), 'event'=>WT_I18N::translate('Facts and events'), 'all'=>WT_I18N::translate('All')), null, $filter, ''); echo '</td></tr>'; - $filters=array( + $filters = array( 'avi' =>get_block_setting($block_id, 'filter_avi', false), 'bmp' =>get_block_setting($block_id, 'filter_bmp', true), 'gif' =>get_block_setting($block_id, 'filter_gif', true), @@ -357,9 +357,9 @@ class random_media_WT_Module extends WT_Module implements WT_Module_Block { $i = 1; echo "</tr><tr>"; } - echo "<td class=\"width33\"><input type=\"checkbox\" value=\"yes\" name=\"filter_".$typeName."\""; + echo "<td class=\"width33\"><input type=\"checkbox\" value=\"yes\" name=\"filter_" . $typeName . "\""; if ($filters[$typeName]) echo " checked=\"checked\""; - echo "> ".$typeValue." </td>"; + echo "> " . $typeValue . " </td>"; } ?> </tr> @@ -369,14 +369,14 @@ class random_media_WT_Module extends WT_Module implements WT_Module_Block { <?php - $controls=get_block_setting($block_id, 'controls', true); + $controls = get_block_setting($block_id, 'controls', true); echo '<tr><td class="descriptionbox wrap width33">'; echo WT_I18N::translate('Show slide show controls?'); echo '</td><td class="optionbox">'; echo edit_field_yes_no('controls', $controls); echo '</td></tr>'; - $start=get_block_setting($block_id, 'start', false); + $start = get_block_setting($block_id, 'start', false); echo '<tr><td class="descriptionbox wrap width33">'; echo WT_I18N::translate('Start slide show on page load?'); echo '</td><td class="optionbox">'; |
