\n";
}
elseif ($displayMode == "viewContentEdit") {
/*>>>>>>>>>>>> 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 ($catToEdit['nbline'] == 1) {
$content_heading_form->addElement('text', 'content', null, array ('size' => 80));
} else {
$content_heading_form->addElement('textarea', 'content', null, array ('cols' => 60, 'rows' => $catToEdit['nbline']));
}
$content_heading_form->addElement('submit', 'submitContent', get_lang('Ok'));
$defaults = $catToEdit;
$defaults['cntId'] = $catToEdit['contentId'];
$defaults['uInfo'] = $userIdViewed;
$content_heading_form->setDefaults($defaults);
$content_heading_form->display();
} elseif ($displayMode == "viewMainInfoEdit") {
/*>>>>>>>>>>>> CATEGORIES MAIN INFO : EDIT <<<<<<<<<<<<*/
$mainUserInfo = get_main_user_info($userIdViewed, $courseCode);
if ($mainUserInfo) {
($mainUserInfo['status'] == COURSEMANAGER) ? $courseAdminChecked = "checked" : $courseAdminChecked = "";
if ($current_session_id) {
($is_session_course_coach)? $tutorChecked = "checked" : $tutorChecked = "";
} else {
($mainUserInfo['tutor_id'] == 1) ? $tutorChecked = "checked" : $tutorChecked = "";
}
$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 ($image_array['file']=='unknown.jpg') {
echo ' ';
} else {
echo ' ';
}
echo "\n";
echo "".Display :: encrypted_mailto_link($mainUserInfo['email'], $mainUserInfo['email'])."
";
if (api_get_setting('extended_profile') == 'true') {
if (!empty($mainUserInfo['competences']))
echo ''.get_lang('MyCompetences').'
'.$mainUserInfo['competences'].'
';
if (!empty($mainUserInfo['diplomas']))
echo ''.get_lang('MyDiplomas').'
'.$mainUserInfo['diplomas'].'
';
if (!empty($mainUserInfo['teach']))
echo ''.get_lang('MyTeach').'
'.$mainUserInfo['teach'].'
';
if (!empty($mainUserInfo['openarea']))
echo ''.get_lang('MyPersonalOpenArea').'
'.$mainUserInfo['openarea'].'
';
if (!empty($mainUserInfo['competences']))
echo ''.get_lang('MyProductions').'
'.UserManager::build_production_list($mainUserInfo['user_id']).'
';
}
} else {
Display :: display_normal_message(get_lang('ThisStudentIsSubscribeThroughASession'));
}
} elseif ($displayMode == "viewContentList") {
// default display
$virtual_course_code = $_GET["virtual_course"];
if (isset ($virtual_course_code)) {
$courseCode = $virtual_course_code;
//not supported yet: editing users of virtual courses
$allowedToEditDef = false;
}
$mainUserInfo = get_main_user_info($userIdViewed, $courseCode);
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 ($image_array['file']=='unknown.jpg') {
echo ' ';
} else {
echo ' ';
}
// is the user online ?
$users_online = who_is_online(30);
foreach ($users_online as $online) {
if (in_array($userIdViewed, $online)) {
$online = Display::return_icon('online.gif', get_lang('OnLine'),array('style'=>'with="8"; height="8"'));
break;
} else {
$online ='';
}
}
//DISPLAY TABLE HEADING
if ($origin == 'learnpath') { $allowedToEditDef=false; $is_allowedToTrack=false; }
//"",get_lang('Tutor')," \n",
echo "",
"\n",
"".get_lang('Name')." \n",
"".get_lang('Description')." \n";
if ($current_session_id) {
if ($user_info_viewed['status'] == COURSEMANAGER) {
echo "".get_lang('Tutor')." \n";
}
} else {
if ($user_info_viewed['status'] == STUDENT) {
echo "".get_lang('Tutor')." \n";
} else {
echo "".get_lang('CourseManager')." \n";
}
}
//echo ($allowedToEditDef && api_get_setting('allow_user_course_subscription_by_course_admin') == 'true'?"".get_lang('Edit')." \n":"");
//echo ($is_allowedToTrack?"".get_lang('Tracking')." \n":"");
echo " \n",
"\n",
"".$online.' '.htmlize(api_get_person_name($mainUserInfo['firstName'], $mainUserInfo['lastName']))." \n",
"".htmlize($mainUserInfo['role'])." ";
//DISPLAY TABLE CONTENT
if ($current_session_id) {
if ($user_info_viewed['status'] == COURSEMANAGER) {
if ($is_session_course_coach) {
echo "",get_lang('Tutor')," \n";
} else {
echo " - \n";
}
}
} else {
if ($user_info_viewed['status'] == STUDENT) {
if ($mainUserInfo['tutor_id'] == 1) {
echo "",get_lang('Tutor')," \n";
} else {
echo " - \n";
}
} else {
if ($mainUserInfo['status'] == 1) {
echo "",get_lang('CourseManager')," ";
} else {
echo " - \n";
}
}
}
if ($allowedToEditDef && api_get_setting('allow_user_course_subscription_by_course_admin') == 'true') {
//echo "";
//echo " ";
//echo " ";
}
if ($is_allowedToTrack) {
//echo "";
//echo " ";
//echo " ";
}
echo "
";
if (api_get_setting("show_email_addresses") == "true") {
echo "". Display::encrypted_mailto_link($mainUserInfo['email'],$mainUserInfo['email']). "
";
} else {
if (api_is_allowed_to_edit()) {
echo "". Display::encrypted_mailto_link($mainUserInfo['email'],$mainUserInfo['email']). "
";
}
}
if (api_get_setting('extended_profile') == 'true') {
if (!empty($mainUserInfo['competences']))
echo ''.get_lang('MyCompetences').'
'.$mainUserInfo['competences'].'
';
if (!empty($mainUserInfo['diplomas']))
echo ''.get_lang('MyDiplomas').'
'.$mainUserInfo['diplomas'].'
';
if (!empty($mainUserInfo['teach']))
echo ''.get_lang('MyTeach').'
'.$mainUserInfo['teach'].'
';
if (!empty($mainUserInfo['openarea']))
echo ''.get_lang('MyPersonalOpenArea').'
'.$mainUserInfo['openarea'].'
';
if (!empty($mainUserInfo['competences']))
echo ''.get_lang('MyProductions').'
'.UserManager::build_production_list($mainUserInfo['user_id']).'
';
}
} else {
Display :: display_normal_message(get_lang('ThisStudentIsSubscribeThroughASession'));
}
if (api_get_setting('allow_user_headings') == 'true' && $allowedToEditDef) // only course administrators see this line
{
echo "",
"",
"
",
"\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",
"",
" ",
" \n";
}
echo " \n";
}
}
}
// Back button for each display mode (bottom)
//echo "\n";
/* FOOTER */
Display :: display_footer();