Projet

Général

Profil

Révision 6c9579f7

Ajouté par Assos Assos il y a environ 10 ans

Weekly update of contrib modules

Voir les différences:

drupal7/sites/all/modules/author_pane/modules/user_badges.author-pane.inc
14 14
  }
15 15

  
16 16
  // Anonymous users has no user badges.
17
  // TODO: When a stable release of user_badges exists.
18
  // - Check if this if-case is necessary to use?
19
  //   user_badges_for_uid, right now, returns "NULL" if $uid is 0.
20
  // - Static cache is not necessary, user_badges_for_uid has it right now.
21 17
  if ($variables['account']->uid != 0) {
22
    $variables['user_badges'] = user_badges_for_uid($variables['account']->uid);
18

  
19
    // Only display the badges according badge limit
20
    if (isset($variables['account']->badges)) {
21
      $variables['user_badges'] = '';
22

  
23
      // Loop through and add only the badges that are within the limit,
24
      // $variables['account']->badges, stores the badges within the limit
25
      foreach ($variables['account']->badges as $badge) {
26
        $variables['user_badges'] .= theme('user_badge', array('badge' => $badge));
27
      }
28
    }
23 29
  }
24 30
}
25 31

  

Formats disponibles : Unified diff