Closed (fixed)
Project:
Drupal core
Component:
theme system
Priority:
Normal
Category:
Bug report
Assigned:
Reporter:
Created:
22 Oct 2004 at 16:56 UTC
Updated:
8 Oct 2005 at 22:20 UTC
Jump to comment: Most recent file
Attached is a patch for tablesort.inc much cleaner, friendlier and more consistent way to theme the tablesort icons.
Marking as a bug becuase it is inconsistent with the rest of drupal..
Please review and apply!
| Comment | File | Size | Author |
|---|---|---|---|
| #13 | tablesort_header_1.patch | 1.61 KB | robin monks |
| #12 | tablesort_header_0.patch | 1.6 KB | robin monks |
| #10 | tablesort_header.patch | 1.49 KB | robin monks |
| #6 | tablesort-sorting-theme-improvement_0.patch | 1.73 KB | Stefan Nagtegaal |
| tablesort-sorting-theme-improvement.patch | 1.25 KB | Stefan Nagtegaal |
Comments
Comment #1
Stefan Nagtegaal commentedSetting status to 'Patch' instead of 'Fixed' so it shows up in the patch queue
Comment #2
dries commentedPlease move the proposed theme functions to
includes/theme.inc(so Doxygen includes them in the list of theme_ functions).Comment #3
Steven commentedWe should avoid entities like in the code. This can be achieved through CSS instead in the theme.
Comment #4
Steven commented(ack submitted too early)
Also, I wonder about the granularity of these theme functions. I don't see the point in putting ascending/descending in a separate function: they are different styles for the same element (the tablesort indicator).
Comment #5
dries commentedStefan's patch actually removes the entities, not (or is my jet lag worse than it appears)?
Comment #6
Stefan Nagtegaal commentedUpdated patch which removes the and moves the
theme_tablesort_asc()andtheme_tablesort_desc()to theme.inc.This is much better imo than the current approach..
Comment #7
Steven commentedYeah the entity was actually a +1... I should stop doing so much things at the same time. My other concern is still valid though: theme functions should theme page /elements/, not versions of that element.
Otherwise we would have theme_node(), theme_node_sticky(), theme_node_teaser(), ...
Comment #8
dries commentedI agree with Steven. We should have a function called theme_tablesort_header($style) where $style can be either 'ascending' or 'descending'.
Comment #9
dries commentedComment #10
robin monks commentedHere is a new patch with
theme_tablesort_header($style)that takes either asc or desc as arguments.Tested to work on Drupal CVS HEAD.
Robin
Comment #11
Bèr Kessels commentedI am not sure about teh switch; AFAIK there will be only asc and desc. So an if would be enough. Saves some lines of code, like "break"s; etc.
Comment #12
robin monks commentedHere is a new patch using if instead of the switch.
Robin
Comment #13
robin monks commentedThox suggested using indicator instead of header.
Robin
Comment #14
mfb+1 looks good.
Comment #15
jose reyero commented+1
Tested the patch -applies with some line shift-, and it works
Comment #16
dries commentedCommitted to HEAD. Thanks.
Comment #17
(not verified) commentedComment #18
(not verified) commentedComment #19
(not verified) commentedComment #20
(not verified) commentedComment #21
(not verified) commentedComment #22
(not verified) commentedComment #23
(not verified) commented