path = 'block_evaluation_graph'; $this->user_id = $user_id; $this->bg_width = 450; $this->bg_height = 350; if ($this->is_block_visible_for_user($user_id)) { if (!api_is_session_admin()) { $this->courses = CourseManager::get_courses_followed_by_drh($user_id); } $this->sessions = SessionManager::get_sessions_followed_by_drh($user_id); } } /** * This method check if a user is allowed to see the block inside dashboard interface. * * @param int User id * * @return bool Is block visible for user */ public function is_block_visible_for_user($user_id) { $user_info = api_get_user_info($user_id); $user_status = $user_info['status']; $is_block_visible_for_user = false; if (UserManager::is_admin($user_id) || in_array($user_status, $this->permission)) { $is_block_visible_for_user = true; } return $is_block_visible_for_user; } /** * This method return content html containing * information about sessions and its position for showing it inside dashboard interface * it's important to use the name 'get_block' for beeing used from dashboard controller. * * @return array column and content html */ public function get_block() { global $charset; $column = 1; $data = []; $evaluations_base_courses_graph = $this->get_evaluations_base_courses_graph(); $evaluations_courses_in_sessions_graph = $this->get_evaluations_courses_in_sessions_graph(); $html = '
'.api_convert_encoding(get_lang('GraphicNotAvailable'), 'UTF-8').'
'; } else { // display evaluations base courses graph if (!empty($evaluations_base_courses_graph)) { foreach ($evaluations_base_courses_graph as $course_code => $img_html) { $html .= '