当前位置: 首页>>代码示例>>PHP>>正文


PHP CourseManager::get_courses_list_by_user_id方法代码示例

本文整理汇总了PHP中CourseManager::get_courses_list_by_user_id方法的典型用法代码示例。如果您正苦于以下问题:PHP CourseManager::get_courses_list_by_user_id方法的具体用法?PHP CourseManager::get_courses_list_by_user_id怎么用?PHP CourseManager::get_courses_list_by_user_id使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在CourseManager的用法示例。


在下文中一共展示了CourseManager::get_courses_list_by_user_id方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: WSCourseListOfUser

/**
 * Get a list of courses (code, url, title, teacher, language) for a specific
 * user and return to caller
 * Function registered as service. Returns strings in UTF-8.
 * @param string User name in Chamilo
 * @param string Signature (composed of the sha1(username+apikey)
 * @return array Courses list (code=>[title=>'title',url='http://...',teacher=>'...',language=>''],code=>[...],...)
 */
function WSCourseListOfUser($username, $signature)
{
    if (empty($username) or empty($signature)) {
        return -1;
    }
    global $_configuration;
    $info = api_get_user_info_from_username($username);
    $user_id = $info['user_id'];
    $list = UserManager::get_api_keys($user_id, 'dokeos');
    $key = '';
    foreach ($list as $key) {
        break;
    }
    $local_key = $username . $key;
    if (!api_is_valid_secret_key($signature, $local_key)) {
        return -1;
        // The secret key is incorrect.
    }
    $courses_list = array();
    $courses_list_tmp = CourseManager::get_courses_list_by_user_id($user_id);
    foreach ($courses_list_tmp as $index => $course) {
        $course_info = CourseManager::get_course_information($course['code']);
        $courses_list[] = array('code' => $course['code'], 'title' => api_utf8_encode($course_info['title']), 'url' => api_get_path(WEB_COURSE_PATH) . $course_info['directory'] . '/', 'teacher' => api_utf8_encode($course_info['tutor_name']), 'language' => $course_info['course_language']);
    }
    return $courses_list;
}
开发者ID:KRCM13,项目名称:chamilo-lms,代码行数:34,代码来源:user_info.soap.php

示例2: get_user_courses

 function get_user_courses()
 {
     if (!is_null($this->_get_user_courses)) {
         return $this->_get_user_courses;
     }
     $user_id = $this->user_id;
     return $this->_get_user_courses = CourseManager::get_courses_list_by_user_id($user_id);
 }
开发者ID:ilosada,项目名称:chamilo-lms-icpna,代码行数:8,代码来源:course_notice_query.class.php

示例3: exit_of_chat

/**
 * @param integer
 * @return void
 */
function exit_of_chat($user_id)
{
    $user_id = intval($user_id);
    $list_course = CourseManager::get_courses_list_by_user_id($user_id);
    $tbl_chat_connected = Database::get_course_table(TABLE_CHAT_CONNECTED);
    foreach ($list_course as $course) {
        $response = user_connected_in_chat($user_id);
        $sql = 'DELETE FROM ' . $tbl_chat_connected . ' WHERE c_id = ' . $course['real_id'] . ' AND user_id = ' . $user_id;
        Database::query($sql);
    }
}
开发者ID:ilosada,项目名称:chamilo-lms-icpna,代码行数:15,代码来源:chat_functions.lib.php

