I had the time to refactor and to optimice the profile.module
mainly profile_browse()
list of changes
- at
profile_browse()was a lot of code duplication. reordered this part and put it an own functionprofile_list_profiles()
side benefit: use this function in a node to integrate a user-list inside your article - removed hardcoded html - this is in
theme_profile_list_profiles()
there was also some inconsistency in it - it is now everywhere the same - now there is a unique css-class for every profile-field at
theme_profile_listing()- so you can theme it easily (for example:
there is still some room for improvements
like:
- remove the id at
<li id="profiles">...</li>
I want to rename a lot of classes there - checkboxes do not have a title --> rethink
theme_profile_block()
...
I hope you like the changes
please test it!
Tobi
| Comment | File | Size | Author |
|---|---|---|---|
| #4 | profile_13.patch | 9.5 KB | Tobias Maier |
| #3 | profile_12.patch | 9.17 KB | Tobias Maier |
| #2 | refactorprofile.patch | 7.79 KB | Tobias Maier |
| #1 | profile_11.patch | 7.19 KB | Tobias Maier |
| profile_10.patch | 6.34 KB | Tobias Maier |
Comments
Comment #1
Tobias Maier commentedthere were two ways to fix this - but nothing had to do with the function mentioned
profile_view_profile()there is the following line:one solution would be to change the '' to NULL.
the ":" which is listed on the user-page does disappear (a common example is http://scratch.drupal.org/user/1 - do you see all the single ":" on every item?)
but then text will be attached to the last item visually (because of the definition-list used)
--> change
theme_user_profile()- that is what I didComment #2
Tobias Maier commentedthis patch contains everything of the last patch plus
that the id was replaced by the class ".module-profile" - because I think the main class of every module should start with "module-"
it costs us flexibility and sometimes to have a valid site that we use ids in such an inconsistent way (and so often)
Comment #3
Tobias Maier commentedsorry this was the false file...
Comment #4
Tobias Maier commentedi think the class .profile is a perfect example why it is difficult to theme drupal...
.profile is used by the user module again (at
theme_user_profile())I did the hard way: I renamed the class to .module-user-profile and now we have a clear class name which nobody could accidently use
Comment #5
Tobias Maier commentedif you want I would go through all core module and change every
idto aclasstomorrow at workComment #6
Tobias Maier commentedComment #7
moshe weitzman commentedComment #8
Tobias Maier commentedok here comes a summary for this thread:
there are 3 patches which all have additional "features"
Comment #9
drummCan you post either one patch or move the separate pateches into new issues?
Comment #10
Tobias Maier commentedI released the main topics in seperate issues:
refactor profile_browse()
senseless colon on user-page
Comment #11
Tobias Maier commented