"user.php", "name" => get_lang('Users')); if ($origin != 'learnpath') { //so we are not in learnpath tool Display :: display_header($nameTools, "User"); } else { ?> $value) { $$key = replace_dangerous_char($value); } /* ============================================================================== FUNCTIONS ============================================================================== */ /* ============================================================================== COMMANDS SECTION ============================================================================== */ $displayMode = "viewContentList"; if ($allowedToEditDef) { if ($submitDef) { if ($id) { edit_cat_def($id, $title, $comment, $nbline); } else { create_cat_def($title, $comment, $nbline); } $displayMode = "viewDefList"; } elseif ($removeDef) { remove_cat_def($removeDef, true); $displayMode = "viewDefList"; } elseif ($editDef) { $displayMode = "viewDefEdit"; } elseif (isset ($addDef)) { $displayMode = "viewDefEdit"; } elseif ($moveUpDef) { move_cat_rank($moveUpDef, "up"); $displayMode = "viewDefList"; } elseif ($moveDownDef) { move_cat_rank($moveDownDef, "down"); $displayMode = "viewDefList"; } elseif ($viewDefList) { $displayMode = "viewDefList"; } elseif ($editMainUserInfo) { $userIdViewed = $editMainUserInfo; $displayMode = "viewMainInfoEdit"; } elseif ($submitMainUserInfo) { $userIdViewed = $submitMainUserInfo; $promoteCourseAdmin ? $userProperties['status'] = 1 : $userProperties['status'] = 5; $promoteTutor ? $userProperties['tutor'] = 1 : $userProperties['tutor'] = 0; $userProperties['role'] = $role; update_user_course_properties($userIdViewed, $courseCode, $userProperties); $displayMode = "viewContentList"; } } // COMMON COMMANDS if ($allowedToEditContent) { if ($submitContent) { if ($cntId) // submit a content change { edit_cat_content($catId, $userIdViewer, $content, $REMOTE_ADDR); } else // submit a totally new content { fill_new_cat_content($catId, $userIdViewer, $content, $REMOTE_ADDR); } $displayMode = "viewContentList"; } elseif ($editContent) { $displayMode = "viewContentEdit"; $userIdViewed = $userIdViewer; } } /* ============================================================================== DISPLAY MODES ============================================================================== */ // Back button for each display mode (Top) echo "
".get_lang('BackUser')."
\n"; if ($displayMode == "viewDefEdit") { /*>>>>>>>>>>>> CATEGORIES DEFINITIONS : EDIT <<<<<<<<<<<<*/ $catToEdit = get_cat_def($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'), array ('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('LineNumber'), $possible_line_nrs); $edit_heading_form->addElement('submit', 'submitDef', get_lang('Ok')); $edit_heading_form->setDefaults($catToEdit); $edit_heading_form->display(); } elseif ($displayMode == "viewDefList") { /*>>>>>>>>>>>> CATEGORIES DEFINITIONS : LIST <<<<<<<<<<<<*/ $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('MoveUp')."\"", "", "", "\"".get_lang('MoveDown')."\"", "\n"; } // end for each } // end if ($catList) echo "
\n", "
", "", "
\n", "
\n"; } elseif ($displayMode == "viewContentEdit") { /*>>>>>>>>>>>> CATEGORIES CONTENTS : EDIT <<<<<<<<<<<<*/ $catToEdit = get_cat_content($userIdViewed, $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'] == 1) ? $courseAdminChecked = "checked" : $courseAdminChecked = ""; ($mainUserInfo['tutor_id'] == 1) ? $tutorChecked = "checked" : $tutorChecked = ""; if ($mainUserInfo['picture'] != '') { $size = @ getImageSize('../upload/users/'.$mainUserInfo['picture']); $vertical_space = (($size[1] > 200) ? 'height="200"' : ''); echo ""; } else { Display::display_icon('unknown.jpg', get_lang('Unknown')); } echo "
\n", "\n", "", "\n", "\n", "\n", "\n", "\n", "\n", "", "\n", "", ""; if (!($is_courseAdmin && $_user['user_id'] == $userIdViewed)) { echo "\n"; } else { echo "\n"; } echo "\n", "", "
", get_lang('Name'), "", get_lang('Role'), "", get_lang('Tutor'), "", get_lang('CourseManager'), "
", htmlize($mainUserInfo['firstName']), " ", htmlize($mainUserInfo['lastName']), "", get_lang('CourseManager'), "
", "
\n"; echo "

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

"; } } elseif ($displayMode == "viewContentList") // default display { /*>>>>>>>>>>>> CATEGORIES CONTENTS : LIST <<<<<<<<<<<<*/ $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) { if ($mainUserInfo['picture'] != '') { $size = @ getImageSize('../upload/users/'.$mainUserInfo['picture']); $vertical_space = (($size[1] > 200) ? 'height="200"' : ''); echo ""; } else { Display::display_icon('unknown.jpg', get_lang('Unknown')); } //DISPLAY TABLE HEADING if ($origin == 'learnpath') { $allowedToEditDef=false; $is_allowedToTrack=false; } echo "", "\n", "\n", "\n", "\n", "\n", ($allowedToEditDef?"\n":""), ($is_allowedToTrack?"\n":""), "\n", "\n", "\n", ""; //DISPLAY TABLE CONTENT if ($mainUserInfo['tutor_id'] == 1) { echo "\n"; } else { echo "\n"; } if ($mainUserInfo['status'] == 1) { echo ""; } else { echo "\n"; } if ($allowedToEditDef) { echo ""; } if ($is_allowedToTrack) { echo ""; } echo "", "
",get_lang('Name'),"",get_lang('Description'),"",get_lang('Tutor'),"",get_lang('CourseManager'),"".get_lang('Edit')."".get_lang('Tracking')."
",htmlize($mainUserInfo['firstName'])," ",htmlize($mainUserInfo['lastName']),"",htmlize($mainUserInfo['role']),"",get_lang('Tutor')," - ",get_lang('CourseManager')," - ", "", "\"\"", "", "", "", "\"".get_lang('Tracking')."", "", "
"; //"

",$mainUserInfo['email'],"", echo "

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

"; } if (get_setting('allow_user_headings') == 'true' && $allowedToEditDef) // only course administrators see this line { echo "
", "
", get_lang('CourseAdministratorOnly')," : ", "", "
", "
", "
\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"; } } } // Back button for each display mode (bottom) echo "
".get_lang('BackUser')."
\n"; /* ============================================================================== FOOTER ============================================================================== */ Display :: display_footer(); ?>