/** * @brief display form * * @global type $tool_content * @global type $langName * @global type $langSurname * @global type $langEmail * @global type $langCompulsory * @global type $langOptional * @global type $langPhone * @global type $langComments * @global type $langFaculty * @global type $langRegistration * @global type $langLanguage * @global type $langAm * @global type $profreason * @global type $auth_user_info * @global type $auth * @global type $prof * @global string $usercomment * @global int $depid * @global type $email_required * @global type $phone_required * @global type $comment_required * @global type $langEmailNotice * @global Hierarchy $tree * @global type $head_content */ function user_info_form() { global $tool_content, $langName, $langSurname, $langEmail, $langCompulsory, $langOptional, $langPhone, $langComments, $langFaculty, $langRegistration, $langLanguage, $langAm, $profreason, $auth_user_info, $auth, $prof, $usercomment, $depid, $email_required, $phone_required, $comment_required, $langEmailNotice, $tree, $head_content; if (!isset($usercomment)) { $usercomment = ''; } if (!isset($depid)) { $depid = 0; } if (!get_config("email_required")) { $mail_message = $langEmailNotice; } else { $mail_message = ""; } $tool_content .= "<div class='form-wrapper'>\n <form role='form' class='form-horizontal' action='{$_SERVER['SCRIPT_NAME']}' method='post'>\n <fieldset> \n <div class='form-group'>\n <label for='Name' class='col-sm-2 control-label'>{$langName}:</label>\n <div class='col-sm-10'> " . (isset($auth_user_info) ? $auth_user_info['firstname'] : '<input type="text" name="givenname_form" size="30" maxlength="30"' . set('givenname_form') . '> ') . "\n </div>\n </div>\n <div class='form-group'>\n <label for='SurName' class='col-sm-2 control-label'>{$langSurname}:</label>\n <div class='col-sm-10'> " . (isset($auth_user_info) ? $auth_user_info['lastname'] : '<input type="text" name="surname_form" size="30" maxlength="30"' . set('surname_form') . '> ') . "\n </div>\n </div> \n <div class='form-group'>\n <label for='UserEmail' class='col-sm-2 control-label'>{$langEmail}:</label>\n <div class='col-sm-10'>\n <input type='text' name='email' size='30' maxlength='30'" . set('email') . "'>\n " . ($email_required ? " " : "<span class='help-block'><small>{$mail_message}</small></span>") . "\n </div>\n </div>"; if (!$prof) { if (get_config('am_required')) { $am_message = $langCompulsory; } else { $am_message = $langOptional; } $tool_content .= "<div class='form-group'>\n <label for='UserAm' class='col-sm-2 control-label'>{$langAm}:</label>\n <div class='col-sm-10'>\n <input type='text' name='am' size='20' maxlength='20'" . set('am') . "' placeholder='{$am_message}'>\n </div>\n </div>"; } if (isset($phone_required)) { $phone_message = $langCompulsory; } else { $phone_message = $langOptional; } $tool_content .= "<div class='form-group'>\n <label for='UserPhone' class='col-sm-2 control-label'>{$langPhone}:</label>\n <div class='col-sm-10'>\n <input type='text' name='userphone' size='20' maxlength='20'" . set('userphone') . "' placeholder = '{$phone_message}'>\n </div>\n </div>"; if ($comment_required) { $tool_content .= "<div class='form-group'>\n <label for='UserComment' class='col-sm-2 control-label'>{$langComments}:</label>\n <div class='col-sm-10'>\n <textarea name='usercomment' cols='32' rows='4'>" . q($usercomment) . "</textarea> (*) {$profreason}</div>\n </div>"; } $tool_content .= "<div class='form-group'>\n <label for='UserFac' class='col-sm-2 control-label'>{$langFaculty}:</label>\n <div class='col-sm-10'>"; list($js, $html) = $tree->buildNodePicker(array('params' => 'name="department"', 'defaults' => $depid, 'tree' => null, 'useKey' => "id", 'where' => "AND node.allow_user = true", 'multiple' => false)); $head_content .= $js; $tool_content .= $html; $tool_content .= "</div>\n </div>"; $tool_content .= "<div class='form-group'>\n <label for='UserLang' class='col-sm-2 control-label'>{$langLanguage}:</label>\n <div class='col-sm-10'>"; $tool_content .= lang_select_options('localize', "class='form-control'"); $tool_content .= "</div>\n </div>"; $tool_content .= "<div class='col-sm-offset-2 col-sm-10'>\n <input class='btn btn-primary' type='submit' name='submit' value='" . q($langRegistration) . "'>\n </div>\n <input type='hidden' name='p' value='{$prof}'>"; if (isset($_SESSION['shib_uname'])) { $tool_content .= "<input type='hidden' name='uname' value='" . q($_SESSION['shib_uname']) . "'>"; } else { $tool_content .= "<input type='hidden' name='uname' value='" . q($_SESSION['was_validated']['uname']) . "'>"; } $tool_content .= "<input type='hidden' name='auth' value='{$auth}'>"; $tool_content .= "</fieldset>\n </form>\n </div>"; }
function lang_selections() { global $session; if (count($session->active_ui_languages) < 2) { return ' '; } $html = '<form name="langform" action="' . $_SERVER['SCRIPT_NAME'] . '" method="get" >'; $html .= lang_select_options('localize', 'onChange="document.langform.submit();"'); $html .= '</form>'; return $html; }
$link = "<a href = '../auth/mail_verify_change.php?from_profile=TRUE'>{$langHere}</a>."; $message = "<div class='alert alert-warning'>{$langMailNotVerified} {$link}</div>"; default: break; } $tool_content .= "<div class='form-group'><label for='mailstatus' class='col-sm-2 control-label'>{$langVerifiedMail}</label>\n {$message}</div>"; } if (!get_config('restrict_owndep')) { $tool_content .= "<div class='form-group'><label for='faculty' class='col-sm-2 control-label'>{$langFaculty}:</label>"; $tool_content .= "<div class='col-sm-10'>"; list($js, $html) = $tree->buildUserNodePicker(array('defaults' => $userObj->getDepartmentIds($uid))); $head_content .= $js; $tool_content .= $html; $tool_content .= "</div></div>"; } $tool_content .= "<div class='form-group'><label for='language' class='col-sm-2 control-label'>{$langLanguage}:</label>\n <div class='col-sm-10'>" . lang_select_options('userLanguage', "class='form-control'") . "</div>\n </div>"; if ($icon) { $message_pic = $langReplacePicture; $picture = profile_image($uid, IMAGESIZE_SMALL) . " "; $delete = ' ' . icon('fa-times', $langDelete, '#', 'id="delete"') . ' '; } else { $picture = $delete = ''; $message_pic = $langAddPicture; } $tool_content .= "<div class='form-group'>\n <label for='picture' class='col-sm-2 control-label'>{$message_pic}</label>\n <div class='col-sm-10'><span>{$picture}{$delete}</span><input type='file' name='userimage' size='30'></div>\n </div>\n <div class='form-group'> \n <label for='desription' class='col-sm-2 control-label'>{$langDescription}:</label>\n <div class='col-sm-10'>" . rich_text_editor('desc_form', 5, 20, $desc_form) . "</div>\n </div>\n <div class='col-sm-offset-2 col-sm-10'> \n <input class='btn btn-primary' type='submit' name='submit' value='{$langSubmit}'>\n <a href='display_profile.php' class='btn btn-default'>{$langCancel}</a>\n </div> \n </fieldset>\n </form>\n </div>"; draw($tool_content, 1, null, $head_content); /** * * @param type $val * @return int */
<input id='courseinactive' type='radio' name='formvisible' value='3' $visibleChecked[3] $disabledVisibility> <img src='$themeimg/lock_inactive.png' alt='$langInactiveCourse' title='$langInactiveCourse' width='16'> $langInactiveCourse <span class='help-block'><small>$langCourseInactiveShort</small></span> </label> </div> </div> </div> <div class='form-group'> <label for='coursepassword' class='col-sm-2 control-label'>$langOptPassword:</label> <div class='col-sm-10'> <input class='form-control' id='coursepassword' type='text' name='password' value='".@q($password)."' autocomplete='off'> </div> </div> <div class='form-group'> <label for='Options' class='col-sm-2 control-label'>$langLanguage:</label> <div class='col-sm-10'>" . lang_select_options('localize', 'class="form-control"') . "</div> </div> <div class='form-group'> <label class='col-sm-2 control-label'>$langCourseSharing:</label> <div class='col-sm-10'> <div class='radio'> <label> <input type='radio' value='1' name='s_radio' $checkSharingEn $sharing_radio_dis> $langSharingEn </label> </div> <div class='radio'> <label> <input type='radio' value='0' name='s_radio' $checkSharingDis $sharing_radio_dis> $langSharingDis <span class='help-block'><small>$sharing_dis_label</small></span> </label> </div>
$radio_dis = ''; $rating_dis_label = ''; } if (setting_get(SETTING_COURSE_ANONYMOUS_RATING_ENABLE, $course_id) == 1) { $checkDis = ''; $checkEn = 'checked '; } else { $checkDis = 'checked '; $checkEn = ''; } // USER COMMENTS if (setting_get(SETTING_COURSE_COMMENT_ENABLE, $course_id) == 1) { $checkDis = ""; $checkEn = "checked "; } else { $checkDis = "checked "; $checkEn = ""; } $tool_content .= "<div class='form-wrapper'>\n\t<form class='form-horizontal' role='form' method='post' action='{$_SERVER['SCRIPT_NAME']}?course={$course_code}' onsubmit='return validateNodePickerForm();'>\n\t<fieldset>\n\t<div class='form-group'>\n <label for='fcode' class='col-sm-2 control-label'>{$langCode}</label>\n <div class='col-sm-10'>\n <input type='text' class='form-control' name='fcode' id='fcode' value='{$public_code}'>\n </div>\n </div>\n <div class='form-group'>\t \n <label for='title' class='col-sm-2 control-label'>{$langCourseTitle}:</label>\n <div class='col-sm-10'>\n\t\t<input type='text' class='form-control' name='title' id='title' value='" . q($title) . "'>\n\t </div>\n </div>\n <div class='form-group'>\n <label for='titulary' class='col-sm-2 control-label'>{$langTeachers}:</label>\n <div class='col-sm-10'>\n\t\t<input type='text' class='form-control' name='titulary' id='titulary' value='{$titulary}'>\n\t </div>\n </div>\n <div class='form-group'>\n\t <label for='Faculty' class='col-sm-2 control-label'>{$langFaculty}:</label>\n <div class='col-sm-10'>"; $allow_only_defaults = get_config('restrict_teacher_owndep') && !$is_admin ? true : false; list($js, $html) = $tree->buildCourseNodePicker(array('defaults' => $course->getDepartmentIds($c->id), 'allow_only_defaults' => $allow_only_defaults)); $head_content .= $js; $tool_content .= $html; @($tool_content .= "</div></div>\n\t <div class='form-group'>\n\t\t<label for='course_keywords' class='col-sm-2 control-label'>{$langCourseKeywords}</label>\n\t\t<div class='col-sm-10'>\n <input type='text' class='form-control' name='course_keywords' id='course_keywords' value='{$course_keywords}'>\n </div>\n\t </div> \n\t <div class='form-group'>\n <label class='col-sm-2 control-label'>{$langCourseFormat}:</label>\n <div class='col-sm-10'>\n <div class='radio'>\n <label>\n <input type='radio' name='view_type' value='simple' id='simple'" . ($c->view_type == "simple" ? " checked" : "") . ">\n {$langCourseSimpleFormat}\n </label>\n </div>\n <div class='radio'>\n <label>\n <input type='radio' name='view_type' value='units' id='units'" . ($c->view_type == "units" ? " checked" : "") . ">\n {$langWithCourseUnits}\n </label>\n </div>\n <div class='radio'>\n <label>\n <input type='radio' name='view_type' value='weekly' id='weekly'" . ($c->view_type == "weekly" ? " checked" : "") . ">\n {$langCourseWeeklyFormat}\n </label>\n </div> \n </div> \n </div>\n <div class='form-group'>\n <div class='col-sm-10 col-sm-offset-2' id='weeklyDates'>\n {$langStartDate} \n <input class='dateInForm form-control' type='text' name='start_date' value='" . ($c->start_date != "0000-00-00" ? $c->start_date : "") . "' readonly> \n {$langEndDate}\n <input class='dateInForm form-control' type='text' name='finish_date' value='" . ($c->finish_date != "0000-00-00" ? $c->finish_date : "") . "' readonly>\n </div>\n </div>"); if ($isOpenCourseCertified) { $tool_content .= "<input type='hidden' name='course_license' value='{$course_license}'>"; } $language = $c->lang; $tool_content .= " \n <div class='form-group'>\n <label class='col-sm-2 control-label'>{$langOpenCoursesLicense}:</label>\n <div class='col-sm-10'>\n <div class='radio'>\n <label>\n <input type='radio' name='l_radio' value='0'{$license_checked['0']}{$disabledVisibility}>\n {$license[0]['title']}\n </label>\n </div>\n <div class='radio'>\n <label>\n <input type='radio' name='l_radio' value='10'{$license_checked['10']}{$disabledVisibility}>\n {$license[10]['title']}\n </label>\n </div>\n <div class='radio'>\n <label>\n <input id='cc_license' type='radio' name='l_radio' value='cc'{$cc_checked}{$disabledVisibility}>\n {$langCMeta['course_license']}\n </label>\n </div> \n </div> \n </div>\n <div class='form-group'>\n <div class='col-sm-10 col-sm-offset-2' id='cc'> \n " . selection($cc_license, 'cc_use', $course_license, 'class="form-control"' . $disabledVisibility) . "\n </div>\n </div>\n <div class='form-group'>\n <label class='col-sm-2 control-label'>{$langConfidentiality}:</label>\n <div class='col-sm-10'>\n <div class='radio'>\n <label>\n <input id='courseopen' type='radio' name='formvisible' value='2' {$visibleChecked['2']}>\n <img src='{$themeimg}/lock_open.png' alt='{$langOpenCourse}' title='{$langOpenCourse}' width='16'> {$langOpenCourse}\n <span class='help-block'><small>{$langPublic}</small></span>\n </label>\n </div>\n <div class='radio'>\n <label>\n <input id='coursewithregistration' type='radio' name='formvisible' value='1' {$visibleChecked['1']}>\n <img src='{$themeimg}/lock_registration.png' alt='{$m['legrestricted']}' title='{$m['legrestricted']}' width='16'> {$m['legrestricted']}\n <span class='help-block'><small>{$langPrivOpen}</small></span>\n </label>\n </div>\n <div class='radio'>\n <label>\n <input id='courseclose' type='radio' name='formvisible' value='0' {$visibleChecked['0']} {$disabledVisibility}>\n <img src='{$themeimg}/lock_closed.png' alt='{$langClosedCourse}' title='{$langClosedCourse}' width='16'> {$langClosedCourse}\n <span class='help-block'><small>{$langClosedCourseShort}</small></span>\n </label>\n </div>\n <div class='radio'>\n <label>\n <input id='courseinactive' type='radio' name='formvisible' value='3' {$visibleChecked['3']} {$disabledVisibility}>\n <img src='{$themeimg}/lock_inactive.png' alt='{$langInactiveCourse}' title='{$langInactiveCourse}' width='16'> {$langInactiveCourse}\n <span class='help-block'><small>{$langCourseInactiveShort}</small></span>\n </label>\n </div> \n </div> \n </div>\n <div class='form-group'>\n <label for='coursepassword' class='col-sm-2 control-label'>{$langOptPassword}:</label>\n <div class='col-sm-10'>\n <input class='form-control' id='coursepassword' type='text' name='password' value='" . @q($password) . "' class='FormData_InputText' autocomplete='off'>\n </div>\n </div> \n\t <div class='form-group'>\n <label for='Options' class='col-sm-2 control-label'>{$langLanguage}:</label>\n <div class='col-sm-10'>" . lang_select_options('localize', 'class="form-control"') . "</div>\t \n\t </div>\n <div class='form-group'>\n <label class='col-sm-2 control-label'>{$langSharing}:</label>\n <div class='col-sm-10'>\n <div class='radio'>\n <label>\n <input type='radio' value='1' name='s_radio' {$checkSharingEn} {$radio_dis}> {$langSharingEn}\n </label>\n </div>\n <div class='radio'>\n <label>\n <input type='radio' value='0' name='s_radio' {$checkSharingDis} {$radio_dis}> {$langSharingDis}\n <span class='help-block'><small>{$sharing_dis_label}</small></span> \n </label>\n </div> \n </div> \n </div>\n <div class='form-group'>\n <label class='col-sm-2 control-label'>{$langRating}:</label>\n <div class='col-sm-10'>\n <div class='radio'>\n <label>\n <input type='radio' value='1' name='r_radio' {$checkRatingEn}> {$langRatingEn}\n </label>\n </div>\n <div class='radio'>\n <label>\n <input type='radio' value='0' name='r_radio' {$checkRatingDis}> {$langRatingDis} \n </label>\n </div> \n </div>\n </div>\n <div class='form-group'>\n <label class='col-sm-2 control-label'>{$langAnonymousRating}:</label>\n <div class='col-sm-10'>\n <div class='radio'>\n <label>\n <input type='radio' value='1' name='ran_radio' {$checkEn} {$radio_dis}> {$langRatingAnonEn}\n </label>\n </div>\n <div class='radio'>\n <label>\n <input type='radio' value='0' name='ran_radio' {$checkDis} {$radio_dis}> {$langRatingAnonDis}\n <span class='help-block'><small>{$rating_dis_label}</small></span> \n </label>\n </div> \n </div> \n </div>\n <div class='form-group'>\n <label class='col-sm-2 control-label'>{$langCommenting}:</label>\n <div class='col-sm-10'>\n <div class='radio'>\n <label>\n <input type='radio' value='1' name='c_radio' {$checkEn}> {$langCommentsEn}\n </label>\n </div>\n <div class='radio'>\n <label>\n <input type='radio' value='0' name='c_radio' {$checkDis}> {$langCommentsDis} \n </label>\n </div> \n </div> \n </div>\n <div class='form-group'>\n <div class='col-sm-10 col-sm-offset-2'>\n <input class='btn btn-primary' type='submit' name='submit' value='{$langSubmit}'>\n </div>\n </div>\n </fieldset>\n </form>\n</div>"; } draw($tool_content, 2, null, $head_content);
} $tool_content .= "</table>"; } else { Database::get()->queryFunc("SELECT id, name FROM hierarchy WHERE allow_course = true ORDER BY name", function ($n) use(&$facs) { $facs[$n->id] = $n->name; }); $access_options = array(ACCESS_PRIVATE => $langProfileInfoPrivate, ACCESS_PROFS => $langProfileInfoProfs, ACCESS_USERS => $langProfileInfoUsers); $tool_content .= "<div class='alert alert-info'>{$langMultiRegUserInfo}</div>\n <div class='form-wrapper'>\n <form class='form-horizontal' role='form' method='post' action='{$_SERVER['SCRIPT_NAME']}' onsubmit='return validateNodePickerForm();' >\n <fieldset> \n <div class='form-group'>\n <label for='fields' class='col-sm-3 control-label'>{$langMultiRegFields}:</label>\n <div class='col-sm-9'>\n <input class='form-control' id='fields' type='text' name='fields' value='first last id email phone'>\n </div>\n </div>\n <div class='form-group'>\n <label for='user_info' class='col-sm-3 control-label'>{$langUsersData}:</label>\n <div class='col-sm-9'>\n <textarea class='auth_input form-control' name='user_info' id='user_info' rows='10'></textarea>\n </div>\n </div>\n <div class='form-group'>\n <label for='type' class='col-sm-3 control-label'>{$langMultiRegType}:</label>\n <div class='col-sm-9'>\n <select class='form-control' name='type' id='type'>\n <option value='stud'>{$langsOfStudents}</option>\n <option value='prof'>{$langOfTeachers}</option>\n </select>\n </div>\n </div>\n <div class='form-group'>\n <label for='prefix' class='col-sm-3 control-label'>{$langMultiRegPrefix}:</label>\n <div class='col-sm-9'>\n <input class='form-control' type='text' name='prefix' id='prefix' value='user'>\n </div>\n </div>\n <div class='form-group'>\n <label class='col-sm-3 control-label'>{$langFaculty}:</label>\n <div class='col-sm-9'>"; if (isDepartmentAdmin()) { list($js, $html) = $tree->buildUserNodePicker(array('params' => 'name="facid[]"', 'allowables' => $user->getDepartmentIds($uid))); } else { list($js, $html) = $tree->buildUserNodePicker(array('params' => 'name="facid[]"')); } $head_content .= $js; $tool_content .= $html; $tool_content .= "</div>\n </div>\n <div class='form-group'>\n <label for='am' class='col-sm-3 control-label'>{$langAm}:</label>\n <div class='col-sm-9'>\n <input class='form-control' type='text' name='am' id='am'>\n </div>\n </div>\n <div class='form-group'>\n <label for='lang' class='col-sm-3 control-label'>{$langLanguage}:</label>\n <div class='col-sm-9'>" . lang_select_options('lang', 'class="form-control"') . "</div>\n </div>\n <div class='form-group'>\n <label for='email_public' class='col-sm-3 control-label'>{$langEmail}</label>\n <div class='col-sm-9'>" . selection($access_options, 'email_public', ACCESS_PRIVATE, 'class="form-control"') . "</div>\n </div>\n <div class='form-group'>\n <label for='am_public' class='col-sm-3 control-label'>{$langAm}</label>\n <div class='col-sm-9'>" . selection($access_options, 'am_public', ACCESS_PRIVATE, 'class="form-control"') . "</div>\n </div>\n <div class='form-group'>\n <label for='phone_public' class='col-sm-3 control-label'>{$langPhone}</label>\n <div class='col-sm-9'>" . selection($access_options, 'phone_public', ACCESS_PRIVATE, 'class="form-control"') . "</div>\n </div>\n <div class='form-group'>\n <label for='send_mail' class='col-sm-3 control-label'>{$langInfoMail}</label>\n <div class='col-sm-9'>\n <div class='checkbox'>\n <label>\n <input name='send_mail' id='send_mail' type='checkbox'> {$langMultiRegSendMail}\n </label>\n </div> \n </div>\n </div>\n <div class='form-group'>\n <div class='col-sm-9 col-sm-offset-3'>\n <input class='btn btn-primary' type='submit' name='submit' value='{$langSubmit}'>\n <a class='btn btn-default' href='index.php'>{$langCancel}</a>\n </div>\n </div> \n </fieldset>\n </form>\n </div>"; } draw($tool_content, 3, null, $head_content); function create_user($status, $uname, $password, $surname, $givenname, $email, $departments, $am, $phone, $lang, $send_mail, $email_public, $phone_public, $am_public) { global $charset, $langAsProf, $langYourReg, $siteName, $langDestination, $langYouAreReg, $langSettings, $langPass, $langAddress, $langIs, $urlServer, $langProblem, $administratorName, $administratorSurname, $langManager, $langTel, $langEmail, $emailhelpdesk, $profsuccess, $usersuccess, $user; if ($status == 1) { $message = $profsuccess; $type_message = $langAsProf; } else { $message = $usersuccess; $type_message = ''; } if (Database::get()->querySingle('SELECT * FROM user WHERE username = ?s', $uname)) { $GLOBALS['error'] = "{$GLOBALS['langMultiRegUsernameError']} ({$uname})"; return false;
} $tool_content .= '</div>'; } $line = strtok("\n"); } } else { $tree = new hierarchy(); $course = new course(); $user = new user(); load_js('jstree'); $tool_content .= "<div class='alert alert-info'>{$langMultiCourseInfo}</div>\n <div class='form-wrapper'>\n <form role='form' class='form-horizontal' method='post' action='" . $_SERVER['SCRIPT_NAME'] . "' onsubmit=\"return validateNodePickerForm();\">\n <fieldset>\n <div class='form-group'>\n <label for='title' class='col-sm-3 control-label'>{$langMultiCourseTitles}:</label>\n <div class='col-sm-9'>" . text_area('courses', 20, 80, '') . "</div>\n </div>\n\t<div class='form-group'>\n <label for='title' class='col-sm-3 control-label'>{$langFaculty}:</label>\t \n <div class='col-sm-9'>"; list($js, $html) = $tree->buildCourseNodePicker(array('allowables' => $user->getDepartmentIds($uid))); $head_content .= $js; $tool_content .= $html; $tool_content .= "</div></div>"; $tool_content .= "<div class='form-group'><label class='col-sm-offset-4 col-sm-8'>{$langConfidentiality}</label></div>\n <div class='form-group'>\n <label for='password' class='col-sm-3 control-label'>{$langOptPassword}</label>\n <div class='col-sm-9'>\n <input id='coursepassword' class='form-control' type='text' name='password' id='password' autocomplete='off' />\n </div>\n </div>\n <div class='form-group'>\n <label for='Public' class='col-sm-3 control-label'>{$langOpenCourse}</label>\n <div class='col-sm-9 radio'><label><input id='courseopen' type='radio' name='formvisible' value='2' checked> {$langPublic}</label></div>\n </div>\n <div class='form-group'>\n <label for='PrivateOpen' class='col-sm-3 control-label'>{$langRegCourse}</label>\t\n <div class='col-sm-9 radio'><label><input id='coursewithregistration' type='radio' name='formvisible' value='1'> {$langPrivOpen}</label></div>\n </div>\n <div class='form-group'>\n <label for='PrivateClosed' class='col-sm-3 control-label'>{$langClosedCourse}</label>\n <div class='col-sm-9 radio'><label><input id='courseclose' type='radio' name='formvisible' value='0'> {$langClosedCourseShort}</label></div>\n </div>\n <div class='form-group'>\n <label for='Inactive' class='col-sm-3 control-label'>{$langInactiveCourse}</label>\n <div class='col-sm-9 radio'><label><input id='courseinactive' type='radio' name='formvisible' value='3'> {$langCourseInactiveShort}</label></div>\n </div>\n <div class='form-group'>\n <label for='language' class='col-sm-3 control-label'>{$langLanguage}:</label>\t \n <div class='col-sm-9'>" . lang_select_options('lang') . "</div>\n </div>\n <div class='form-group'>\n <div class='col-sm-10 col-sm-offset-2'>\n <input class='btn btn-primary' type='submit' name='submit' value='" . q($langSubmit) . "'>\n <a href='index.php' class='btn btn-default'>{$langCancel}</a> \n </div>\n </div>\n </fieldset>\n </form>\n </div>"; } draw($tool_content, 3, null, $head_content); /** * @brief helper function * @param type $sql * @param type $terms * @return boolean */ function prof_query($sql, $terms) { $result = Database::get()->querySingle("SELECT id FROM user WHERE status = 1 AND ( {$sql} )", $terms); if ($result) { return $result->id; } else { return false;
/** * @param string $code * @param string $title * @param string $prof * @param string $lang * @param string $type - can be null * @param int $vis * @param string $desc * @param mixed $faculty - can be null */ function course_details_form($code, $title, $prof, $lang, $type, $vis, $desc, $faculty) { global $langInfo1, $langInfo2, $langCourseCode, $langLanguage, $langTitle, $langCourseDescription, $langFaculty, $langCourseVis, $langTeacher, $langUsersWillAdd, $langOk, $langAll, $langsTeachers, $langMultiRegType, $langNone, $langOldValue, $treeObj, $langBack, $course_code; list($tree_js, $tree_html) = $treeObj->buildCourseNodePicker(); if ($type) { if (isset($GLOBALS['lang' . $type])) { $type_label = ' (' . $GLOBALS['lang' . $type] . ')'; } else { $type_label = ' (' . $type . ')'; } } else { $type_label = ''; } if (is_array($faculty)) { foreach ($faculty as $entry) { $old_faculty_names[] = q(Hierarchy::unserializeLangField($entry['name'])); } $old_faculty = implode('<br>', $old_faculty_names); } else { $old_faculty = q(Hierarchy::unserializeLangField($faculty) . $type_label); } $formAction = $_SERVER['SCRIPT_NAME']; if (isset($GLOBALS['course_code'])) { $formAction .= '?course=' . $GLOBALS['course_code']; } return action_bar(array( array('title' => $langBack, 'url' => "index.php?course=$course_code", 'icon' => 'fa-reply', 'level' => 'primary-label'))) . " <div class='alert alert-info'>$langInfo1 <br> $langInfo2</div> <div class='row'> <div class='col-md-12'> <div class='form-wrapper' > <form class='form-horizontal' role='form' action='$formAction' method='post' onsubmit='return validateNodePickerForm();' > <div class='form-group'> <label for='course_code' class='col-sm-3 control-label'>$langCourseCode:</label> <div class='col-sm-9'> <input type='text' class='form-control' id='course_code' name='course_code' value='" . q($code) . "'> </div> </div> <div class='form-group'> <label for='course_code' class='col-sm-3 control-label'>$langLanguage:</label> <div class='col-sm-9'> " . lang_select_options('course_lang') . " </div> </div> <div class='form-group'> <label for='course_title' class='col-sm-3 control-label'>$langTitle:</label> <div class='col-sm-9'> <input class='form-control' type='text' id='course_title' name='course_title' value='" . q($title) . "' /> </div> </div> <div class='form-group'> <label class='col-sm-3 control-label'>$langCourseDescription:</label> <div class='col-sm-9'> " . rich_text_editor('course_desc', 10, 40, purify($desc)) . " </div> </div> <div class='form-group'> <label class='col-sm-3 control-label'>$langFaculty:</label> <div class='col-sm-9'> " . $tree_html . "<br>$langOldValue: <i>$old_faculty</i> </div> </div> <div class='form-group'> <label class='col-sm-3 control-label'>$langCourseVis:</label> <div class='col-sm-9'> " . visibility_select($vis) . " </div> </div> <div class='form-group'> <label for='course_prof' class='col-sm-3 control-label'>$langTeacher:</label> <div class='col-sm-9'> <input class='form-control' type='text' id='course_prof' name='course_prof' value='" . q($prof) . "' size='50' /> </div> </div> <div class='form-group'> <label class='col-sm-3 control-label'>$langUsersWillAdd:</label> <div class='col-sm-9'> <input type='radio' name='add_users' value='all' id='add_users_all' checked='checked'> $langAll<br> <input type='radio' name='add_users' value='prof' id='add_users_prof'> $langsTeachers<br> <input type='radio' name='add_users' value='none' id='add_users_none'> $langNone </div> </div> <div class='form-group'> <label class='col-sm-3 control-label'>$langMultiRegType:</label> <div class='col-sm-9'> <input type='checkbox' name='create_users' value='1' id='create_users' checked='checked'> </div> </div> <div class='form-group'> <div class='col-sm-offset-3 col-sm-9'> <input class='btn btn-primary' type='submit' name='create_restored_course' value='$langOk' /> <input type='hidden' name='restoreThis' value='" . q($_POST['restoreThis']) . "' /> </div> </div> " . generate_csrf_token_form_field() . " </form> </div> </div> </div> "; }
} else { list($js, $html) = $tree->buildUserNodePicker(array('params' => 'name="facid[]"')); } $head_content .= $js; $tool_content .= $html; $tool_content .= "</div> </div> <div class='form-group'> <label for='am' class='col-sm-3 control-label'>$langAm:</label> <div class='col-sm-9'> <input class='form-control' type='text' name='am' id='am'> </div> </div> <div class='form-group'> <label for='lang' class='col-sm-3 control-label'>$langLanguage:</label> <div class='col-sm-9'>" . lang_select_options('lang', 'class="form-control"') . "</div> </div> <div class='form-group'> <label for='email_public' class='col-sm-3 control-label'>$langEmail</label> <div class='col-sm-9'>" . selection($access_options, 'email_public', ACCESS_PRIVATE, 'class="form-control"') . "</div> </div> <div class='form-group'> <label for='am_public' class='col-sm-3 control-label'>$langAm</label> <div class='col-sm-9'>" . selection($access_options, 'am_public', ACCESS_PRIVATE, 'class="form-control"') . "</div> </div> <div class='form-group'> <label for='phone_public' class='col-sm-3 control-label'>$langPhone</label> <div class='col-sm-9'>" . selection($access_options, 'phone_public', ACCESS_PRIVATE, 'class="form-control"') . "</div> </div> <div class='form-group'> <label for='send_mail' class='col-sm-3 control-label'>$langInfoMail</label>
/** * @brief display form * * @global type $tool_content * @global type $langName * @global type $langSurname * @global type $langEmail * @global type $langCompulsory * @global type $langOptional * @global type $langPhone * @global type $langComments * @global type $langFaculty * @global type $langRegistration * @global type $langLanguage * @global type $langAm * @global type $profreason * @global type $auth * @global type $prof * @global string $usercomment * @global int $depid * @global type $email_required * @global type $phone_required * @global type $comment_required * @global type $langEmailNotice * @global Hierarchy $tree * @global type $head_content */ function user_info_form() { global $tool_content, $langName, $langSurname, $langEmail, $langCompulsory, $langOptional, $langPhone, $langComments, $langFaculty, $langRegistration, $langLanguage, $langAm, $profreason, $auth, $prof, $usercomment, $depid, $email_required, $phone_required, $comment_required, $langEmailNotice, $tree, $head_content; if (!isset($usercomment)) { $usercomment = ''; } if (!isset($depid)) { $depid = 0; } if (!get_config("email_required")) { $mail_message = $langEmailNotice; } else { $mail_message = ''; } if (isset($_SESSION['auth_user_info']) and !empty($_SESSION['auth_user_info']['givenname'])) { $givennameClass = ' form-control-static'; $givennameInput = q($_SESSION['auth_user_info']['givenname']); } else { $givennameClass = ''; $givennameInput = '<input type="text" class="form-control" id="givenname_id" name="givenname_form" maxlength="100"' . set('givenname_form') . '> '; } if (isset($_SESSION['auth_user_info']) and !empty($_SESSION['auth_user_info']['surname'])) { $surnameClass = ' form-control-static'; $surnameInput = q($_SESSION['auth_user_info']['surname']); } else { $surnameClass = ''; $surnameInput = '<input type="text" class="form-control" id="surname_id" name="surname_form" maxlength="100"' . set('surname_form') . '> '; } if (isset($_SESSION['auth_user_info']) and !empty($_SESSION['auth_user_info']['studentid'])) { $amClass = ' form-control-static'; $amInput = q($_SESSION['auth_user_info']['studentid']); } else { $amMessage = get_config('am_required')? $langCompulsory: $langOptional; $amClass = ''; $amInput = '<input type="text" class="form-control" id="am_id" name="am" maxlength="20"' . set('am') . ' placeholder="' . q($am_message) . '>'; } $tool_content .= "<div class='form-wrapper'> <form role='form' class='form-horizontal' action='$_SERVER[SCRIPT_NAME]' method='post'> <fieldset> <div class='form-group'> <label for='givenname_id' class='col-sm-2 control-label'>$langName:</label> <div class='col-sm-10$givennameClass'>$givennameInput</div> </div> <div class='form-group'> <label for='surname_id' class='col-sm-2 control-label'>$langSurname:</label> <div class='col-sm-10$surnameClass'>$surnameInput</div> </div> <div class='form-group'> <label for='email_id' class='col-sm-2 control-label'>$langEmail:</label> <div class='col-sm-10'> <input type='text' name='email' id='email_id' class='form-control' maxlength='100'" . set('email') . "'>" . ($email_required ? '' : "<span class='help-block'><small>$mail_message</small></span>") . " </div> </div>"; if (!$prof) { $tool_content .= "<div class='form-group'> <label for='am_id' class='col-sm-2 control-label'>$langAm:</label> <div class='col-sm-10$amClass'>$amInput </div> </div>"; } if ($prof) { $phone_message = $langCompulsory; } else { $phone_message = $langOptional; } $tool_content .= "<div class='form-group'> <label for='UserPhone' class='col-sm-2 control-label'>$langPhone:</label> <div class='col-sm-10'> <input type='text' name='userphone' size='20' maxlength='20'" . set('userphone') . "' placeholder = '$phone_message'> </div> </div>"; if ($comment_required) { $tool_content .= "<div class='form-group'> <label for='UserComment' class='col-sm-2 control-label'>$langComments:</label> <div class='col-sm-10'> <textarea name='usercomment' cols='32' rows='4'>" . q($usercomment) . "</textarea> (*) $profreason</div> </div>"; } $tool_content .= "<div class='form-group'> <label for='UserFac' class='col-sm-2 control-label'>$langFaculty:</label> <div class='col-sm-10'>"; list($js, $html) = $tree->buildNodePicker(array('params' => 'name="department"', 'defaults' => $depid, 'tree' => null, 'where' => 'AND node.allow_user = true', 'multiple' => false)); $head_content .= $js; $tool_content .= $html . "</div> </div> <div class='form-group'> <label for='UserLang' class='col-sm-2 control-label'>$langLanguage:</label> <div class='col-sm-10'>" . lang_select_options('localize', "class='form-control'") . "</div> </div> <div class='col-sm-offset-2 col-sm-10'> <input class='btn btn-primary' type='submit' name='submit' value='" . q($langRegistration) . "'> </div> <input type='hidden' name='p' value='$prof'>"; if (isset($_SESSION['shib_uname'])) { $tool_content .= "<input type='hidden' name='uname' value='" . q($_SESSION['shib_uname']) . "'>"; } else { $tool_content .= "<input type='hidden' name='uname' value='" . q($_SESSION['was_validated']['uname']) . "'>"; } $tool_content .= "<input type='hidden' name='auth' value='$auth'> </fieldset> </form> </div>"; }
$tool_content .= selection($verified_mail_data, "verified_mail_form", $pvm, "class='form-control'"); } else { $tool_content .= selection($verified_mail_data, "verified_mail_form", '', "class='form-control'"); } $tool_content .= "</div></div>"; $tool_content .= "<div class='form-group'> <label for='faculty' class='col-sm-2 control-label'>$langFaculty:</label> <div class='col-sm-10'>"; list($js, $html) = $tree->buildNodePicker(array('params' => 'name="department"', 'defaults' => $pt, 'tree' => null, 'where' => "AND node.allow_user = true", 'multiple' => false)); $head_content .= $js; $tool_content .= $html; $tool_content .= "</div></div>"; $tool_content .= "<div class='form-group'> <label for='lang' class='col-sm-2 control-label'>$langLanguage:</label> <div class='col-sm-10'>"; $tool_content .= lang_select_options('language', "class='form-control'", $lang); $tool_content .= "</div></div>"; $tool_content .= "<div class='form-group'> <label for='phone' class='col-sm-2 control-label'>$langPhone:</label> <div class='col-sm-10'> <input class='form-control' id='phone' type='text' name='phone' value='" . q($pphone) . "' placeholder='$langPhone'> </div> </div> <div class='form-group'> <label for='comments' class='col-sm-2 control-label'>$langComments</label> <div class='col-sm-10'>" . q($pcom) . "</div> </div> <div class='form-group'><label for='date' class='col-sm-2 control-label'>$langDate</label> <div class='col-sm-10'>" . q($pdate) . "</div></div> <div class='col-sm-offset-2 col-sm-10'> <input class='btn btn-primary' type='submit' name='submit' value='$langSubmit'>
getValue('phone_form', $pphone) . " placeholder='" . q($langPhone) . "'>"); formGroup('faculty', $langFaculty, $tree_html); if ($pstatus == 5) { // only for students if (get_config('am_required')) { $am_message = $langCompulsory; } else { $am_message = $langOptional; } formGroup('am_form', $langAm, "<input class='form-control' id='am_form' type='text' name='am_form'" . getValue('am_form', $pam) . " placeholder='" . q($am_message) . "'>"); } formGroup('language_form', $langLanguage, lang_select_options('language_form', "class='form-control'", Session::has('language_form')? Session::get('language_form'): $language)); if (isset($_GET['id'])) { formGroup('comments', $langComments, q($pcom)); formGroup('date', $langDate, q($pdate)); $tool_content .= "<input type='hidden' name='rid' value='$id'>"; } if (isset($pstatus)) { $tool_content .= "<input type='hidden' name='pstatus' value='$pstatus'>"; } //add custom profile fields input $tool_content .= render_profile_fields_form($cpf_context, true); $tool_content .= " <div class='col-sm-offset-2 col-sm-10'>
$res = Database::get()->querySingle("SELECT givenname, surname, username, email,\n faculty_id, comment, lang, date_open, phone, am, verified_mail \n FROM user_request WHERE id = ?d", $id); $ps = $res->surname; $pn = $res->givenname; $pu = $res->username; $pe = $res->email; $pt = $res->faculty_id; $pcom = $res->comment; $pam = $res->am; $pphone = $res->phone; $lang = $res->lang; $pvm = $res->verified_mail; $pdate = nice_format(date('Y-m-d', strtotime($res->date_open))); } @($tool_content .= "\n <form action='{$_SERVER['SCRIPT_NAME']}' method='post'>\n <fieldset>\n <legend>{$langNewProf}</legend>\n\t<table width='100%' class='tbl'>\n\t<tr>\n\t<th class='left' width='180'><b>" . $langSurname . "</b></th>\n\t<td>" . q($ps) . "<input type='hidden' name='ps' value='" . q($ps) . "'></td>\n\t</tr>\n\t<tr>\n\t<th class='left'><b>{$langName}</b></th>\n\t<td>" . q($pn) . "<input type='hidden' name='pn' value='" . q($pn) . "'></td>\n\t</tr>\n\t<tr>\n\t<th class='left'><b>{$langUsername}</b></th>\n\t<td>" . q($pu) . "<input type='hidden' name='pu' value='" . q($pu) . "'></td>\n\t</tr>\n\t<tr>\n\t<th class='left'><b>{$langEmail}</b></th>\n\t<td>" . q($pe) . "<input type='hidden' name='pe' value='" . q($pe) . "' ></td>\n\t</tr>\n\t<tr>\n\t<th class='left'><b>{$langEmailVerified}</b></th>\n\t<td>"); $verified_mail_data = array(); $verified_mail_data[0] = $m['pending']; $verified_mail_data[1] = $langYes; $verified_mail_data[2] = $langNo; $tool_content .= selection($verified_mail_data, "verified_mail", $pvm); $tool_content .= "</td>\n\t</tr>\n\t<tr>\n\t<th class='left'>{$langFaculty}</th>\n\t<td>"; list($js, $html) = $tree->buildNodePicker(array('params' => 'name="department"', 'defaults' => $pt, 'tree' => null, 'useKey' => "id", 'where' => "AND node.allow_user = true", 'multiple' => false)); $head_content .= $js; $tool_content .= $html; $tool_content .= "</td></tr>"; $tool_content .= "<tr><th class='left'>{$langLanguage}</th><td>"; $tool_content .= lang_select_options('language', '', $lang); $tool_content .= "</td></tr>"; $tool_content .= "<tr><th class='left'><b>{$langPhone}</b></th>\n\t<td>" . @q($pphone) . " </td></tr>\n\t<tr>\n\t<th class='left'><b>{$langComments}</b></th>\n\t<td>" . @q($pcom) . " </td>\n\t</tr>\n\t<tr>\n\t<th class='left'><b>{$langDate}</b></th>\n\t<td>" . @q($pdate) . " </td>\n\t</tr>\n\t<tr><th> </th>\n\t<td><input class='btn btn-primary' type='submit' name='submit' value='" . $langSubmit . "' >\n\t<input type='hidden' name='auth' value='{$auth}' >\n\t</td></tr>\n\t</table>\n\t<input type='hidden' name='rid' value='" . @$id . "'>\n </fieldset>\n </form>"; $tool_content .= "<p align='right'><a href='../admin/index.php'>{$langBack}</a></p>"; } draw($tool_content, 3, null, $head_content);
} else { $start_checkbox = ''; $startdate = date('d-m-Y H:i', strtotime('now')); } if (isset($enddate)) { $end_checkbox = 'checked'; } else { $end_checkbox = ''; $enddate = date('d-m-Y H:i', strtotime('now +1 month')); } $tool_content .= "<div class='col-sm-10'>" . lang_select_options('lang_admin_ann', "class='form-control'", $myrow->lang) . "</div>"; } else { $start_checkbox = $end_checkbox = ''; $startdate = date('d-m-Y H:i', strtotime('now')); $enddate = date('d-m-Y H:i', strtotime('now +1 month')); $tool_content .= "<div class='col-sm-10'>" . lang_select_options('lang_admin_ann', "class='form-control'") . "</div>"; } $tool_content .= "<small class='text-right'><span class='help-block'>$langTipLangAdminAnn</span></small></div> <div class='form-group'> <div class='col-sm-offset-2 col-sm-10'> <div class='checkbox'> <label><input type='checkbox' name='startdate_active' " . "$start_checkbox onClick=\"toggle(1,this,'startdate')\"> " . "$langActivate </label> </div> </div> </div> <div class='input-append date form-group' id='startdatecal' data-date='$langDate' data-date-format='dd-mm-yyyy'> <label for='startdate' class='col-sm-2 control-label'>$langStartDate :</label> <div class='col-xs-10 col-sm-9'>
<label class='col-sm-2 control-label'>$langVerifiedMail</label> <div class='col-sm-10 form-control-static'>$message</div> </div>"; } if (!get_config('restrict_owndep')) { $tool_content .= "<div class='form-group'><label for='faculty' class='col-sm-2 control-label'>$langFaculty:</label>"; $tool_content .= "<div class='col-sm-10 form-control-static'>"; list($js, $html) = $tree->buildUserNodePicker(array('defaults' => $userObj->getDepartmentIds($uid))); $head_content .= $js; $tool_content .= $html; $tool_content .= "</div></div>"; } $tool_content .= "<div class='form-group'><label for='language' class='col-sm-2 control-label'>$langLanguage:</label> <div class='col-sm-10'>" . lang_select_options('userLanguage', "class='form-control'") . "</div> </div>"; if ($icon) { $message_pic = $langReplacePicture; $picture = profile_image($uid, IMAGESIZE_SMALL) . " "; $delete = ' ' . icon('fa-times', $langDelete, '#', 'id="delete"') . ' '; } else { $picture = $delete = ''; $message_pic = $langAddPicture; } enableCheckFileSize(); $tool_content .= "<div class='form-group'> <label for='picture' class='col-sm-2 control-label'>$message_pic</label> <div class='col-sm-10'><span>$picture$delete</span>" . fileSizeHidenInput() . " <input type='file' name='userimage' size='30'></div>
<input class='form-control' type='text' name='phone' size='20' maxlength='20'" . ($user_data? (" value='" . q($user_data->phone) . "'"): '') . " placeholder='$langOptional'> </div> </div> <div class='form-group'> <label for='UserFac' class='col-sm-2 control-label'>$langFaculty:</label> <div class='col-sm-10'>"; list($js, $html) = $tree->buildUserNodePicker(); $head_content .= $js; $tool_content .= $html; $tool_content .= "</div> </div> <div class='form-group'> <label for='UserLang' class='col-sm-2 control-label'>$langLanguage:</label> <div class='col-sm-10'>"; $tool_content .= lang_select_options('localize', "class='form-control'"); $tool_content .= "</div> </div>"; if ($display_captcha) { $tool_content .= "<div class='form-group'> <div class='col-sm-offset-2 col-sm-10'><img id='captcha' src='{$urlAppend}include/securimage/securimage_show.php' alt='CAPTCHA Image' /></div><br> <label for='Captcha' class='col-sm-2 control-label'>$langCaptcha:</label> <div class='col-sm-10'><input type='text' name='captcha_code' maxlength='6'/></div> </div>"; } //add custom profile fields $tool_content .= render_profile_fields_form(array('origin' => 'student_register')); //check if provider_id from an authenticated user and a valid provider name are set so as to show the relevant form if(!empty($provider_name) && !empty($provider_id)) { $tool_content .= "<div class='form-group'>
if (!$deps_valid) { $tool_content .= "<div class='alert alert-danger'>{$langCreateCourseNotAllowedNode}</div>\n <p class='pull-right'><a class='btn btn-default' href='{$_SERVER['PHP_SELF']}'>{$langBack}</a></p>"; draw($tool_content, 1, null, $head_content); exit; } // display form if (!isset($_POST['create_course'])) { $allow_only_defaults = get_config('restrict_teacher_owndep') && !$is_admin ? true : false; list($js, $html) = $tree->buildCourseNodePicker(array('defaults' => $user->getDepartmentIds($uid), 'allow_only_defaults' => $allow_only_defaults)); $head_content .= $js; foreach ($license as $id => $l_info) { if ($id and $id < 10) { $cc_license[$id] = $l_info['title']; } } $tool_content .= "\n<div class='form-wrapper'>\n <form class='form-horizontal' role='form' method='post' name='createform' action='{$_SERVER['SCRIPT_NAME']}' onsubmit=\"return validateNodePickerForm() && checkrequired(this, 'title', 'prof_names');\">\n <fieldset>\n <div class='form-group'>\n <label for='title' class='col-sm-2 control-label'>{$langTitle}:</label>\n <div class='col-sm-10'>\n <input name='title' id='title' type='text' class='form-control' id='exerciseTitle' value='" . q($title) . "' placeholder='{$langTitle}'>\n </div>\n </div>\n <div class='form-group'>\n <label for='dialog-set-value' class='col-sm-2 control-label'>{$langFaculty}:</label>\n <div class='col-sm-10'>\n {$html}\n </div>\n </div>\n <div class='form-group'>\n <label for='prof_names' class='col-sm-2 control-label'>{$langTeachers}:</label>\n <div class='col-sm-10'>\n <input class='form-control' type='text' name='prof_names' id='prof_names' value='" . q($prof_names) . "'>\n </div>\n </div>\n <div class='form-group'>\n <label for='localize' class='col-sm-2 control-label'>{$langLanguage}:</label>\n <div class='col-sm-10'>\n " . lang_select_options('localize', "class='form-control'") . "\n </div>\n </div>\n <div class='form-group'>\n <label for='description' class='col-sm-2 control-label'>{$langDescrInfo} <small>{$langOptional}</small>:</label>\n <div class='col-sm-10'>\n " . rich_text_editor('description', 4, 20, @$description) . "\n </div>\n </div>\n <div class='form-group'>\n <label class='col-sm-2 control-label'>{$langCourseFormat}:</label>\n <div class='col-sm-10'>\n <div class='radio'>\n <label>\n <input type='radio' name='view_type' value='simple' id='simple'>\n {$langCourseSimpleFormat}\n </label>\n </div>\n <div class='radio'>\n <label>\n <input type='radio' name='view_type' value='units' id='units' checked>\n {$langWithCourseUnits}\n </label>\n </div>\n <div class='radio'>\n <label>\n <input type='radio' name='view_type' value='weekly' id='weekly'>\n {$langCourseWeeklyFormat}\n </label>\n </div> \n </div>\n </div>\n <div class='form-group' id='weeklyDates'>\n <div class='col-sm-10 col-sm-offset-2'>\n {$langStartDate} <input class='dateInForm form-control' type='text' name='start_date' value='' readonly>\n </div>\n <div class='col-sm-10 col-sm-offset-2'>\n {$langDuration} <input class='dateInForm form-control' type='text' name='finish_date' value='' readonly>\n </div> \n </div>\n <div class='form-group'>\n <label class='col-sm-2 control-label'>{$langOpenCoursesLicense}:</label>\n <div class='col-sm-10'>\n <div class='radio'>\n <label>\n <input type='radio' name='l_radio' value='0' checked>\n {$license[0]['title']}\n </label>\n </div>\n <div class='radio'>\n <label>\n <input type='radio' name='l_radio' value='10'>\n {$license[10]['title']}\n </label>\n </div>\n <div class='radio'>\n <label>\n <input id='cc_license' type='radio' name='l_radio' value='cc'>\n {$langCMeta['course_license']}\n </label>\n </div> \n </div>\n </div>\n <div class='form-group' id='cc'>\n <div class='col-sm-10 col-sm-offset-2'>\n " . selection($cc_license, 'cc_use', "", 'class="form-control"') . "\n </div> \n </div>\n <div class='form-group'>\n <label for='localize' class='col-sm-2 control-label'>{$langAvailableTypes}:</label>\n <div class='col-sm-10'>\n <div class='radio'>\n <label>\n <input id='courseopen' type='radio' name='formvisible' value='2' checked>\n <img src='{$themeimg}/lock_open.png' alt='{$langOpenCourse}' title='{$langOpenCourse}' width='16'> {$langOpenCourse}\n <span class='help-block'><small>{$langPublic}</small></span>\n </label>\n </div>\n <div class='radio'>\n <label>\n <input id='coursewithregistration' type='radio' name='formvisible' value='1'>\n <img src='{$themeimg}/lock_registration.png' alt='{$m['legrestricted']}' title='{$m['legrestricted']}' width='16'> {$m['legrestricted']}\n <span class='help-block'><small>{$langPrivOpen}</small></span>\n </label>\n </div>\n <div class='radio'>\n <label>\n <input id='courseclose' type='radio' name='formvisible' value='0'>\n <img src='{$themeimg}/lock_closed.png' alt='{$langClosedCourse}' title='{$langClosedCourse}' width='16'> {$langClosedCourse}\n <span class='help-block'><small>{$langClosedCourseShort}</small></span>\n </label>\n </div>\n <div class='radio'>\n <label>\n <input id='courseinactive' type='radio' name='formvisible' value='3'>\n <img src='{$themeimg}/lock_inactive.png' alt='{$langInactiveCourse}' title='{$langInactiveCourse}' width='16'> {$langInactiveCourse}\n <span class='help-block'><small>{$langCourseInactiveShort}</small></span>\n </label>\n </div> \n </div>\n <div class='form-group'>\n <label for='coursepassword' class='col-sm-2 control-label'>{$langOptPassword}:</label>\n <div class='col-sm-10'>\n <input class='form-control' id='coursepassword' type='text' name='password' value='" . @q($password) . "' class='FormData_InputText' autocomplete='off'>\n </div>\n </div>\n <div class='form-group'>\n <div class='col-sm-10 col-sm-offset-2'>\n <input class='btn btn-primary' type='submit' name='create_course' value='" . q($langCourseCreate) . "'>\n <a href='{$urlServer}main/portfolio.php' class='btn btn-default'>{$langCancel}</a>\n </div>\n </div> \n </div>\n <div class='text-right'><small>{$langFieldsOptionalNote}</small></div>\n </fieldset>\n </form>\n</div>"; } else { // create the course and the course database // validation in case it skipped JS validation $validationFailed = false; if (count($departments) < 1 || empty($departments[0])) { Session::Messages($langEmptyAddNode); $validationFailed = true; } if (empty($title) || empty($prof_names)) { Session::Messages($langFieldsMissing); $validationFailed = true; } if ($validationFailed) { header("Location:" . $urlServer . "modules/create_course/create_course.php"); exit;
<div class='form-group'> <label class='col-sm-2 control-label'>$langFaculty:</label> <div class='col-sm-10'> $html </div> </div> <div class='form-group'> <label for='prof_names' class='col-sm-2 control-label'>$langTeachers:</label> <div class='col-sm-10'> <input class='form-control' type='text' name='prof_names' id='prof_names' value='" . q($prof_names) . "'> </div> </div> <div class='form-group'> <label for='localize' class='col-sm-2 control-label'>$langLanguage:</label> <div class='col-sm-10'> " . lang_select_options('localize', "class='form-control'") . " </div> </div> <div class='form-group'> <label for='description' class='col-sm-2 control-label'>$langDescrInfo <small>$langOptional</small>:</label> <div class='col-sm-10'> ". rich_text_editor('description', 4, 20, @$description)." </div> </div> <div class='form-group'> <label class='col-sm-2 control-label'>$langCourseFormat:</label> <div class='col-sm-10'> <div class='radio'> <label> <input type='radio' name='view_type' value='simple' id='simple'> $langCourseSimpleFormat
</div> <div class='form-group'> <label for='PrivateOpen' class='col-sm-3 control-label'>$langRegCourse</label> <div class='col-sm-9 radio'><label><input id='coursewithregistration' type='radio' name='formvisible' value='1'> $langPrivOpen</label></div> </div> <div class='form-group'> <label for='PrivateClosed' class='col-sm-3 control-label'>$langClosedCourse</label> <div class='col-sm-9 radio'><label><input id='courseclose' type='radio' name='formvisible' value='0'> $langClosedCourseShort</label></div> </div> <div class='form-group'> <label for='Inactive' class='col-sm-3 control-label'>$langInactiveCourse</label> <div class='col-sm-9 radio'><label><input id='courseinactive' type='radio' name='formvisible' value='3'> $langCourseInactiveShort</label></div> </div> <div class='form-group'> <label for='language' class='col-sm-3 control-label'>$langLanguage:</label> <div class='col-sm-9'>" . lang_select_options('lang') . "</div> </div> <div class='form-group'> <div class='col-sm-10 col-sm-offset-2'> <input class='btn btn-primary' type='submit' name='submit' value='" . q($langSubmit) . "'> <a href='index.php' class='btn btn-default'>$langCancel</a> </div> </div> </fieldset> </form> </div>"; } draw($tool_content, 3, null, $head_content); /**