From 98725dae90d4a672db841c35d8b51e54fafddddd Mon Sep 17 00:00:00 2001 From: Andreas Gohr Date: Mon, 23 Jan 2006 10:27:33 +0100 Subject: [PATCH] tagcloud added darcs-hash:20060123092733-6e07b-48424c2a174293a7557b27f200358aa23c21e57e.gz --- lang/de.php | 1 + lang/en.php | 1 + pix/cog.png | Bin 0 -> 874 bytes tags.php | 46 ++++++++++++++++++++++++++++++++++++++ templates/list_filter.tpl | 3 ++- templates/orgs.tpl | 4 ++-- templates/style.css | 24 ++++++++++++++++++++ templates/tags.tpl | 5 +++++ 8 files changed, 81 insertions(+), 3 deletions(-) create mode 100644 pix/cog.png create mode 100644 tags.php create mode 100644 templates/tags.tpl 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 0000000000000000000000000000000000000000..dba86c91c42c25731a937fbc4d205559f22e8c71 GIT binary patch literal 874 zcmV-w1C{)VP)YXT&z}q+%*Mv{ z7bN!U*RPvEd}Ya!C9`4r00IbXz{QIftGT(kQ{?64nFIv|K{nk6V(}k8elUFh{+;39 zzkeVDZv*8efL>t|5fMr0>FKEk=>-TN77zh6mFdNc7a+edf@~BQ7w2YTVgmUcY>TF* zCP4Jy(!q&*Cz!KKujQKf&2zE2<&u_Ej&Ct3_$O|qZgzG zBo7Qsuo_^PF@RhO@(w@%u{?S54#vu4c#YX;&bNl8ht zMo{1aqw)QhFJHa_#a{sg5Ihjqu3g&-R8$4B2^3%;g^wRU2HPklB?YEIhJ$PdhC$o3 zY16=g2oONvs93XRO)b#$N&x`@ux4PwVF0E)24K81C@3g^0}d3J92^|r7y*V;WkyCu zEl4jw0D;p1Fbw_y1Bj86lM|Gv81CM^`xWQ{E_-`>Mv%XkEnD`Vk&*G6g@pyTsHiA| zkdP1~Fe?9n^a2DB+zU-jO|##WZpi~Kpg%`l|VFWbn95CR- zfPSC1ZQHg~kUoF_g6D<0x;l`64$%4PKySPRDrWxl=@Y~2*RMe?WCqH;1d6MJ)W9@@ z06+jS;>yl>d3nh|%`u=T20DKUFp#lkXMg|$0P`rb#8n?`{Qv*}07*qoM6N<$g7^k) Aassign('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} +
-- 2.39.5