Yes, this is the approach I will take.
You can find the save () method in the groups.php controller. There you received all the necessary code for its implementation.
Rough code:
$my =& CFactory::getUser(); $config =& CFactory::getConfig(); $group =& JTable::getInstance( 'Group' , 'CTable' ); $group->name = $name; $group->description = $description; $group->categoryid = $categoryId; // Category Id must not be empty and will cause failure on this group if its empty. $group->website = $website; $group->ownerid = $my->id; $group->created = gmdate('Ymd H:i:s'); $group->approvals = 0; $params = new CParameter( '' ); // Here you need some code from private _bindParams() $group->params = $params->toString(); $group->published = ( $config->get('moderategroupcreation') ) ? 0 : 1; $group->store(); // Other useful stuff: // - store the creator / admin into the groups members table // - add into activity stream
source share