示例4: getEvents

 /**
  * Get agenda events
  * @param int $start
  * @param int $end
  * @param int $course_id
  * @param int $groupId
  * @param int $user_id
  * @param string $format
  *
  * @return array|string
  */
 public function getEvents($start, $end, $course_id = null, $groupId = null, $user_id = 0, $format = 'json')
 {
     switch ($this->type) {
         case 'admin':
             $this->getPlatformEvents($start, $end);
             break;
         case 'course':
             $session_id = $this->sessionId;
             $courseInfo = api_get_course_info_by_id($course_id);
             // Session coach can see all events inside a session.
             if (api_is_coach()) {
                 // Own course
                 $this->getCourseEvents($start, $end, $courseInfo, $groupId, $session_id, $user_id);
                 // Others
                 $this->getSessionEvents($start, $end, api_get_session_id(), $user_id, $this->eventOtherSessionColor);
             } else {
                 $this->getCourseEvents($start, $end, $courseInfo, $groupId, $session_id, $user_id);
             }
             break;
         case 'personal':
         default:
             $sessionFilterActive = false;
             if (!empty($this->sessionId)) {
                 $sessionFilterActive = true;
             }
             if ($sessionFilterActive == false) {
                 // Getting personal events
                 $this->getPersonalEvents($start, $end);
                 // Getting platform/admin events
                 $this->getPlatformEvents($start, $end);
             }
             // Getting course events
             $my_course_list = array();
             if (!api_is_anonymous()) {
                 $session_list = SessionManager::get_sessions_by_user(api_get_user_id());
                 $my_course_list = CourseManager::get_courses_list_by_user_id(api_get_user_id(), false);
             }
             if (api_is_drh()) {
                 if (api_drh_can_access_all_session_content()) {
                     $session_list = array();
                     $sessionList = SessionManager::get_sessions_followed_by_drh(api_get_user_id(), null, null, null, true, false);
                     if (!empty($sessionList)) {
                         foreach ($sessionList as $sessionItem) {
                             $sessionId = $sessionItem['id'];
                             $courses = SessionManager::get_course_list_by_session_id($sessionId);
                             $sessionInfo = array('session_id' => $sessionId, 'courses' => $courses);
                             $session_list[] = $sessionInfo;
                         }
                     }
                 }
             }
             if (!empty($session_list)) {
                 foreach ($session_list as $session_item) {
                     if ($sessionFilterActive) {
                         if ($this->sessionId != $session_item['session_id']) {
                             continue;
                         }
                     }
                     $my_courses = $session_item['courses'];
                     $my_session_id = $session_item['session_id'];
                     if (!empty($my_courses)) {
                         foreach ($my_courses as $course_item) {
                             $courseInfo = api_get_course_info_by_id($course_item['real_id']);
                             $this->getCourseEvents($start, $end, $courseInfo, 0, $my_session_id);
                         }
                     }
                     $this->getSessionEvents($start, $end, $my_session_id, $user_id, $this->eventOtherSessionColor);
                 }
             }
             if (!empty($my_course_list) && $sessionFilterActive == false) {
                 foreach ($my_course_list as $courseInfoItem) {
                     $courseInfo = api_get_course_info_by_id($courseInfoItem['real_id']);
                     if (isset($course_id) && !empty($course_id)) {
                         if ($courseInfo['real_id'] == $course_id) {
                             $this->getCourseEvents($start, $end, $courseInfo);
                         }
                     } else {
                         $this->getCourseEvents($start, $end, $courseInfo);
                     }
                 }
             }
             break;
     }
     if (!empty($this->events)) {
         switch ($format) {
             case 'json':
                 return json_encode($this->events);
                 break;
             case 'array':
//.........这里部分代码省略.........
开发者ID:secuencia24,项目名称:chamilo-lms,代码行数:101,代码来源:agenda.lib.php

示例5: get_events

 /**
  *
  * Get agenda events
  * @param    int        start tms
  * @param    int        end tms
  * @param    int        course id *integer* not the course code
  * @param   int     user id
  *
  */
 public function get_events($start, $end, $course_id = null, $group_id = null, $user_id = 0)
 {
     switch ($this->type) {
         case 'admin':
             $this->get_platform_events($start, $end);
             break;
         case 'course':
             $session_id = api_get_session_id();
             $course_info = api_get_course_info_by_id($course_id);
             $this->get_course_events($start, $end, $course_info, $group_id, $session_id, $user_id);
             break;
         case 'personal':
         default:
             //Getting personal events
             $this->get_personal_events($start, $end);
             //Getting platform/admin events
             $this->get_platform_events($start, $end);
             //Getting course events
             $my_course_list = array();
             if (!api_is_anonymous()) {
                 $session_list = SessionManager::get_sessions_by_user(api_get_user_id());
                 $my_course_list = CourseManager::get_courses_list_by_user_id(api_get_user_id(), true);
             }
             if (!empty($session_list)) {
                 foreach ($session_list as $session_item) {
                     $my_courses = $session_item['courses'];
                     $my_session_id = $session_item['session_id'];
                     if (!empty($my_courses)) {
                         foreach ($my_courses as $course_item) {
                             $course_info = api_get_course_info_by_id($course_item['id']);
                             $this->get_course_events($start, $end, $course_info, 0, $my_session_id);
                         }
                     }
                 }
             }
             if (!empty($my_course_list)) {
                 foreach ($my_course_list as $course_info_item) {
                     if (isset($course_id) && !empty($course_id)) {
                         if ($course_info_item['real_id'] == $course_id) {
                             $this->get_course_events($start, $end, $course_info_item);
                         }
                     } else {
                         $this->get_course_events($start, $end, $course_info_item);
                     }
                 }
             }
             break;
     }
     if (!empty($this->events)) {
         return json_encode($this->events);
     }
     return '';
 }
开发者ID:ilosada,项目名称:chamilo-lms-icpna,代码行数:62,代码来源:agenda.lib.php

示例6: get_access_link_by_user

 /**
  * Return a link to go to the course, validating the visibility of the
  * course and the user status
  * @param int User ID
  * @param array Course details array
  * @param array  List of courses to which the user is subscribed (if not provided, will be generated)
  * @return mixed 'enter' for a link to go to the course or 'register' for a link to subscribe, or false if no access
  */
 static function get_access_link_by_user($uid, $course, $user_courses = array())
 {
     if (empty($uid) or empty($course)) {
         return false;
     }
     if (empty($user_courses)) {
         // get the array of courses to which the user is subscribed
         $user_courses = CourseManager::get_courses_list_by_user_id($uid);
         foreach ($user_courses as $k => $v) {
             $user_courses[$k] = $v['real_id'];
         }
     }
     if (!isset($course['real_id']) && empty($course['real_id'])) {
         $course = api_get_course_info($course['code']);
     }
     if ($course['visibility'] == COURSE_VISIBILITY_HIDDEN) {
         return array();
     }
     $is_admin = api_is_platform_admin_by_id($uid);
     $options = array();
     // Register button
     if (!api_is_anonymous($uid) && ($course['visibility'] == COURSE_VISIBILITY_OPEN_WORLD || $course['visibility'] == COURSE_VISIBILITY_OPEN_PLATFORM) && $course['subscribe'] == SUBSCRIBE_ALLOWED && (!in_array($course['real_id'], $user_courses) || empty($user_courses))) {
         $options[] = 'register';
     }
     // Go To Course button (only if admin, if course public or if student already subscribed)
     if ($is_admin || $course['visibility'] == COURSE_VISIBILITY_OPEN_WORLD && empty($course['registration_code']) || api_user_is_login($uid) && $course['visibility'] == COURSE_VISIBILITY_OPEN_PLATFORM && empty($course['registration_code']) || in_array($course['real_id'], $user_courses) && $course['visibility'] != COURSE_VISIBILITY_CLOSED) {
         $options[] = 'enter';
     }
     if ($is_admin || $course['visibility'] == COURSE_VISIBILITY_OPEN_WORLD && empty($course['registration_code']) || api_user_is_login($uid) && $course['visibility'] == COURSE_VISIBILITY_OPEN_PLATFORM && empty($course['registration_code']) || in_array($course['real_id'], $user_courses) && $course['visibility'] != COURSE_VISIBILITY_CLOSED) {
         $options[] = 'enter';
     }
     if ($course['visibility'] != COURSE_VISIBILITY_HIDDEN && empty($course['registration_code']) && $course['unsubscribe'] == UNSUBSCRIBE_ALLOWED && api_user_is_login($uid) && in_array($course['real_id'], $user_courses)) {
         $options[] = 'unsubscribe';
     }
     return $options;
 }
开发者ID:feroli1000,项目名称:chamilo-lms,代码行数:44,代码来源:course.lib.php

示例7: show_form

function show_form()
{
    global $types;
    global $tools;
    echo '<div class="formulario">';
    echo '<form enctype="multipart/form-data" action="' . api_get_self() . '" method="post" name="send_ticket" id="send_ticket"
 	onsubmit="return validate()" style="width:100%">';
    $courses_list = CourseManager::get_courses_list_by_user_id($user_id, false, true);
    $select_course = '<div id="user_request" >
	 </div>';
    echo $select_course;
    //select status
    $select_tool = '<div class="row"  >
	<div class="label2"  >Herramienta:</div>
	<div class="formw2">';
    $select_tool .= '<select style="width: 95%; " name = "tool" id="tool" >';
    $status = TicketManager::get_all_tickets_status();
    foreach ($tools as $tool) {
        $select_tool .= "<option value = '" . $tool['id'] . "' selected >" . $tool['name'] . "</option>";
    }
    $select_tool .= "</select>";
    $select_tool .= '</div></div>';
    echo $select_tool;
    echo '<div class="row">
			<div class="label2">Desde:</div>
			<div class="formw2"><input id="keyword_start_date_start" name="keyword_start_date_start" type="text"></div>
		  </div>
			<div class="row">
			<div class="label2">Hasta</div>
			<div class="formw2"><input id="keyword_start_date_end" name="keyword_start_date_end" type="text"></div>
			</div>';
    echo '</div>';
    echo '<div class="row">
		<div class="label2">
		</div>
		<div class="formw2">
			<button class="save" name="report" type="submit" id="btnsubmit" disabled="disabled">Generar Reporte</button>
		</div>
	</div>';
}
开发者ID:ragebat,项目名称:chamilo-lms,代码行数:40,代码来源:report.php

示例8: array

}
echo $navigation;
$user_list = UserManager::get_user_list(array(), array(), $begin, $default);
$session_list = SessionManager::get_sessions_list(array(), array('name'));
$options = '';
$options .= '<option value="0">--' . get_lang('SelectASession') . '--</option>';
foreach ($session_list as $session_data) {
    $my_session_list[$session_data['id']] = $session_data['name'];
    $options .= '<option value="' . $session_data['id'] . '">' . $session_data['name'] . '</option>';
}
$combinations = array();
if (!empty($user_list)) {
    foreach ($user_list as $user) {
        $user_id = $user['user_id'];
        $name = $user['firstname'] . ' ' . $user['lastname'];
        $course_list_registered = CourseManager::get_courses_list_by_user_id($user_id, true, false);
        $new_course_list = array();
        foreach ($course_list_registered as $course_reg) {
            if (empty($course_reg['session_id'])) {
                $course_reg['session_id'] = 0;
            }
            // Recover the code for historical reasons. If it can be proven
            // that the code can be safely replaced by c_id in the following
            // PHP code, feel free to do so
            $courseInfo = api_get_course_info_by_id($course_reg['real_id']);
            $course_reg['code'] = $courseInfo['code'];
            $new_course_list[] = $course_reg['code'] . '_' . $course_reg['session_id'];
        }
        $course_list = get_courses_list_by_user_id_based_in_exercises($user_id);
        if (is_array($course_list) && !empty($course_list)) {
            foreach ($course_list as $my_course) {
开发者ID:KRCM13,项目名称:chamilo-lms,代码行数:31,代码来源:user_move_stats.php

示例9: foreach

        $coaches = CourseManager::get_coachs_from_course($selectedSession, $course['id']);
        if ($coaches) {
            foreach ($coaches as $coach) {
                $totalTime = UserManager::getTimeSpentInCourses($coach['user_id'], $course['id'], $selectedSession, $selectedFrom, $selectedUntil);
                $formattedTime = api_format_time($totalTime);
                $timeReport->data[] = array('session' => $sessionData, 'course' => $courseData, 'coach' => array('userId' => $coach['user_id'], 'lastname' => $coach['lastname'], 'firstname' => $coach['firstname'], 'username' => $coach['username'], 'completeName' => api_get_person_name($coach['firstname'], $coach['lastname'])), 'totalTime' => $formattedTime);
            }
        }
    }
}
if (!empty($selectedTeacher)) {
    $withFilter = true;
    $teacher = api_get_user_info();
    $teacherData = array('userId' => $teacher['user_id'], 'lastname' => $teacher['lastname'], 'firstname' => $teacher['firstname'], 'username' => $teacher['username'], 'completeName' => $teacher['complete_name']);
    $reportTitle = sprintf(get_lang('TimeReportForTeacherX'), $teacher['complete_name']);
    $courses = CourseManager::get_courses_list_by_user_id($selectedTeacher, false);
    if (!empty($courses)) {
        foreach ($courses as $course) {
            $courseInfo = api_get_course_info_by_id($course['real_id']);
            $totalTime = UserManager::getTimeSpentInCourses($selectedTeacher, $course['real_id'], 0, $selectedFrom, $selectedUntil);
            $formattedTime = api_format_time($totalTime);
            $timeReport->data[] = array('session' => null, 'course' => array('id' => $courseInfo['real_id'], 'name' => $courseInfo['title']), 'coach' => $teacherData, 'totalTime' => $formattedTime);
        }
    }
    $coursesInSession = SessionManager::getCoursesListByCourseCoach($selectedTeacher);
    foreach ($coursesInSession as $userCourseSubscription) {
        $course = $userCourseSubscription->getCourse();
        $session = $userCourseSubscription->getSession();
        $totalTime = UserManager::getTimeSpentInCourses($selectedTeacher, $course->getId(), $session->getId(), $selectedFrom, $selectedUntil);
        $formattedTime = api_format_time($totalTime);
        $timeReport->data[] = array('session' => ['id' => $session->getId(), 'name' => $session->getName()], 'course' => array('id' => $course->getId(), 'name' => $course->getTitle()), 'coach' => $teacherData, 'totalTime' => $formattedTime);
开发者ID:omaoibrahim,项目名称:chamilo-lms,代码行数:31,代码来源:teacher_time_report.php

示例10: get_lang

    if (!SessionManager::isValidId($selectedSession)) {
        Session::write('reportErrorMessage', get_lang('NoSession'));
        header("Location: {$selfUrl}");
        exit;
    }
    $coursesList = SessionManager::get_course_list_by_session_id($selectedSession);
    if (is_array($coursesList)) {
        foreach ($coursesList as &$course) {
            $course['real_id'] = $course['id'];
        }
    }
} else {
    if (api_is_student_boss()) {
        $coursesList = CourseManager::getCoursesFollowedByGroupAdmin($userId);
    } else {
        $coursesList = CourseManager::get_courses_list_by_user_id($userId, false, true);
        if (is_array($coursesList)) {
            foreach ($coursesList as &$course) {
                $courseInfo = api_get_course_info_by_id($course['real_id']);
                $course = array_merge($course, $courseInfo);
            }
        }
    }
}
foreach ($coursesList as $course) {
    if (isset($course['real_id'])) {
        $courses[$course['real_id']] = $course['title'];
    } else {
        $courses[$course['id']] = $course['title'];
    }
}
开发者ID:KRCM13,项目名称:chamilo-lms,代码行数:31,代码来源:certificate_report.php

示例11: show_form_send_ticket

function show_form_send_ticket()
{
    global $types, $plugin;
    echo '<div class="divTicket">';
    echo '<form enctype="multipart/form-data" action="' . api_get_self() . '" method="post" name="send_ticket" id="send_ticket"
 	onsubmit="return validate()" style="width:100%">';
    echo '<input name="user_id_request" id="user_id_request" type="hidden" value="">';
    // Category
    $select_types = '<div class="row">
	<div class="label2">' . get_lang('Category') . ': </div>
       <div class="formw2">';
    $select_types .= '<select style="width: 95%; "   name = "category_id" id="category_id" onChange="changeType();">';
    $select_types .= '<option value="0">---' . get_lang('Select') . '---</option>';
    foreach ($types as $type) {
        $select_types .= "<option value = '" . $type['category_id'] . "'>" . $type['name'] . ":  <br/>" . $type['description'] . "</option>";
    }
    $select_types .= "</select>";
    $select_types .= '</div></div>';
    echo $select_types;
    // Course
    $courses_list = CourseManager::get_courses_list_by_user_id($user_id, false, true);
    $select_course = '<div id="user_request" >
	 </div>';
    echo $select_course;
    // Status
    $status = array();
    $status[NEWTCK] = $plugin->get_lang('StsNew');
    $status[PENDING] = $plugin->get_lang('StsPending');
    $status[UNCONFIRMED] = $plugin->get_lang('StsUnconfirmed');
    $status[CLOSE] = $plugin->get_lang('StsClose');
    $status[REENVIADO] = $plugin->get_lang('StsReenviado');
    $select_status = '
	<div class="row"  >
		<div class="label2"  >' . get_lang('Status') . ': </div>
		<div class="formw2">
			<select style="width: 95%; " name = "status_id" id="status_id">';
    //$status = TicketManager::get_all_tickets_status();
    foreach ($status as $sts_key => $sts_name) {
        if ($sts_key == 'PND') {
            $select_status .= "<option value = '" . $sts_key . "' selected >" . $sts_name . "</option>";
        } else {
            $select_status .= "<option value = '" . $sts_key . "'>" . $sts_name . "</option>";
        }
    }
    $select_status .= '
			</select>
		</div>
	</div>';
    echo $select_status;
    // Source
    $source = array();
    $source[SRC_EMAIL] = $plugin->get_lang('SrcEmail');
    $source[SRC_PHONE] = $plugin->get_lang('SrcPhone');
    $source[SRC_PRESC] = $plugin->get_lang('SrcPresential');
    $select_source = '
	<div class="row">
	<div class="label2">' . $plugin->get_lang('Source') . ':</div>
       <div class="formw2">
			<select style="width: 95%; " name="source_id" id="source_id" >';
    foreach ($source as $src_key => $src_name) {
        $select_source .= "<option value = '" . $src_key . "'>" . $src_name . "</option>";
    }
    $select_source .= '
			</select>
		</div>
	</div>';
    echo $select_source;
    // Subject
    echo '<div class="row" ><div class ="label2">' . get_lang('Subject') . ':</div>
       		<div class="formw2"><input type = "text" id ="subject" name="subject" value="" required ="" style="width:94%"/></div>
		  </div>';
    // Email
    echo '<div class="row" id="divEmail" ><div class ="label2">' . $plugin->get_lang('PersonalEmail') . ':</div>
       		<div class="formw2"><input type = "email" id ="personal_email" name="personal_email" value=""  style="width:94%"/></div>
		  </div>';
    echo '<input name="project_id" id="project_id" type="hidden" value="">';
    echo '<input name="other_area" id="other_area" type="hidden" value="">';
    echo '<input name="email" id="email" type="hidden" value="">';
    // Message
    echo '<div class="row">
		<div class="label2">' . get_lang('Message') . '</div>
		<div class="formw2">
			<input type="hidden" id="content" name="content" value="" style="display:none">
		<input type="hidden" id="content___Config" value="ToolbarSet=Messages&amp;Width=95%25&amp;Height=250&amp;ToolbarSets={ %22Messages%22: [  [ %22Bold%22,%22Italic%22,%22-%22,%22InsertOrderedList%22,%22InsertUnorderedList%22,%22Link%22,%22RemoveLink%22 ] ], %22MessagesMaximized%22: [  ] }&amp;LoadPlugin=[%22customizations%22]&amp;EditorAreaStyles=body { background: #ffffff; }&amp;ToolbarStartExpanded=false&amp;CustomConfigurationsPath=/main/inc/lib/fckeditor/myconfig.js&amp;EditorAreaCSS=/main/css/chamilo/default.css&amp;ToolbarComboPreviewCSS=/main/css/chamilo/default.css&amp;DefaultLanguage=es&amp;ContentLangDirection=ltr&amp;AdvancedFileManager=true&amp;BaseHref=' . api_get_path(WEB_PLUGIN_PATH) . PLUGIN_NAME . '/s/&amp;&amp;UserIsCourseAdmin=true&amp;UserIsPlatformAdmin=true" style="display:none">
		<iframe id="content___Frame" src="/main/inc/lib/fckeditor/editor/fckeditor.html?InstanceName=content&amp;Toolbar=Messages" width="95%" height="250" frameborder="0" scrolling="no" style="margin: 0px; padding: 0px; border: 0px; background-color: transparent; background-image: none; width: 95%; height: 250px;">
		</iframe>
		</div>
	</div>';
    // Phone
    echo '<div class="row" ><div class ="label2">' . get_lang('Phone') . ' (' . $plugin->get_lang('Optional') . '):</div>
       		<div class="formw2"><input type = "text" id ="phone" name="phone" value="" onkeyup="valid(this,' . "'allowspace'" . ')" onblur="valid(this,' . "'allowspace'" . ')" style="width:94%"/></div>
		  </div>';
    // Priority
    $select_priority = '<div class="row"  >
	<div class="label2"  >' . $plugin->get_lang('Priority') . ': </div>
	<div class="formw2">';
    $priority = array();
    $priority[NORMAL] = $plugin->get_lang('PriorityNormal');
    $priority[HIGH] = $plugin->get_lang('PriorityHigh');
    $priority[LOW] = $plugin->get_lang('PriorityLow');
//.........这里部分代码省略.........
开发者ID:ragebat,项目名称:chamilo-lms,代码行数:101,代码来源:new_ticket.php

示例12: isset

     $end = isset($_REQUEST['end']) ? api_strtotime($_REQUEST['end']) : null;
     if ($type == 'personal' && !empty($sessionId)) {
         $agenda->setSessionId($sessionId);
     }
     $events = $agenda->getEvents($start, $end, api_get_course_int_id(), $groupId, $userId);
     echo $events;
     break;
 case 'get_user_agenda':
     //Used in the admin user list
     api_protect_admin_script();
     if (api_is_allowed_to_edit(null, true)) {
         //@todo move this in the agenda class
         $DaysShort = api_get_week_days_short();
         $MonthsLong = api_get_months_long();
         $user_id = intval($_REQUEST['user_id']);
         $my_course_list = CourseManager::get_courses_list_by_user_id($user_id, true);
         if (!is_array($my_course_list)) {
             // this is for the special case if the user has no courses (otherwise you get an error)
             $my_course_list = array();
         }
         $today = getdate();
         $year = !empty($_GET['year']) ? (int) $_GET['year'] : null;
         if ($year == null) {
             $year = $today['year'];
         }
         $month = !empty($_GET['month']) ? (int) $_GET['month'] : null;
         if ($month == null) {
             $month = $today['mon'];
         }
         $day = !empty($_GET['day']) ? (int) $_GET['day'] : null;
         if ($day == null) {
开发者ID:jloguercio,项目名称:chamilo-lms,代码行数:31,代码来源:agenda.ajax.php

示例13: show_form_send_ticket

/**
 *
 * @global array $types
 * @global object $plugin
 */
function show_form_send_ticket()
{
    global $types, $plugin;
    $courses_list = CourseManager::get_courses_list_by_user_id(api_get_user_id(), false, true);
    echo '<div class="divTicket">';
    echo '<form enctype="multipart/form-data" action="' . api_get_self() . '" method="post" name="send_ticket" id="send_ticket"
 	onsubmit="return validate()" style="width:100%">';
    $select_types = '<div class="row">
	<div class="label2">' . get_lang('Category') . ': </div>
       <div class="formw2">';
    $select_types .= '<select style="width: 95%; "   name = "category_id" id="category_id" onChange="changeType();">';
    $select_types .= '<option value="0">---' . get_lang('Select') . '---</option>';
    foreach ($types as $type) {
        $select_types.= "<option value = '" . $type['category_id'] . "'>" . $type['name'] . ":  <br/>" . $type['description'] . "</option>";
    }
    $select_types .= "</select>";
    $select_types .= '</div></div>';
    echo $select_types;
    $select_course = '<div class="row" id="divCourse" >
	<div class="label2"  >' . get_lang('Course') . ':</div>
            <div class="formw2">';
    $select_course .= '<select  class="chzn-select" name = "course_id" id="course_id"  style="width: 40%; display:none;">';
    $select_course .= '<option value="0">---' . get_lang('Select') . '---</option>';
    foreach ($courses_list as $course) {
        $select_course.= "<option value = '" . $course['course_id'] . "'>" . $course['title'] . "</option>";
    }
    $select_course .= "</select>";
    $select_course .= '</div></div>';
    echo $select_course;
    echo '<div class="row" ><div class ="label2">' . get_lang('Subject') . ':</div>
       		<div class="formw2"><input type = "text" id ="subject" name="subject" value="" required ="" style="width:94%"/></div>
		  </div>';
    echo '<div class="row" id="divEmail" ><div class ="label2">' . $plugin->get_lang('PersonalEmail') . ':</div>
       		<div class="formw2"><input type = "email" id ="personal_email" name="personal_email" value=""  style="width:94%"/></div>
		  </div>';
    echo '<input name="project_id" id="project_id" type="hidden" value="">';
    echo '<input name="other_area" id="other_area" type="hidden" value="">';
    echo '<input name="email" id="email" type="hidden" value="">';
    echo '<div class="row">
		<div class="label2">' . get_lang('Message') . '</div>
		<div class="formw2">
			<input type="hidden" id="content" name="content" value="" style="display:none">
		<input type="hidden" id="content___Config" value="ToolbarSet=Messages&amp;Width=95%25&amp;Height=250&amp;ToolbarSets={ %22Messages%22: [  [ %22Bold%22,%22Italic%22,%22-%22,%22InsertOrderedList%22,%22InsertUnorderedList%22,%22Link%22,%22RemoveLink%22 ] ], %22MessagesMaximized%22: [  ] }&amp;LoadPlugin=[%22customizations%22]&amp;EditorAreaStyles=body { background: #ffffff; }&amp;ToolbarStartExpanded=false&amp;CustomConfigurationsPath='.api_get_path(WEB_CODE_PATH).'inc/lib/fckeditor/myconfig.js&amp;EditorAreaCSS='.api_get_path(WEB_PATH).'main/css/chamilo/default.css&amp;ToolbarComboPreviewCSS='.api_get_path(WEB_CODE_PATH).'css/chamilo/default.css&amp;DefaultLanguage=es&amp;ContentLangDirection=ltr&amp;AdvancedFileManager=true&amp;BaseHref=' . api_get_path(WEB_PLUGIN_PATH) . PLUGIN_NAME . '/s/&amp;&amp;UserIsCourseAdmin=true&amp;UserIsPlatformAdmin=true" style="display:none">
		<iframe id="content___Frame" src="'.api_get_path(WEB_CODE_PATH).'inc/lib/fckeditor/editor/fckeditor.html?InstanceName=content&amp;Toolbar=Messages" width="95%" height="250" frameborder="0" scrolling="no" style="margin: 0px; padding: 0px; border: 0px; background-color: transparent; background-image: none; width: 95%; height: 250px;">
		</iframe>
		</div>
	</div>';
    echo '<div class="row" ><div class ="label2">' . get_lang('Phone') . ' (' . $plugin->get_lang('Optional') . '):</div>
       		<div class="formw2"><input type = "text" id ="phone" name="phone" value="" onkeyup="valid(this,' . "'allowspace'" . ')" onblur="valid(this,' . "'allowspace'" . ')" style="width:94%"/></div>
		</div>';
    echo '<div class="row">
		<div class="label2">' . get_lang('FilesAttachment') . '</div>
		<div class="formw2">
				<span id="filepaths">
				<div id="filepath_1">
					<input type="file" name="attach_1" id="attach_1"  size="20" style="width:94%;"/>
				</div></span>
		</div>
	</div>';
    echo '<div class="row">
		<div class="formw2">
			<span id="link-more-attach">
				<a href="javascript://" onclick="return add_image_form()">' . get_lang('AddOneMoreFile') . '</a></span>&nbsp;
					(' . sprintf(get_lang('MaximunFileSizeX'), format_file_size(api_get_setting('message_max_upload_filesize'))) . ')
			</div>
		</div>';
    echo '<div class="row">
		<div class="label2">
		</div>
		<div class="formw2"><button class="save" name="compose"  type="submit" id="btnsubmit">' . get_lang('SendMessage') . '</button>
		</div>
	</div>';
    echo '</form></div>';
}
开发者ID:annickvdp,项目名称:Chamilo1.9.10,代码行数:79,代码来源:send_ticket.php

示例14: array

// 5. edit personal agenda
if (!empty($_GET['action']) && $_GET['action'] == 'edit_personal_agenda_item' and !$_POST['Submit']) {
    $process = "edit_personal_agenda_item";
}
if (!empty($_GET['action']) && $_GET['action'] == 'edit_personal_agenda_item' and $_POST['Submit']) {
    $process = "store_personal_agenda_item";
}
// 6. delete personal agenda
if (!empty($_GET['action']) && $_GET['action'] == "delete" and $_GET['id']) {
    $process = "delete_personal_agenda_item";
}
// OUTPUT
if (isset($_user['user_id'])) {
    // getting all the courses that this user is subscribed to
    //$courses_dbs = get_all_courses_of_user();
    $my_course_list = CourseManager::get_courses_list_by_user_id(api_get_user_id(), true);
    if (!is_array($my_course_list)) {
        // this is for the special case if the user has no courses (otherwise you get an error)
        $my_course_list = array();
    }
    // setting and/or getting the year, month, day, week
    $today = getdate();
    $year = !empty($_GET['year']) ? (int) $_GET['year'] : NULL;
    if ($year == NULL) {
        $year = $today['year'];
    }
    $month = !empty($_GET['month']) ? (int) $_GET['month'] : NULL;
    if ($month == NULL) {
        $month = $today['mon'];
    }
    $day = !empty($_GET['day']) ? (int) $_GET['day'] : NULL;
开发者ID:annickvdp,项目名称:Chamilo1.9.10,代码行数:31,代码来源:myagenda.php

示例15: switch

switch ($action) {
    case 'add_course_vote':
        $course_id = intval($_REQUEST['course_id']);
        $star = intval($_REQUEST['star']);
        if (!api_is_anonymous()) {
            CourseManager::add_course_vote($user_id, $star, $course_id, 0);
        }
        $point_info = CourseManager::get_course_ranking($course_id, 0);
        $ajax_url = api_get_path(WEB_AJAX_PATH) . 'course.ajax.php?a=add_course_vote';
        $rating = Display::return_rating_system('star_' . $course_id, $ajax_url . '&amp;course_id=' . $course_id, $point_info, false);
        echo $rating;
        break;
    case 'get_user_courses':
        if (api_is_platform_admin()) {
            $user_id = intval($_POST['user_id']);
            $list_course_all_info = CourseManager::get_courses_list_by_user_id($user_id, false);
            if (!empty($list_course_all_info)) {
                foreach ($list_course_all_info as $course_item) {
                    $course_info = api_get_course_info($course_item['code']);
                    echo $course_info['title'] . '<br />';
                }
            } else {
                echo get_lang('UserHasNoCourse');
            }
        }
        break;
    case 'search_category':
        require_once api_get_path(LIBRARY_PATH) . 'course_category.lib.php';
        if (api_is_platform_admin() || api_is_allowed_to_create_course()) {
            $results = searchCategoryByKeyword($_REQUEST['q']);
            if (!empty($results)) {
开发者ID:annickvdp,项目名称:Chamilo1.9.10,代码行数:31,代码来源:course.ajax.php


注:本文中的CourseManager::get_courses_list_by_user_id方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。