From: Andreas Gohr Date: Mon, 23 Jan 2006 09:27:33 +0000 (+0100) Subject: tagcloud added X-Git-Tag: 0.7.1~100 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=98725dae90d4a672db841c35d8b51e54fafddddd;p=contagged tagcloud added darcs-hash:20060123092733-6e07b-48424c2a174293a7557b27f200358aa23c21e57e.gz --- diff --git a/lang/de.php b/lang/de.php index d32c37f..0e11b9f 100644 --- a/lang/de.php +++ b/lang/de.php @@ -24,6 +24,7 @@ $lang[manager] = 'Key Account'; $lang[anniversary] = 'Geburtstag'; $lang[marker] = 'Tags'; +$lang[tagcloud] = 'Alle verwendeten Tags, alphabetisch sortiert. Häufig verwendete Tags werden größer dargestellt.'; $lang[business] = 'Geschäftlich'; $lang[private] = 'Privat'; diff --git a/lang/en.php b/lang/en.php index 7e87240..369d82d 100644 --- a/lang/en.php +++ b/lang/en.php @@ -24,6 +24,7 @@ $lang[manager] = 'Key Account'; $lang[anniversary] = 'Birthday'; $lang[marker] = 'Tags'; +$lang[tagcloud] = 'All used tags, sorted alphabetically. Frequently used tags are shown bigger.'; $lang[business] = 'Business'; $lang[private] = 'Private'; diff --git a/pix/cog.png b/pix/cog.png new file mode 100644 index 0000000..dba86c9 Binary files /dev/null and b/pix/cog.png differ diff --git a/tags.php b/tags.php new file mode 100644 index 0000000..13b07b2 --- /dev/null +++ b/tags.php @@ -0,0 +1,46 @@ +assign('tagcloud',tag_cloud()); + //display templates + header('Content-Type: text/html; charset=utf-8'); + $smarty->display('header.tpl'); + $smarty->display('list_filter.tpl'); + $smarty->display('tags.tpl'); + $smarty->display('footer.tpl'); + + function tag_cloud(){ + global $conf; + global $LDAP_CON; + if(!$conf[extended]) return; + + $result = ldap_queryabooks('(objectClass=contactPerson)','marker'); + + $max = 0; + $tags = array(); + foreach ($result as $entry){ + if(count($entry['marker'])){ + foreach($entry['marker'] as $marker){ + $marker = strtolower($marker); + $tags[$marker] += 1; + if($tags[$marker] > $max) $max = $tags[$marker]; + } + } + } + ksort($tags); + + $out = ''; + foreach($tags as $tag => $cnt){ + $pct = round($cnt * 20 / $max); // percents from 0 to 20 + + $out .= ''; + $out .= htmlspecialchars($tag).' '; + } + + return $out; + } + +?> diff --git a/templates/list_filter.tpl b/templates/list_filter.tpl index 579659e..ac0dab4 100644 --- a/templates/list_filter.tpl +++ b/templates/list_filter.tpl @@ -41,10 +41,11 @@ {/if} + {if $conf.extended}
- {$lang.marker}: + {$lang.marker}:
diff --git a/templates/orgs.tpl b/templates/orgs.tpl index fcfe45a..4aa3c07 100644 --- a/templates/orgs.tpl +++ b/templates/orgs.tpl @@ -1,8 +1,8 @@ {foreach from=$orgs item=org} -
- + + {$org}
diff --git a/templates/style.css b/templates/style.css index 6dff811..049be11 100644 --- a/templates/style.css +++ b/templates/style.css @@ -132,3 +132,27 @@ div#nedit_editor input { font-family:Lucida,Helvetica,Verdana,Arial,Sans-Serif; font-size: 12px; } + +/* TagCloud */ +a.tc0 { font-size: 80%; } +a.tc1 { font-size: 100%; } +a.tc2 { font-size: 120%; } +a.tc3 { font-size: 130%; } +a.tc4 { font-size: 140%; } +a.tc5 { font-size: 150%; } +a.tc6 { font-size: 160%; } +a.tc7 { font-size: 170%; } +a.tc8 { font-size: 180%; } +a.tc9 { font-size: 190%; } +a.tc10 { font-size: 200%; } +a.tc11 { font-size: 210%; } +a.tc12 { font-size: 220%; } +a.tc13 { font-size: 230%; } +a.tc14 { font-size: 240%; } +a.tc15 { font-size: 250%; } +a.tc16 { font-size: 260%; } +a.tc17 { font-size: 270%; } +a.tc18 { font-size: 280%; } +a.tc19 { font-size: 290%; } +a.tc20 { font-size: 300%; } + diff --git a/templates/tags.tpl b/templates/tags.tpl new file mode 100644 index 0000000..203b334 --- /dev/null +++ b/templates/tags.tpl @@ -0,0 +1,5 @@ +

{$lang.tagcloud}

+ +
+ {$tagcloud} +