summaryrefslogtreecommitdiff
path: root/includes
diff options
context:
space:
mode:
authorGreg Roach <fisharebest@gmail.com>2013-11-03 09:17:16 +0000
committerGreg Roach <fisharebest@gmail.com>2013-11-03 09:17:16 +0000
commitf078f27b517869266bd24d494ffc10c3abc9b686 (patch)
treef160c9196575bd3eebd15d114dc8832864ef2ff1 /includes
parentaba438fbd4a279140a9e95b6d8b4f026974a13d8 (diff)
downloadwebtrees-f078f27b517869266bd24d494ffc10c3abc9b686.tar.gz
webtrees-f078f27b517869266bd24d494ffc10c3abc9b686.tar.bz2
webtrees-f078f27b517869266bd24d494ffc10c3abc9b686.zip
Styling for census-assistant generated tables
Diffstat (limited to 'includes')
-rw-r--r--includes/functions/functions_print.php37
-rw-r--r--includes/functions/functions_print_facts.php3
2 files changed, 22 insertions, 18 deletions
diff --git a/includes/functions/functions_print.php b/includes/functions/functions_print.php
index f3240ba2f4..6a3132213a 100644
--- a/includes/functions/functions_print.php
+++ b/includes/functions/functions_print.php
@@ -403,8 +403,7 @@ function print_note_record($text, $nlevel, $nrec, $textOnly=false) {
if ($note && array_key_exists('GEDFact_assistant', WT_Module::getActiveModules())) {
$text = GEDFact_assistant_WT_Module::formatCensusNote($note);
} else {
- $text = $note->getNote();
- $text = WT_Filter::expandUrls($text);
+ $text = WT_Filter::expandUrls($note->getNote());
}
} else {
$note = null;
@@ -415,12 +414,21 @@ function print_note_record($text, $nlevel, $nrec, $textOnly=false) {
return strip_tags($text);
}
+ if (strpos($text, "\n") !== false) {
+ list($first_line, $cont_lines) = explode("\n", $text, 2);
+ } else {
+ $first_line = $text;
+ $cont_lines = '';
+ }
- $brpos = strpos($text, '<br>');
$data = '<div class="fact_NOTE"><span class="label">';
- if ($brpos !== false) {
- if ($EXPAND_NOTES) $plusminus='minus'; else $plusminus='plus';
- $data .= '<a href="#" onclick="expand_layer(\''.$elementID.'\'); return false;"><i id="'.$elementID.'_img" class="icon-'.$plusminus.'"></i></a> ';
+ if ($cont_lines) {
+ if ($EXPAND_NOTES) {
+ $plusminus='minus';
+ } else {
+ $plusminus='plus';
+ }
+ $data .= '<a href="#" onclick="expand_layer(\'' . $elementID . '\'); return false;"><i id="' . $elementID . '_img" class="icon-' . $plusminus . '"></i></a> ';
}
if ($note) {
@@ -429,26 +437,23 @@ function print_note_record($text, $nlevel, $nrec, $textOnly=false) {
$data .= WT_I18N::translate('Note').': </span>';
}
- if ($brpos !== false) {
- $line1 = substr($text, 0, $brpos);
+ if ($cont_lines) {
if ($note) {
- $line1 = '<a href="' . $note->getHtmlUrl() . '">' . $line1 . '</a>';
+ $first_line = '<a href="' . $note->getHtmlUrl() . '">' . $first_line . '</a>';
}
- $data .= '<span class="field" dir="auto">' . $line1 . '</span>';
+ $data .= '<span class="field" dir="auto">' . $first_line . '</span>';
$data .= '<div id="' . $elementID . '"';
if ($EXPAND_NOTES) {
$data .= ' style="display:block"';
}
- $data .= ' class="note_details" dir="auto">';
- $data .= substr($text, $brpos + 4);
- $data .= '</div>';
+ $data .= ' class="note_details" dir="auto" style="white-space:pre-wrap">' . $cont_lines. '</div>';
} else {
if ($note) {
- $text = '<a href="' . $note->getHtmlUrl() . '">' . $text . '</a>';
+ $text = '<a href="' . $note->getHtmlUrl() . '">' . $first_line . '</a>';
}
- $data .= '<span class="field" dir="auto">'.$text. '</span>';
+ $data .= '<span class="field" dir="auto">' . $first_line . '</span>';
}
- $data .= "</div>";
+ $data .= '</div>';
return $data;
}
diff --git a/includes/functions/functions_print_facts.php b/includes/functions/functions_print_facts.php
index bb5991422f..43a612b145 100644
--- a/includes/functions/functions_print_facts.php
+++ b/includes/functions/functions_print_facts.php
@@ -904,12 +904,11 @@ function print_main_notes(WT_Fact $fact, $level) {
$nid = $nmatch[1];
$note=WT_Note::getInstance($nid);
if ($note) {
- $text = $note->getNote();
// If Census assistant installed, allow it to format the note
if ($fact->getTag()=='CENS' && array_key_exists('GEDFact_assistant', WT_Module::getActiveModules())) {
$text = GEDFact_assistant_WT_Module::formatCensusNote($note);
} else {
- $text = WT_Filter::expandUrls($text);
+ $text = WT_Filter::expandUrls($note->getNote());
}
} else {
$text = '<span class="error">' . WT_Filter::escapeHtml($nid) . '</span>';