本文整理汇总了PHP中Hubzero\User\Group::add方法的典型用法代码示例。如果您正苦于以下问题:PHP Group::add方法的具体用法?PHP Group::add怎么用?PHP Group::add使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Hubzero\User\Group
的用法示例。
在下文中一共展示了Group::add方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: saveTask
//.........这里部分代码省略.........
// Push back into edit mode if any errors
if ($this->getNotifications()) {
$group->set('cn', $g_cn);
$group->set('description', $g_description);
$group->set('public_desc', $g_public_desc);
$group->set('private_desc', $g_private_desc);
$group->set('join_policy', $g_join_policy);
$group->set('restrict_msg', $g_restrict_msg);
$group->set('discoverability', $g_discoverability);
$group->set('discussion_email_autosubscribe', $g_discussion_email_autosubscribe);
$group->set('logo', $logo);
$group->set('plugins', $plugin_access);
$this->lid = $lid;
$this->group = $group;
$this->tags = $tags;
$this->editTask();
return;
}
// Build the e-mail message
if ($this->_task == 'new') {
$subject = Lang::txt('COM_GROUPS_SAVE_EMAIL_REQUESTED_SUBJECT', $g_cn);
$type = 'groups_created';
} else {
$subject = Lang::txt('COM_GROUPS_SAVE_EMAIL_UPDATED_SUBJECT', $g_cn);
$type = 'groups_changed';
}
if ($this->_task == 'new') {
$group->set('cn', $g_cn);
$group->set('type', 1);
$group->set('published', 1);
$group->set('approved', $this->config->get('auto_approve', 1));
$group->set('created', Date::toSql());
$group->set('created_by', User::get('id'));
$group->add('managers', array(User::get('id')));
$group->add('members', array(User::get('id')));
$group->create();
}
// merge incoming settings with existing params
$params = new Registry($params);
$gParams = new Registry($group->get('params'));
$gParams->merge($params);
//set group vars & Save group
$group->set('description', $g_description);
$group->set('public_desc', $g_public_desc);
$group->set('private_desc', $g_private_desc);
$group->set('join_policy', $g_join_policy);
$group->set('restrict_msg', $g_restrict_msg);
$group->set('discoverability', $g_discoverability);
$group->set('logo', $logo);
$group->set('plugins', $plugin_access);
$group->set('discussion_email_autosubscribe', $g_discussion_email_autosubscribe);
$group->set('params', $gParams->toString());
$group->update();
// Process tags
$gt = new Tags($group->get('gidNumber'));
$gt->setTags($tags, User::get('id'));
// Rename the temporary upload directory if it exist
$log_comments = '';
Event::trigger('groups.onGroupAfterSave', array($before, $group));
if ($this->_task == 'new') {
if ($lid != $group->get('gidNumber')) {
$config = $this->config;
$bp = PATH_APP . DS . trim($this->config->get('uploadpath', '/site/groups'), DS);
if (is_dir($bp . DS . $lid)) {
rename($bp . DS . $lid, $bp . DS . $group->get('gidNumber'));
}