if-else instead of ?:
darcs-hash:20080729194735-84dde-246582a47d4a384375d153bff0e724c778c4b3af.gz
This commit is contained in:
parent
f26ed46266
commit
575f705451
|
@ -121,13 +121,21 @@ class TagAction extends StreamAction {
|
||||||
function show_tag($tag, $weight, $relative) {
|
function show_tag($tag, $weight, $relative) {
|
||||||
|
|
||||||
# XXX: these should probably tune to the size of the site
|
# XXX: these should probably tune to the size of the site
|
||||||
$cls = ($relative > 0.1) ? 'largest' :
|
if ($relative > 0.1) {
|
||||||
($relative > 0.05) ? 'verylarge' :
|
$cls = 'largest';
|
||||||
($relative > 0.02) ? 'large' :
|
} else if ($relative > 0.05) {
|
||||||
($relative > 0.01) ? 'medium' :
|
$cls = 'verylarge';
|
||||||
($relative > 0.005) ? 'small' :
|
} else if ($relative > 0.02) {
|
||||||
($relative > 0.002) ? 'verysmall' :
|
$cls = 'large';
|
||||||
'smallest';
|
} else if ($relative > 0.01) {
|
||||||
|
$cls = 'medium';
|
||||||
|
} else if ($relative > 0.005) {
|
||||||
|
$cls = 'small';
|
||||||
|
} else if ($relative > 0.002) {
|
||||||
|
$cls = 'verysmall';
|
||||||
|
} else {
|
||||||
|
$cls = 'smallest';
|
||||||
|
}
|
||||||
|
|
||||||
common_element('a', array('class' => "$cls weight-$weight relative-$relative",
|
common_element('a', array('class' => "$cls weight-$weight relative-$relative",
|
||||||
'href' => common_local_url('tag', array('tag' => $tag))),
|
'href' => common_local_url('tag', array('tag' => $tag))),
|
||||||
|
|
Loading…
Reference in New Issue
Block a user