summaryrefslogtreecommitdiff
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
parentfc3c871f6d773c2399e2f63fa351e3e1774c70f4 (diff)
downloadwebtrees-1382e09859ca516124d3b6e78ceaebedd3621a27.tar.gz
webtrees-1382e09859ca516124d3b6e78ceaebedd3621a27.tar.bz2
webtrees-1382e09859ca516124d3b6e78ceaebedd3621a27.zip
Add a simple tabulated list format for the INDI list page
-rw-r--r--editconfig_gedcom.php1
-rw-r--r--help_text.php2
-rw-r--r--includes/functions/functions_print_lists.php27
-rw-r--r--indilist.php3
4 files changed, 30 insertions, 3 deletions
diff --git a/editconfig_gedcom.php b/editconfig_gedcom.php
index 92e983fdaf..307a398c18 100644
--- a/editconfig_gedcom.php
+++ b/editconfig_gedcom.php
@@ -1164,6 +1164,7 @@ print_header(i18n::translate('GEDCOM configuration'));
</td>
<td class="optionbox width60">
<select name="NEW_SURNAME_LIST_STYLE" tabindex="<?php echo ++$i; ?>">
+ <option value="style1" <?php if ($SURNAME_LIST_STYLE=="style1") print "selected=\"selected\""; ?>><?php print i18n::translate('list'); ?></option>
<option value="style2" <?php if ($SURNAME_LIST_STYLE=="style2") print "selected=\"selected\""; ?>><?php print i18n::translate('table'); ?></option>
<option value="style3" <?php if ($SURNAME_LIST_STYLE=="style3") print "selected=\"selected\""; ?>><?php print i18n::translate('tag cloud'); ?></option>
</select>
diff --git a/help_text.php b/help_text.php
index 17e39fb2cc..28ea5b3b86 100644
--- a/help_text.php
+++ b/help_text.php
@@ -2718,7 +2718,7 @@ case 'SUBLIST_TRIGGER_I':
case 'SURNAME_LIST_STYLE':
$title=i18n::translate('Surname list style');
- $text=i18n::translate('<p>Lists of surnames, as they appear in the Top 10 Surnames block, the Individual lists, and the Family lists, can be shown in different styles.</p><dl><dt>Table</dt><dd>In this style, the surnames are shown in a table that can be sorted either by surname or by count.</dd><dt>Tag cloud</dt><dd>In this style, the surnames are shown in a list, and the font size used for each name depends on the number of occurrences of that name in the database. The list is not sortable.</dd></dl>');
+ $text=i18n::translate('<p>Lists of surnames, as they appear in the Top 10 Surnames block, the Individual lists, and the Family lists, can be shown in different styles.</p><dl><dt>Table</dt><dd>In this style, the surnames are shown in a table that can be sorted either by surname or by count.</dd><dt>Tag cloud</dt><dd>In this style, the surnames are shown in a list, and the font size used for each name depends on the number of occurrences of that name in the database. The list is not sortable.</dd><dt>List</dt><dd>This is a simple list of names, with a count of each name , in a tabulated format of up to four columns</dd></dl>');
break;
case 'SURNAME_TRADITION':
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;
}
}
diff --git a/indilist.php b/indilist.php
index 67294b6041..74180d53ac 100644
--- a/indilist.php
+++ b/indilist.php
@@ -210,6 +210,9 @@ if ($showList) {
if ($surname_sublist=='yes') {
// Show the surname list
switch ($SURNAME_LIST_STYLE) {
+ case 'style1';
+ echo format_surname_list($surns, 3, true);
+ break;
case 'style3':
echo format_surname_tagcloud($surns, 'indilist', true);
break;