this is one of the patches which was part of refactor profile_browse() and cleanup+new small features of profile.module and user.module

I had the time to refactor and to optimize 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 function profile_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
  • now there is an unified way where theme_pager is used (bevore this patch one time it was inside <div id="profile"> the next time it was under <div id="profile">

Comments

Tobias Maier’s picture

Status: Active » Needs review
Tobias Maier’s picture

Version: 4.6.5 » x.y.z
StatusFileSize
new8.12 KB

false version...

Beside this I changed a few additional things:

  • theme_profile_list_profiles() was a little bit ugly, because it wanted to have a result as argument. Now it wants an array
  • profile_admin_overview() - replaced a hardcoded list with theme('item_list', ...)
munga’s picture

I like this patch a lot...
it will solve all my problems here : http://drupal.org/node/49485

The patch applies to HEAD and it seems working ok...

Tobias Maier’s picture

thanks,

it would be nice if some more people could review this issue.
I mean who could take a look at the code and try the patch on their testsite...

btw. I did a new patch which replaces hardcoded html with themeable functions in the aggregator.module

Tobias Maier’s picture

StatusFileSize
new8.51 KB

I synced this patch with head again.

now there is a unique css-class for every profile-field at theme_profile_listing() - so you can theme it easily

I removed this feature

I hope you could review this patch - it is not a big change - and commit it to head, because for me it cleans up a bit of code and I don't want to maintain a fork of drupal 4.7 only because of this small change...

Tobias Maier’s picture

StatusFileSize
new8.54 KB

here is a new patch

which replaces in line 750 something simmilar to $field-title .':' with t('%title:', array('%title' => $field->title))

I saw this issue the first time as I did a patch together with Zen.

He wrote:

Not all languages might use a colon for punctuation etc. etc. For e.g. in Sanskrit, a full stop/period is usually represented by a | or a || depending on the context. The same might be the case with other punctuation symbols as well.

Tobias Maier’s picture

Title: refactor profile_browse() » refactor profile_browse() - make it themeable!

rerolled to head

Tobias Maier’s picture

StatusFileSize
new8.54 KB
chx’s picture

Category: bug » feature
dmitrig01’s picture

Version: x.y.z » 6.x-dev
Status: Needs review » Needs work

not even close to applying - sorry

Bèr Kessels’s picture

Category: feature » bug

Marking it as a bug. This function contains hardcoded HTML. We agreed upon such things being (critical) bugs. Hardcoded HTML is for certain not a feature request but at least a "mistake".

$output = '<div id="profile">'; 
//...
$output .= '</div>';
dvessel’s picture

Status: Needs work » Fixed
Anonymous’s picture

Status: Fixed » Closed (fixed)