function show_image(image,width,height) { width = parseInt(width) + 20; height = parseInt(height) + 20; window_x = window.open(image,\'windowX\',\'width=\'+ width + \', height=\'+ height + \'\'); } '; $editMainUserInfo = Security::remove_XSS($_REQUEST['editMainUserInfo']); $uInfo = $editMainUserInfo; $this_section = SECTION_COURSES; $nameTools = get_lang('Users'); api_protect_course_script(true); $tool_info = api_get_tool_information_by_name(TOOL_USER); if (api_is_anonymous()) { api_not_allowed(true); } //prepare variables used in userInfoLib.php functions $TBL_USERINFO_DEF = Database:: get_course_table(TABLE_USER_INFO_DEF); $TBL_USERINFO_CONTENT = Database:: get_course_table(TABLE_USER_INFO_CONTENT); if (1 == $tool_info['visibility']) { $interbreadcrumb[] = ['url' => 'user.php', 'name' => get_lang('Users')]; } if ('learnpath' != $origin) { //so we are not in learnpath tool Display :: display_header($nameTools, "User"); $origin = Security::remove_XSS($_GET['origin']); } else { ?> '; if ('users' == $origin) { echo ''. Display::return_icon('back.png', get_lang('Back to users list'), '', ICON_SIZE_MEDIUM).''; } else { echo ''. Display::return_icon('back.png', get_lang('Back'), '', ICON_SIZE_MEDIUM).''; } if (!is_numeric($_GET['editMainUserInfo'])) { if ('true' == api_get_setting('allow_user_course_subscription_by_course_admin')) { echo ''. Display::return_icon('edit.png', get_lang('Edit this user'), '', ICON_SIZE_MEDIUM).get_lang( 'Edit this user' ).''; } } else { if ('true' == api_get_setting('allow_user_course_subscription_by_course_admin')) { echo ''. Display::return_icon( 'user.png', get_lang('View this user'), '', ICON_SIZE_MEDIUM ).get_lang('View this user').''; } } echo ''.Display::return_icon('statistics.png', get_lang('Reporting for this user'), '', ICON_SIZE_MEDIUM).get_lang('Reporting for this user').''; echo ''; } else { if (1 == $tool_info['visibility']) { echo '
'; if ('users' == $origin) { echo ''. Display::return_icon( 'back.png', get_lang('Back to users list'), '', ICON_SIZE_MEDIUM ).''; } else { echo ''.Display::return_icon( 'back.png', get_lang('Back'), '', ICON_SIZE_MEDIUM ).''; } echo '
'; } } // get information about user id viewed $user_info_viewed = api_get_user_info($userIdViewed); $is_session_course_coach = UserManager::is_session_course_coach( $userIdViewed, $_course['sysCode'], $current_session_id ); if ("viewDefEdit" == $displayMode) { /* CATEGORIES DEFINITIONS : EDIT */ $catToEdit = get_cat_def($_GET['editDef']); $edit_heading_form = new FormValidator('edit_heading_form'); $edit_heading_form->addElement('hidden', 'id'); $edit_heading_form->add_textfield('title', get_lang('Title')); $edit_heading_form->addElement('textarea', 'comment', get_lang('Comment'), ['cols' => 60, 'rows' => 4]); $possible_line_nrs[1] = '1 '.get_lang('Line'); $possible_line_nrs[3] = '3 '.get_lang('lines'); $possible_line_nrs[5] = '5 '.get_lang('lines'); $possible_line_nrs[10] = '10 '.get_lang('lines'); $possible_line_nrs[15] = '15 '.get_lang('lines'); $edit_heading_form->addElement('select', 'nbline', get_lang('Line Number'), $possible_line_nrs); $edit_heading_form->addElement('submit', 'submitDef', get_lang('Validate')); $edit_heading_form->setDefaults($catToEdit); $edit_heading_form->display(); } elseif ("viewDefList" == $displayMode) { $catList = get_cat_def_list(); if ($catList) { foreach ($catList as $thisCat) { // displays Title and comments echo "

", "".htmlize($thisCat['title'])."
\n", "".htmlize($thisCat['comment'])."\n", "

"; // displays lines echo "
\n", "\n"; for ($i = 1; $i <= $thisCat['nbline']; $i++) { echo "
__________________________________________\n"; } echo "
\n", "
\n"; // displays commands echo "", "\"".get_lang('Remove')."\"", "", "", "\"".get_lang('Edit')."\"", "", "", "\"".get_lang('Move", "", "", "\"".get_lang('Move", "\n"; } // end for each } // end if ($catList) echo "
\n", "
", "", "
\n", "
\n"; } elseif ('viewContentEdit' == $displayMode) { /* CATEGORIES CONTENTS : EDIT */ $catToEdit = get_cat_content($userIdViewed, $_GET['editContent']); $content_heading_form = new FormValidator('content_heading_form'); $content_heading_form->addElement('hidden', 'cntId'); $content_heading_form->addElement('hidden', 'catId'); $content_heading_form->addElement('hidden', 'uInfo'); $content_heading_form->addElement('static', null, $catToEdit['title'], htmlize($catToEdit['comment'])); if (1 == $catToEdit['nbline']) { $content_heading_form->addElement('text', 'content', null, ['size' => 80]); } else { $content_heading_form->addElement( 'textarea', 'content', null, ['cols' => 60, 'rows' => $catToEdit['nbline']] ); } $content_heading_form->addElement('submit', 'submitContent', get_lang('Validate')); $defaults = $catToEdit; $defaults['cntId'] = $catToEdit['contentId']; $defaults['uInfo'] = $userIdViewed; $content_heading_form->setDefaults($defaults); $content_heading_form->display(); } elseif ("viewMainInfoEdit" == $displayMode) { $mainUserInfo = api_get_user_info($userIdViewed); if ($mainUserInfo) { (COURSEMANAGER == $mainUserInfo['status']) ? $courseAdminChecked = "checked" : $courseAdminChecked = ""; $image_array = UserManager::get_user_picture_path_by_id($userIdViewed, 'web', false, true); // get the path,width and height from original picture $big_image = $image_array['dir'].'big_'.$image_array['file']; $big_image_size = api_getimagesize($big_image); $big_image_width = $big_image_size['width']; $big_image_height = $big_image_size['height']; $url_big_image = $big_image.'?rnd='.time(); if ('unknown.jpg' == $image_array['file']) { echo ''; } else { echo ''; } echo "
\n", "\n", "", "\n", "\n", "\n"; echo "\n", "", "\n", ""; //récupérer horaire de l'élève $course_id = $_course['real_id']; ?>

'; if (!($is_courseAdmin && $_user['user_id'] == $userIdViewed)) { } else { echo "\n"; } echo "\n", "", "
", get_lang('Name'), "", get_lang('Schedule'), "
", htmlize(api_get_person_name($mainUserInfo['firstName'], $mainUserInfo['lastName'])), "", $mainUserInfo['official_code'], " ", get_lang('Teacher'), "
", "
\n"; if ('true' == api_get_setting('show_email_addresses')) { echo "

".Display:: encrypted_mailto_link($mainUserInfo['email'], $mainUserInfo['email'])."

"; } if ('true' == api_get_setting('extended_profile')) { if (!empty($mainUserInfo['competences'])) { echo '
'.get_lang('My competences').'
'.$mainUserInfo['competences'].'
'; } if (!empty($mainUserInfo['diplomas'])) { echo '
'.get_lang('My diplomas').'
'.$mainUserInfo['diplomas'].'
'; } if (!empty($mainUserInfo['teach'])) { echo '
'.get_lang('What I am able to teach').'
'.$mainUserInfo['teach'].'
'; } if (!empty($mainUserInfo['openarea'])) { echo '
'.get_lang('My personal open area').'
'.$mainUserInfo['openarea'].'
'; } if (!empty($mainUserInfo['competences'])) { echo '
'.get_lang('My productions').'
'.UserManager::build_production_list($mainUserInfo['user_id']).'
'; } } } else { echo Display::return_message(get_lang('This learner is subscribed in this training through a training session. You cannot edit his information')); } } elseif ("viewContentList" == $displayMode) { // default display $virtual_course_code = $_GET["virtual_course"]; if (isset($virtual_course_code)) { $courseCode = $virtual_course_code; $allowedToEditDef = false; } $mainUserInfo = api_get_user_info($userIdViewed); if ($mainUserInfo) { $image_array = UserManager::get_user_picture_path_by_id($userIdViewed, 'web', false, true); // get the path,width and height from original picture $big_image = $image_array['dir'].'big_'.$image_array['file']; $big_image_size = api_getimagesize($big_image); $big_image_width = $big_image_size['width']; $big_image_height = $big_image_size['height']; $url_big_image = $big_image.'?rnd='.time(); if ('unknown.jpg' == $image_array['file']) { echo ''; } else { echo ''; } // is the user online? $online = ''; if (user_is_online($userIdViewed)) { $online = Display::return_icon('online.gif', get_lang('Online'), ['style' => 'with="8"; height="8"']); } // DISPLAY TABLE HEADING if ('learnpath' == $origin) { $allowedToEditDef = false; $is_allowedToTrack = false; } echo "", "\n", "\n", "\n", "\n"; echo "\n", "\n", "\n", ""; // DISPLAY TABLE CONTENT if ($current_session_id) { if (COURSEMANAGER == $user_info_viewed['status']) { echo "\n"; } } else { if (STUDENT == $user_info_viewed['status']) { echo "\n"; } else { echo "\n"; } } echo "
".get_lang('Name')."".get_lang('Description')."", get_lang('Code'), "
".$online.' '.htmlize(api_get_person_name($mainUserInfo['firstName'], $mainUserInfo['lastName']))."", $mainUserInfo['official_code'], " - - -
"; if ("true" == api_get_setting("show_email_addresses")) { echo "

".Display::encrypted_mailto_link($mainUserInfo['email'], $mainUserInfo['email'])."

"; } if ('true' == api_get_setting('extended_profile')) { if (!empty($mainUserInfo['competences'])) { echo '
'.get_lang('My competences').'
'.$mainUserInfo['competences'].'
'; } if (!empty($mainUserInfo['diplomas'])) { echo '
'.get_lang('My diplomas').'
'.$mainUserInfo['diplomas'].'
'; } if (!empty($mainUserInfo['teach'])) { echo '
'.get_lang('What I am able to teach').'
'.$mainUserInfo['teach'].'
'; } if (!empty($mainUserInfo['openarea'])) { echo '
'.get_lang('My personal open area').'
'.$mainUserInfo['openarea'].'
'; } if (!empty($mainUserInfo['competences'])) { echo '
'.get_lang('My productions').'
'.UserManager::build_production_list($mainUserInfo['user_id']).'
'; } } } else { Display::return_message(get_lang('This learner is subscribed in this training through a training session. You cannot edit his information'), 'normal'); } if ('true' == api_get_setting('allow_user_headings') && $allowedToEditDef) { // only course administrators see this line echo "
", "
", get_lang('Teachers only')," : ", "", "
", "
", "
\n"; } $catList = get_course_user_info($userIdViewed); if ($catList) { foreach ($catList as $thisCat) { // Category title echo "

", $thisCat['title'], "

\n"; // Category content echo "
\n"; if ($thisCat['content']) { echo htmlize($thisCat['content'])."\n"; } else { echo "...."; } // Edit command if ($allowedToEditContent) { echo "

\n", "", "\"edit\"", "\n"; } echo "
\n"; } } } Display::display_footer();