summaryrefslogtreecommitdiff
path: root/includes/functions/functions_print_lists.php
diff options
context:
space:
mode:
authorNigel Osborne <kiwi3685@me.com>2010-07-05 06:38:54 +0000
committerNigel Osborne <kiwi3685@me.com>2010-07-05 06:38:54 +0000
commit1382e09859ca516124d3b6e78ceaebedd3621a27 (patch)
tree201a041fc5e38b4cd4880e68dc2bf2b9f6908866 /includes/functions/functions_print_lists.php
parentfc3c871f6d773c2399e2f63fa351e3e1774c70f4 (diff)
downloadwebtrees-1382e09859ca516124d3b6e78ceaebedd3621a27.tar.gz
webtrees-1382e09859ca516124d3b6e78ceaebedd3621a27.tar.bz2
webtrees-1382e09859ca516124d3b6e78ceaebedd3621a27.zip
Add a simple tabulated list format for the INDI list page
Diffstat (limited to 'includes/functions/functions_print_lists.php')
-rw-r--r--includes/functions/functions_print_lists.php27
1 files changed, 25 insertions, 2 deletions
diff --git a/includes/functions/functions_print_lists.php b/includes/functions/functions_print_lists.php
index 87c8ce7845..aa9a226717 100644
--- a/includes/functions/functions_print_lists.php
+++ b/includes/functions/functions_print_lists.php
@@ -1234,7 +1234,7 @@ function format_surname_tagcloud($surnames, $type, $totals) {
'options'=>array(
'htmlTags'=>array(),
'fontSizeUnit'=>'%',
- 'minFontSize'=>50,
+ 'minFontSize'=>80,
'maxFontSize'=>250
)
),
@@ -1268,7 +1268,7 @@ function format_surname_tagcloud($surnames, $type, $totals) {
// Print a list of surnames.
// @param $surnames array (of SURN, of array of SPFX_SURN, of array of PID)
-// @param $style, 1=bullet list, 2=semicolon-separated list
+// @param $style, 1=bullet list, 2=semicolon-separated list, 3=tabulated list with up to 4 columns
// @param $totals, boolean, show totals after each name
function format_surname_list($surnames, $style, $totals) {
global $TEXT_DIRECTION, $GEDCOM;
@@ -1311,6 +1311,29 @@ function format_surname_list($surnames, $style, $totals) {
return '<ul><li>'.implode('</li><li>', $html).'</li></ul>';
case 2:
return implode('; ', $html);
+ case 3:
+ $i = 0;
+ $count = count($html);
+ $count_indi = 0;
+ $col = 1;
+ if ($count>36) $col=4;
+ else if ($count>18) $col=3;
+ else if ($count>6) $col=2;
+ $newcol=ceil($count/$col);
+ $html2 ='<table class="list_table"><tr>';
+ $html2.='<td class="list_value" style="padding: 14px;">';
+
+ foreach ($html as $surn=>$surns) {
+ $html2.= $surns.'<br />';
+ $i++;
+ if ($i==$newcol && $i<$count) {
+ $html2.='</td><td class="list_value" style="padding: 14px;">';
+ $newcol=$i+ceil($count/$col);
+ }
+ }
+ $html2.='</td></tr></table>';
+
+ return $html2;
}
}