本文整理汇总了PHP中AMA_DataHandler::course_instance_tutor_get方法的典型用法代码示例。如果您正苦于以下问题:PHP AMA_DataHandler::course_instance_tutor_get方法的具体用法?PHP AMA_DataHandler::course_instance_tutor_get怎么用?PHP AMA_DataHandler::course_instance_tutor_get使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AMA_DataHandler
的用法示例。
在下文中一共展示了AMA_DataHandler::course_instance_tutor_get方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: parameter_controlFN
//.........这里部分代码省略.........
*/
if (in_array('course_instance', $thisUserNeededObjAr)) {
/*
* Se ci troviamo nel tester pubblico, allora non dobbiamo leggere un'istanza corso
* dato che non ce ne sono.
*/
if (!$invalid_course && !$sess_courseObj->getIsPublic()) {
if (isset($target_course_instance)) {
$id_course_instance = DataValidator::is_uinteger($target_course_instance);
} else {
if (isset($_REQUEST['id_course_instance'])) {
$id_course_instance = DataValidator::is_uinteger($_REQUEST['id_course_instance']);
// FIXME: qui ci va $_REQUEST['id_course_instance']
} else {
$id_course_instance = false;
}
}
$sess_id_course_instance = isset($_SESSION['sess_id_course_instance']) ? DataValidator::is_uinteger($_SESSION['sess_id_course_instance']) : false;
if ($id_course_instance !== FALSE) {
$course_instanceObj = read_course_instance_from_DB($id_course_instance);
if (ADA_Error::isError($course_instanceObj)) {
$invalid_course_instance = TRUE;
} else {
$UserType = $sess_userObj->getType();
switch ($sess_userObj->getType()) {
case AMA_TYPE_STUDENT:
$studentLevel = $dh->_get_student_level($sess_id_user, $id_course_instance);
if (AMA_DataHandler::isError($studentLevel)) {
$invalid_course_instance = TRUE;
}
break;
case AMA_TYPE_TUTOR:
if (!$sess_userObj->isSuper() && $course_instanceObj->getServiceLevel() != ADA_SERVICE_TUTORCOMMUNITY) {
$tutorsInstance = $dh->course_instance_tutor_get($id_course_instance, $number = 2);
if (AMA_DataHandler::isError($tutorsInstance)) {
$invalid_course_instance = TRUE;
} elseif (!in_array($sess_id_user, $tutorsInstance)) {
$invalid_course_instance = TRUE;
}
}
break;
default:
// $invalid_course_instance = TRUE;
break;
}
if (!$invalid_course_instance) {
$_SESSION['sess_id_course_instance'] = $id_course_instance;
$sess_id_course_instance = $_SESSION['sess_id_course_instance'];
}
}
} elseif ($sess_id_course_instance !== FALSE) {
$instanceIdRequired = array();
if (isset($_SESSION['sess_id_node']) && !$invalid_node) {
// if ($nodeObj instanceof Node) { // required a node
$instanceIdRequired[] = isset($dataHa['instance']) ? $dataHa['instance'] : null;
if ($instanceIdRequired[0] == 0) {
// the node is NOT a note
$field_list_ar = array();
if (isset($_SESSION['sess_id_course']) && !$invalid_course) {
$courseIdRequired = $_SESSION['sess_id_course'];
$InstanceIdList = $dh->course_instance_get_list($field_list_ar, $courseIdRequired);
if (AMA_DataHandler::isError($InstanceIdList) || count($InstanceIdList) == 0) {
$invalid_course_instance = TRUE;
}
} else {
$invalid_course_instance = TRUE;