summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--includes/functions/functions_print_lists.php67
-rw-r--r--library/WT/Controller/Search.php16
-rw-r--r--mediaviewer.php2
-rw-r--r--notelist.php4
-rw-r--r--source.php2
5 files changed, 45 insertions, 46 deletions
diff --git a/includes/functions/functions_print_lists.php b/includes/functions/functions_print_lists.php
index 9da21d3a07..a68a91a419 100644
--- a/includes/functions/functions_print_lists.php
+++ b/includes/functions/functions_print_lists.php
@@ -1030,7 +1030,7 @@ function format_sour_table($datalist) {
}
//-- Delete
if (WT_USER_GEDCOM_ADMIN) {
- $html .= '<td><div title="'. WT_I18N::translate('Delete'). '" class="deleteicon" onclick="if (confirm(\''. addslashes(WT_I18N::translate('Are you sure you want to delete “%s”?'. strip_tags($source->getFullName()))). '\')) jQuery.post(\'action.php\'.{action:\'delete-source\'.xref:\''. $source->getXref(). '\'},function(){location.reload();})"><span class="link_text">'. WT_I18N::translate('Delete'). '</span></div></td>';
+ $html .= '<td><div title="'. WT_I18N::translate('Delete'). '" class="deleteicon" onclick="if (confirm(\''. addslashes(WT_I18N::translate('Are you sure you want to delete “%s”?', strip_tags($source->getFullName()))). '\')) jQuery.post(\'action.php\'.{action:\'delete-source\'.xref:\''. $source->getXref(). '\'},function(){location.reload();})"><span class="link_text">'. WT_I18N::translate('Delete'). '</span></div></td>';
} else {
$html .= '<td>&nbsp;</td>';
}
@@ -1042,9 +1042,9 @@ function format_sour_table($datalist) {
}
// print a table of shared notes
-function print_note_table($datalist) {
+function format_note_table($datalist) {
global $SHOW_LAST_CHANGE, $WT_IMAGES, $controller;
-
+ $html = '';
$table_id = 'ID'.floor(microtime()*1000000); // lists requires a unique ID in case there are multiple lists per page
$controller
->addExternalJavaScript(WT_STATIC_URL.'js/jquery/jquery.dataTables.min.js')
@@ -1078,61 +1078,60 @@ function print_note_table($datalist) {
');
//--table wrapper
- echo '<div class="loading-image">&nbsp;</div>';
- echo '<div class="note-list">';
+ $html .= '<div class="loading-image">&nbsp;</div>';
+ $html .= '<div class="note-list">';
//-- table header
- echo '<table id="', $table_id, '"><thead><tr>';
- echo '<th>', WT_Gedcom_Tag::getLabel('TITL'), '</th>';
- echo '<th>', WT_I18N::translate('Individuals'), '</th>';
- echo '<th>#INDI</th>';
- echo '<th>', WT_I18N::translate('Families'), '</th>';
- echo '<th>#FAM</th>';
- echo '<th>', WT_I18N::translate('Media objects'), '</th>';
- echo '<th>#OBJE</th>';
- echo '<th>', WT_I18N::translate('Sources'), '</th>';
- echo '<th>#SOUR</th>';
- echo '<th>', WT_Gedcom_Tag::getLabel('CHAN'), '</th>';
- echo '<th>&nbsp;</th>';//delete
- echo '</tr></thead>';
+ $html .= '<table id="'. $table_id. '"><thead><tr>';
+ $html .= '<th>'. WT_Gedcom_Tag::getLabel('TITL'). '</th>';
+ $html .= '<th>'. WT_I18N::translate('Individuals'). '</th>';
+ $html .= '<th>#INDI</th>';
+ $html .= '<th>'. WT_I18N::translate('Families'). '</th>';
+ $html .= '<th>#FAM</th>';
+ $html .= '<th>'. WT_I18N::translate('Media objects'). '</th>';
+ $html .= '<th>#OBJE</th>';
+ $html .= '<th>'. WT_I18N::translate('Sources'). '</th>';
+ $html .= '<th>#SOUR</th>';
+ $html .= '<th>'. WT_Gedcom_Tag::getLabel('CHAN'). '</th>';
+ $html .= '<th>&nbsp;</th>';//delete
+ $html .= '</tr></thead>';
//-- table body
- echo '<tbody>';
+ $html .= '<tbody>';
foreach ($datalist as $note) {
if (!$note->canDisplayDetails()) {
continue;
}
- echo '<tr>';
+ $html .= '<tr>';
//-- Shared Note name
- echo '<td><a class="name2" href="', $note->getHtmlUrl(), '">', highlight_search_hits($note->getFullName()), '</a></td>';
+ $html .= '<td><a class="name2" href="'. $note->getHtmlUrl(). '">'. highlight_search_hits($note->getFullName()). '</a></td>';
//-- Linked INDIs
$num=$note->countLinkedIndividuals();
- echo '<td>', WT_I18N::number($num), '</td><td>', $num, '</td>';
+ $html .= '<td>'. WT_I18N::number($num). '</td><td>'. $num. '</td>';
//-- Linked FAMs
$num=$note->countLinkedfamilies();
- echo '<td>', WT_I18N::number($num), '</td><td>', $num, '</td>';
+ $html .= '<td>'. WT_I18N::number($num). '</td><td>'. $num. '</td>';
//-- Linked OBJEcts
$num=$note->countLinkedMedia();
- echo '<td>', WT_I18N::number($num), '</td><td>', $num, '</td>';
+ $html .= '<td>'. WT_I18N::number($num). '</td><td>'. $num. '</td>';
//-- Linked SOURs
$num=$note->countLinkedSources();
- echo '<td>', WT_I18N::number($num), '</td><td>', $num, '</td>';
+ $html .= '<td>'. WT_I18N::number($num). '</td><td>'. $num. '</td>';
//-- Last change
if ($SHOW_LAST_CHANGE) {
- echo '<td>', $note->LastChangeTimestamp(empty($SEARCH_SPIDER)), '</td>';
+ $html .= '<td>'. $note->LastChangeTimestamp(empty($SEARCH_SPIDER)). '</td>';
} else {
- echo '<td></td>';
+ $html .= '<td></td>';
}
//-- Delete
if (WT_USER_GEDCOM_ADMIN) {
- echo '<td><div title="', WT_I18N::translate('Delete'), '" class="deleteicon" onclick="if (confirm(\'', addslashes(WT_I18N::translate('Are you sure you want to delete “%s”?', strip_tags($note->getFullName()))), '\')) jQuery.post(\'action.php\',{action:\'delete-note\',xref:\'', $note->getXref(), '\'},function(){location.reload();})"><span class="link_text">', WT_I18N::translate('Delete'), '</span></div></td>';
+ $html .= '<td><div title="'. WT_I18N::translate('Delete'). '" class="deleteicon" onclick="if (confirm(\''. addslashes(WT_I18N::translate('Are you sure you want to delete “%s”?'. strip_tags($note->getFullName()))). '\')) jQuery.post(\'action.php\'.{action:\'delete-note\'.xref:\''. $note->getXref(). '\'},function(){location.reload();})"><span class="link_text">'. WT_I18N::translate('Delete'). '</span></div></td>';
} else {
- echo '<td></td>';
+ $html .= '<td></td>';
}
- echo '</tr>';
+ $html .= '</tr>';
}
- echo
- '</tbody>',
- '</table>',
- '</div>';
+ $html .= '</tbody></table></div>';
+
+ return $html;
}
// print a table of repositories
diff --git a/library/WT/Controller/Search.php b/library/WT/Controller/Search.php
index b9f13c9aa1..86ed88deba 100644
--- a/library/WT/Controller/Search.php
+++ b/library/WT/Controller/Search.php
@@ -632,8 +632,8 @@ class WT_Controller_Search extends WT_Controller_Base {
$GEDCOM=$gedcom;
load_gedcom_settings($ged_id);
echo '<h3 class="indi-acc-header"><a href="#"><span class="search_item">'.$this->myquery.'</span>&nbsp;@&nbsp;'.PrintReady(get_gedcom_setting($ged_id, 'title')), '</a></h3>
- <div class="indi-acc_content">';
- echo format_indi_table($datalist);
+ <div class="indi-acc_content">',
+ format_indi_table($datalist);
echo '</div>';//indi-acc_content
}
}
@@ -656,8 +656,8 @@ class WT_Controller_Search extends WT_Controller_Base {
$GEDCOM=$gedcom;
load_gedcom_settings($ged_id);
echo '<h3 class="fam-acc-header"><a href="#"><span class="search_item">'.$this->myquery.'</span>&nbsp;@&nbsp;'.PrintReady(get_gedcom_setting($ged_id, 'title')), '</a></h3>
- <div class="fam-acc_content">';
- echo format_fam_table($datalist);
+ <div class="fam-acc_content">',
+ format_fam_table($datalist);
echo '</div>';//fam-acc_content
}
}
@@ -680,8 +680,8 @@ class WT_Controller_Search extends WT_Controller_Base {
$GEDCOM=$gedcom;
load_gedcom_settings($ged_id);
echo '<h3 class="source-acc-header"><a href="#"><span class="search_item">'.$this->myquery.'</span>&nbsp;@&nbsp;'.PrintReady(get_gedcom_setting($ged_id, 'title')), '</a></h3>
- <div class="source-acc_content">';
- echo format_sour_table($datalist);
+ <div class="source-acc_content">',
+ format_sour_table($datalist);
echo '</div>';//fam-acc_content
}
}
@@ -704,8 +704,8 @@ class WT_Controller_Search extends WT_Controller_Base {
$GEDCOM=$gedcom;
load_gedcom_settings($ged_id);
echo '<h3 class="note-acc-header"><a href="#"><span class="search_item">'.$this->myquery.'</span>&nbsp;@&nbsp;'.PrintReady(get_gedcom_setting($ged_id, 'title')), '</a></h3>
- <div class="note-acc_content">';
- print_note_table($datalist);
+ <div class="note-acc_content">',
+ format_note_table($datalist);
echo '</div>';//note-acc_content
}
}
diff --git a/mediaviewer.php b/mediaviewer.php
index df45abdda8..5291d03af1 100644
--- a/mediaviewer.php
+++ b/mediaviewer.php
@@ -179,7 +179,7 @@ echo '<div id="media-tabs">';
// medias linked to this media object
if ($controller->record->countLinkedNotes()) {
echo '<div id="notes-media">';
- print_note_table($controller->record->fetchLinkedNotes(), $controller->record->getFullName());
+ echo format_note_table($controller->record->fetchLinkedNotes(), $controller->record->getFullName());
echo '</div>'; //close "notes-media"
}
echo '</div>'; //close div "media-tabs"
diff --git a/notelist.php b/notelist.php
index 089d240e00..4bb5c7bc00 100644
--- a/notelist.php
+++ b/notelist.php
@@ -32,6 +32,6 @@ $controller->setPageTitle(WT_I18N::translate('Shared notes'));
$controller->pageHeader();
echo '<div id="note-list-page">',
- '<h2>', WT_I18N::translate('Shared notes'), '</h2>';
- print_note_table(get_note_list(WT_GED_ID));
+ '<h2>', WT_I18N::translate('Shared notes'), '</h2>',
+ format_note_table(get_note_list(WT_GED_ID));
echo '</div>';
diff --git a/source.php b/source.php
index 9557420698..7c57fe4566 100644
--- a/source.php
+++ b/source.php
@@ -160,7 +160,7 @@ echo '<div id="source-tabs">
// Shared Notes linked to this source
if ($controller->record->countLinkedNotes()) {
echo '<div id="note-sources">';
- print_note_table($controller->record->fetchLinkedNotes(), $controller->record->getFullName());
+ echo format_note_table($controller->record->fetchLinkedNotes(), $controller->record->getFullName());
echo '</div>'; //close "note-sources"
}
echo '</div>'; //close div "source-tabs"