@@ -753,7 +753,10 @@ public function base_userAnchor_handler($sender, $args){
753
753
$ anchorText = '<span class="topcoderHandle"> ' .$ anchorText .'</span> ' ;
754
754
// Don't show Topcoder Challenge roles for admin roles
755
755
if (!$ isTopcoderAdmin ){
756
- $ anchorText = $ anchorText . $ this ->topcoderProjectRolesText ($ user , $ resources , $ roleResources );
756
+ $ roles = $ this ->topcoderProjectRolesText ($ user , $ resources , $ roleResources );
757
+ if ($ roles ) {
758
+ $ anchorText = $ anchorText . ' <span class="challengeRoles">( ' .$ roles . ')</span> ' ;
759
+ }
757
760
}
758
761
}
759
762
}
@@ -764,19 +767,27 @@ public function base_userAnchor_handler($sender, $args){
764
767
* @param $args
765
768
*/
766
769
public function base_userPhoto_handler ($ sender , $ args ){
767
- if ($ sender instanceof DiscussionController || $ sender instanceof GroupController) {
770
+ if ($ sender instanceof DiscussionController || $ sender instanceof GroupController || $ sender instanceof PostController ) {
768
771
$ user = $ args ['User ' ];
769
772
$ anchorText = &$ args ['Title ' ];
773
+ $ isTopcoderAdmin = $ args ['IsTopcoderAdmin ' ];
770
774
$ resources = $ sender ->data ('ChallengeResources ' );
771
775
$ roleResources = $ sender ->data ('ChallengeRoleResources ' );
776
+ // Don't show Topcoder Challenge roles for admin roles
777
+ if (!$ isTopcoderAdmin ){
778
+ $ roles = $ this ->topcoderProjectRolesText ($ user , $ resources , $ roleResources );
779
+ if ($ roles ) {
780
+ $ anchorText = $ anchorText .' ( ' .$ roles . ') ' ;
781
+ }
782
+ }
772
783
}
773
784
}
774
785
775
786
private function topcoderProjectRolesText ($ user , $ resources = null , $ roleResources = null ) {
776
787
$ roles = $ this ->getTopcoderProjectRoles ($ user , $ resources , $ roleResources );
777
788
// FIX: https://github.com/topcoder-platform/forums/issues/476: Show only Copilot, Reviewer roles
778
789
$ displayedRoles = array_intersect (array_unique ($ roles ), ["Copilot " , "Reviewer " ]);
779
- return count ($ displayedRoles ) > 0 ? ' <span class="challengeRoles">( ' . implode (', ' , $ displayedRoles ) . ' )</span> ' : '' ;
790
+ return count ($ displayedRoles ) > 0 ? implode (', ' , $ displayedRoles ) : '' ;
780
791
}
781
792
782
793
/**
0 commit comments