Exemplo n.º 1
0
             if ($currentUser->user['user_type'] != 'administrator' && !$supervisesUser) {
                 $userCourses = $currentUser->getUserCourses($constraints);
                 $courses = array_intersect_key($courses, $userCourses);
             }
         }
         $dataSource = $courses;
         $smarty->assign("T_SHOW_COURSE_LESSONS", true);
     }
     include "sorted_table.php";
 } catch (Exception $e) {
     handleAjaxExceptions($e);
 }
 try {
     $userInfo = array();
     $userInfo['general'] = $infoUser->getInformation();
     $userInfo['communication'] = EfrontStats::getUserCommunicationInfo($infoUser);
     if (sizeof($userInfo['communication']['forum_messages'])) {
         $last = current($userInfo['communication']['forum_messages']);
         $userInfo['communication']['forum_last_message'] = formatTimestamp($last['timestamp'], 'time');
     } else {
         $userInfo['communication']['forum_last_message'] = "";
     }
     $userInfo['usage'] = EfrontStats::getUserUsageInfo($infoUser);
     $userInfo['usage']['meanDuration'] = EfrontTimes::formatTimeForReporting($userInfo['usage']['mean_duration'] * 60);
     $userInfo['usage']['monthmeanDuration'] = EfrontTimes::formatTimeForReporting($userInfo['usage']['month_mean_duration'] * 60);
     $userInfo['usage']['weekmeanDuration'] = EfrontTimes::formatTimeForReporting($userInfo['usage']['week_mean_duration'] * 60);
     try {
         $avatar = new EfrontFile($userInfo['general']['avatar']);
         $avatar['id'] != -1 ? $smarty->assign("T_AVATAR", $avatar['id']) : $smarty->assign("T_AVATAR", $avatar['path']);
     } catch (Exception $e) {
         $smarty->assign("T_AVATAR", G_SYSTEMAVATARSPATH . "unknown_small.png");