本文整理汇总了PHP中GroupManager::set_group_properties方法的典型用法代码示例。如果您正苦于以下问题:PHP GroupManager::set_group_properties方法的具体用法?PHP GroupManager::set_group_properties怎么用?PHP GroupManager::set_group_properties使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类GroupManager
的用法示例。
在下文中一共展示了GroupManager::set_group_properties方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: update_category
/**
* Update group category
*
* @param int $id
* @param string $title
* @param string $description
* @param $doc_state
* @param $work_state
* @param $calendar_state
* @param $announcements_state
* @param $forum_state
* @param $wiki_state
* @param $chat_state
* @param $self_registration_allowed
* @param $self_unregistration_allowed
* @param $maximum_number_of_students
* @param $groups_per_user
*/
public static function update_category($id, $title, $description, $doc_state, $work_state, $calendar_state, $announcements_state, $forum_state, $wiki_state, $chat_state, $self_registration_allowed, $self_unregistration_allowed, $maximum_number_of_students, $groups_per_user)
{
$table_group_category = Database::get_course_table(TABLE_GROUP_CATEGORY);
$id = Database::escape_string($id);
$course_id = api_get_course_int_id();
$sql = "UPDATE " . $table_group_category . "SET\n title='" . Database::escape_string($title) . "',\n description='" . Database::escape_string($description) . "',\n doc_state = '" . Database::escape_string($doc_state) . "',\n work_state = '" . Database::escape_string($work_state) . "',\n calendar_state = '" . Database::escape_string($calendar_state) . "',\n announcements_state = '" . Database::escape_string($announcements_state) . "',\n forum_state = '" . Database::escape_string($forum_state) . "',\n wiki_state = '" . Database::escape_string($wiki_state) . "',\n chat_state = '" . Database::escape_string($chat_state) . "',\n groups_per_user = '" . Database::escape_string($groups_per_user) . "',\n self_reg_allowed = '" . Database::escape_string($self_registration_allowed) . "',\n self_unreg_allowed = '" . Database::escape_string($self_unregistration_allowed) . "',\n max_student = " . Database::escape_string($maximum_number_of_students) . "\n WHERE c_id = {$course_id} AND id = {$id}";
Database::query($sql);
// Updating all groups inside this category
$groups = self::get_group_list($id);
if (!empty($groups)) {
foreach ($groups as $group) {
GroupManager::set_group_properties($group['id'], $group['name'], $group['description'], $maximum_number_of_students, $doc_state, $work_state, $calendar_state, $announcements_state, $forum_state, $wiki_state, $chat_state, $self_registration_allowed, $self_unregistration_allowed, $id);
}
}
}
示例2: get_lang
$form->addGroup($group, '', Display::return_icon('wiki.png', get_lang('GroupWiki'), array(), ICON_SIZE_SMALL) . ' ' . get_lang('GroupWiki'), '', false);
// Chat settings
$group = array($form->createElement('radio', 'chat_state', get_lang('Chat'), get_lang('NotAvailable'), GroupManager::TOOL_NOT_AVAILABLE), $form->createElement('radio', 'chat_state', null, get_lang('Public'), GroupManager::TOOL_PUBLIC), $form->createElement('radio', 'chat_state', null, get_lang('Private'), GroupManager::TOOL_PRIVATE));
$form->addGroup($group, '', Display::return_icon('chat.png', get_lang('Chat'), array(), ICON_SIZE_SMALL) . ' ' . get_lang('Chat'), '', false);
// submit button
$form->addButtonSave(get_lang('SaveSettings'), 'submit');
if ($form->validate()) {
$values = $form->exportValues();
if ($values['max_member_no_limit'] == GroupManager::MEMBER_PER_GROUP_NO_LIMIT) {
$max_member = GroupManager::MEMBER_PER_GROUP_NO_LIMIT;
} else {
$max_member = $values['max_member'];
}
$self_registration_allowed = isset($values['self_registration_allowed']) ? 1 : 0;
$self_unregistration_allowed = isset($values['self_unregistration_allowed']) ? 1 : 0;
GroupManager::set_group_properties($current_group['id'], $values['name'], $values['description'], $max_member, $values['doc_state'], $values['work_state'], $values['calendar_state'], $values['announcements_state'], $values['forum_state'], $values['wiki_state'], $values['chat_state'], $self_registration_allowed, $self_unregistration_allowed);
// Storing the tutors (we first remove all the tutors and then add only those who were selected)
GroupManager::unsubscribe_all_tutors($current_group['id']);
if (isset($_POST['group_tutors']) && count($_POST['group_tutors']) > 0) {
GroupManager::subscribe_tutors($values['group_tutors'], $current_group['id']);
}
// Storing the users (we first remove all users and then add only those who were selected)
GroupManager::unsubscribe_all_users($current_group['id']);
if (isset($_POST['group_members']) && count($_POST['group_members']) > 0) {
GroupManager::subscribe_users($values['group_members'], $current_group['id']);
}
// Returning to the group area (note: this is inconsistent with the rest of chamilo)
$cat = GroupManager::get_category_from_group($current_group['id']);
if (isset($_POST['group_members']) && count($_POST['group_members']) > $max_member && $max_member != GroupManager::MEMBER_PER_GROUP_NO_LIMIT) {
Display::addFlash(Display::return_message(get_lang('GroupTooMuchMembers'), 'warning'));
header('Location: group.php?' . api_get_cidreq(true, false));