diff options
| author | Bharat Mediratta <bharat@menalto.com> | 2008-11-26 10:27:13 +0000 |
|---|---|---|
| committer | Bharat Mediratta <bharat@menalto.com> | 2008-11-26 10:27:13 +0000 |
| commit | 98ee16ca49c70d12225677999b7534744d13f168 (patch) | |
| tree | 644a2449f249586382b20449fecac5389c71e860 /modules/tag/views | |
| parent | e1f39ac13f587c6c6fbf5c5ab522b8422f992366 (diff) | |
Simplify tags code some more:
1) change buckets to be 1-7 not 0-6.. zero-based indicies don't make sense in the
real world and are liable to confuse themers.
2) Change tag API to popular_tags($count) which just returns the popular tags. Let
the block code massage it into the right format for the view.
3) Move alphasort into the block code, simplify it and rename it to sort_by_name so
that it's more descriptive
4) Do the bucketing in the view; this allows the themer to override it and create their
own bucketing algorithm to go with the theme's CSS.
5) Don't create any temporary objects.
Diffstat (limited to 'modules/tag/views')
| -rw-r--r-- | modules/tag/views/tag_block.html.php | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/modules/tag/views/tag_block.html.php b/modules/tag/views/tag_block.html.php index a949182b..3e45bdba 100644 --- a/modules/tag/views/tag_block.html.php +++ b/modules/tag/views/tag_block.html.php @@ -1,17 +1,18 @@ <? defined("SYSPATH") or die("No direct script access."); ?> <ul> - <? foreach ($tag_list as $tag): ?> - <li class="size<?=$tag["class"] ?>"> - <span><?= $tag["count"] ?> photos are tagged with </span> - <a href="<?=url::site("/tag/{$tag["id"]}") ?>"><?=$tag["name"] ?></a> - </li> - <? endforeach; ?> + <? foreach ($tags as $tag): ?> + <li class="size<?=(int)(($tag->count / $max_count) * 7) ?>"> + <span><?= $tag->count ?> photos are tagged with </span> + <a href="<?=url::site("tag/$tag->id") ?>"><?= $tag->name ?></a> + </li> + <? endforeach ?> </ul> <form id="gAddTag"> - <ul class="gInline"> + <ul> <li><input type="text" class="text" value="add new tags..." id="gNewTags" /></li> - <li class="gNoLabels"><input type="submit" value="add" /></li> + <li><input type="submit" value="add" /></li> </ul> - <label for="gNewTags" class="gUnderState">(separated by commas)</label> + <label for="gNewTags" class="gUnderState"><?= _("(separated by commas)") ?></label> </form> + |
