本文整理汇总了PHP中UserGroup::subscribe_courses_to_usergroup方法的典型用法代码示例。如果您正苦于以下问题:PHP UserGroup::subscribe_courses_to_usergroup方法的具体用法?PHP UserGroup::subscribe_courses_to_usergroup怎么用?PHP UserGroup::subscribe_courses_to_usergroup使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类UserGroup
的用法示例。
在下文中一共展示了UserGroup::subscribe_courses_to_usergroup方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: array
document.formulaire.submit();
}
</script>';
$form_sent = 0;
$errorMsg = '';
$sessions = array();
$usergroup = new UserGroup();
$id = intval($_GET['id']);
if (isset($_POST['form_sent']) && $_POST['form_sent']) {
$form_sent = $_POST['form_sent'];
$elements_posted = $_POST['elements_in_name'];
if (!is_array($elements_posted)) {
$elements_posted = array();
}
if ($form_sent == 1) {
$usergroup->subscribe_courses_to_usergroup($id, $elements_posted);
header('Location: usergroups.php');
exit;
}
}
// Filters
$filters = array(array('type' => 'text', 'name' => 'code', 'label' => get_lang('CourseCode')), array('type' => 'text', 'name' => 'title', 'label' => get_lang('Title')));
$searchForm = new FormValidator('search', 'get', api_get_self() . '?id=' . $id);
$searchForm->addHeader(get_lang('AdvancedSearch'));
$renderer =& $searchForm->defaultRenderer();
$searchForm->addElement('hidden', 'id', $id);
foreach ($filters as $param) {
$searchForm->addElement($param['type'], $param['name'], $param['label']);
}
$searchForm->addButtonSearch();
$filterData = array();
示例2: array
$actions .= '<a href="class.php?' . api_get_cidreq() . '&type=registered">' . Display::return_icon('back.png', get_lang("Classes"), array(), ICON_SIZE_MEDIUM) . '</a>';
$form = new FormValidator('groups', 'post', api_get_self(), '', '', FormValidator::LAYOUT_INLINE);
$options = [-1 => get_lang('All'), 1 => get_lang('SocialGroups'), 0 => get_lang('Classes')];
$form->addSelect('group_filter', get_lang('Groups'), $options, ['id' => 'group_filter']);
$form->setDefaults(['group_filter' => $groupFilter]);
$actions .= $form->returnForm();
}
$actions .= '</div>';
}
if (api_is_allowed_to_edit()) {
$action = isset($_GET['action']) ? $_GET['action'] : null;
switch ($action) {
case 'add_class_to_course':
$id = $_GET['id'];
if (!empty($id)) {
$usergroup->subscribe_courses_to_usergroup($id, array(api_get_course_int_id()), false);
Display::addFlash(Display::return_message(get_lang('Added')));
}
break;
case 'remove_class_from_course':
$id = $_GET['id'];
if (!empty($id)) {
$usergroup->unsubscribe_courses_from_usergroup($id, array(api_get_course_int_id()));
Display::addFlash(Display::return_message(get_lang('Deleted')));
}
break;
}
}
//jqgrid will use this URL to do the selects
$url = api_get_path(WEB_AJAX_PATH) . 'model.ajax.php?a=get_usergroups_teacher&type=' . $type . '&group_filter=' . $groupFilter;
//The order is important you need to check the the $column variable in the model.ajax.php file