Added method getGroupTitle#6994
Closed
HelgeSverre wants to merge 4 commits intojoomla:stagingfrom
HelgeSverre:staging
Closed
Added method getGroupTitle#6994HelgeSverre wants to merge 4 commits intojoomla:stagingfrom HelgeSverre:staging
HelgeSverre wants to merge 4 commits intojoomla:stagingfrom
HelgeSverre:staging
Conversation
added 2 commits
May 20, 2015 12:29
Contributor
|
@HelgeSverre I have just send you a quick CS PR. Can you add some example code for the testers? |
[CS] Fix some CS
Author
|
@zero-24 Sure This example will echo out the title of every group that a user is in: Example// Get the JUser object of the current user
$user = JFactory::getUser();
// Get an array of the group id's that the current user is in.
$groups = JAccess::getGroupsByUser($user->id);
// Loop through each group id
foreach ($groups as $groupId) {
// Print out the title of that group
echo JAccess::getGroupTitle($groupId);
} |
Contributor
|
Thanks @test successful 👍 This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/6994. |
Member
|
Patch works as intended. This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/6994. |
Contributor
|
RTC Thanks 😄 This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/6994. |
Contributor
Ready to commit. So the changes works as expected and a maintainer need to take a decision to include or not 😄 Thanks This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/6994. |
Contributor
|
Added a unit test for the method and merged to |
roland-d
pushed a commit
that referenced
this pull request
Aug 6, 2015
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Added a helper method for getting the title of a group by its id.
I've not found any method to do this in the Joomla documentation so i put it it.
This example will echo out the title of every group that a user is in:
Example