本文整理汇总了PHP中UserUtils::add_staff_to_module_by_modulecode方法的典型用法代码示例。如果您正苦于以下问题:PHP UserUtils::add_staff_to_module_by_modulecode方法的具体用法?PHP UserUtils::add_staff_to_module_by_modulecode怎么用?PHP UserUtils::add_staff_to_module_by_modulecode使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类UserUtils
的用法示例。
在下文中一共展示了UserUtils::add_staff_to_module_by_modulecode方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: foreach
UserNotices::display_notice($string['NotAddedToModuleTitle'], $string['NotAddedToModule'] . $v[1], '../artwork/exclamation_64.png', '#C00000');
echo "\n</body>\n</html>\n";
exit;
}
}
$module_store = $lti_i::module_code_translated_store($data);
if ($problem === false) {
$lti->add_lti_context($module_store);
}
$returned2 = $lti->lookup_lti_context();
}
$mod = $returned2[0];
$data = $lti_i::module_code_translate($mod);
foreach ($data as $v) {
if (!$userObject->is_staff_user_on_module($v[1]) and $lti_i::allow_staff_module_register($v) and $userObject->has_role(array('Staff', 'Admin', 'SysAdmin')) and module_utils::is_allowed_add_team_members_by_name($v[1], $mysqli)) {
UserUtils::add_staff_to_module_by_modulecode($userObject->get_user_ID(), $v[1], $mysqli);
} elseif (!$userObject->is_staff_user_on_module($v[1]) and !$lti_i::allow_staff_module_register($v)) {
UserNotices::display_notice($string['NotAddedToModuleTitle'], $string['NotAddedToModule'] . $v[1], '../artwork/exclamation_64.png', '#C00000');
echo "\n</body>\n</html>\n";
exit;
}
}
list($c_internal_id, $upd) = $returned2;
$moduleid = $c_internal_id;
echo <<<END
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta http-equiv="content-type" content="text/html;charset={$configObject->get('cfg_page_charset')}" />
示例2: trim
$unique_username = true;
}
$schoolID = SchoolUtils::add_school(1, 'School of Practice', $mysqli);
// Make sure the 'School of Practice' school exists.
CourseUtils::add_course($schoolID, 'A10DEMO', 'Demonstration BSc', $mysqli);
// Make sure demo course exists.
$new_modid = module_utils::add_modules($new_moduleid, $_POST['new_grade2'], 1, $schoolID, NULL, NULL, true, true, true, false, false, true, false, $mysqli, 0, 0, 1, 1, '07/01');
if ($unique_username == true) {
$_POST['new_grade'] = $new_moduleid;
$session = date_utils::get_current_academic_year();
// Add staff account
$new_username = trim($_POST['new_username']);
$useridstf = adduser('Staff', 'Staff', $new_username, $mysqli);
UserUtils::add_staff_to_module_by_modulecode($useridstf, $new_moduleid, $mysqli);
// Add staff to the new module
UserUtils::add_staff_to_module_by_modulecode($useridstf, 'DEMO', $mysqli);
// Add staff to the general DEMO module
// Add student account
$max_sid = 0;
$new_username = $new_username . '-stu';
$userid = adduser('A10DEMO', 'Student', $new_username, $mysqli);
$result = $mysqli->prepare("SELECT MAX(id) as a FROM users");
$result->execute();
$result->bind_result($max_sid);
$result->fetch();
$result->close();
$max_sid++;
$result = $mysqli->prepare("INSERT INTO sid VALUES (?, ?)");
$result->bind_param('si', $max_sid, $userid);
$result->execute();
$result->close();