Skip to content

Added method getGroupTitle#6994

Closed
HelgeSverre wants to merge 4 commits intojoomla:stagingfrom
HelgeSverre:staging
Closed

Added method getGroupTitle#6994
HelgeSverre wants to merge 4 commits intojoomla:stagingfrom
HelgeSverre:staging

Conversation

@HelgeSverre
Copy link
Copy Markdown

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

// 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);
}

@zero-24
Copy link
Copy Markdown
Contributor

zero-24 commented May 20, 2015

@HelgeSverre I have just send you a quick CS PR.

Can you add some example code for the testers?

@HelgeSverre
Copy link
Copy Markdown
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);
}

@zero-24
Copy link
Copy Markdown
Contributor

zero-24 commented May 20, 2015

Thanks @test successful 👍


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/6994.

@jwaisner
Copy link
Copy Markdown
Member

@test

Patch works as intended.


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/6994.

@zero-24
Copy link
Copy Markdown
Contributor

zero-24 commented May 24, 2015

RTC Thanks 😄


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/6994.

@zero-24 zero-24 added the RTC This Pull Request is Ready To Commit label May 24, 2015
@zero-24
Copy link
Copy Markdown
Contributor

zero-24 commented May 26, 2015

What does RTC stand for?

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.

@Kubik-Rubik Kubik-Rubik added this to the Joomla! 3.5.0 milestone May 26, 2015
@mbabker
Copy link
Copy Markdown
Contributor

mbabker commented Jul 11, 2015

Added a unit test for the method and merged to 3.5-dev via 7620400

roland-d pushed a commit that referenced this pull request Aug 6, 2015
@zero-24 zero-24 removed the RTC This Pull Request is Ready To Commit label Oct 14, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants