diff --git a/main/auth/catalog_layout.php b/main/auth/catalog_layout.php index 4b564cb660..747bc73289 100644 --- a/main/auth/catalog_layout.php +++ b/main/auth/catalog_layout.php @@ -7,7 +7,7 @@ */ if (api_get_setting('course_catalog_published') !== 'true') { - // Acces rights: anonymous users can't do anything usefull here. + // Access rights: anonymous users can't do anything usefull here. api_block_anonymous_users(); } diff --git a/main/auth/courses.php b/main/auth/courses.php index 9220f27918..10807b4cfd 100755 --- a/main/auth/courses.php +++ b/main/auth/courses.php @@ -144,7 +144,14 @@ if (isset($_POST['create_course_category']) && // search courses if (isset($_REQUEST['search_course'])) { if ($ctok == $_REQUEST['sec_token']) { - $courses_controller->search_courses($_REQUEST['search_term'], null, null, null, $limit, true); + $courses_controller->search_courses( + $_REQUEST['search_term'], + null, + null, + null, + $limit, + true + ); } } @@ -163,7 +170,11 @@ if (isset($_REQUEST['subscribe_course'])) { if (isset($_GET['unsubscribe'])) { $search_term = isset($_GET['search_term']) ? $_GET['search_term'] : null; if ($ctok == $_GET['sec_token']) { - $courses_controller->unsubscribe_user_from_course($_GET['unsubscribe'], $search_term, $categoryCode); + $courses_controller->unsubscribe_user_from_course( + $_GET['unsubscribe'], + $search_term, + $categoryCode + ); } } diff --git a/main/auth/courses_categories.php b/main/auth/courses_categories.php index a220812dd1..42debc2306 100755 --- a/main/auth/courses_categories.php +++ b/main/auth/courses_categories.php @@ -159,14 +159,14 @@ if ($showCourses && $action != 'display_sessions') { continue; } - $userRegisterdInCourse = CourseManager::is_user_subscribed_in_course($user_id, $course['code']); - $userRegisterdInCourseAsTeacher = CourseManager::is_course_teacher($user_id, $course['code']); - $userRegisterd = ($userRegisterdInCourse && $userRegisterdInCourseAsTeacher); + $userRegisteredInCourse = CourseManager::is_user_subscribed_in_course($user_id, $course['code']); + $userRegisteredInCourseAsTeacher = CourseManager::is_course_teacher($user_id, $course['code']); + $userRegistered = $userRegisteredInCourse && $userRegisteredInCourseAsTeacher; - $course_public = ($course['visibility'] == COURSE_VISIBILITY_OPEN_WORLD); - $course_open = ($course['visibility'] == COURSE_VISIBILITY_OPEN_PLATFORM); - $course_private = ($course['visibility'] == COURSE_VISIBILITY_REGISTERED); - $course_closed = ($course['visibility'] == COURSE_VISIBILITY_CLOSED); + $course_public = $course['visibility'] == COURSE_VISIBILITY_OPEN_WORLD; + $course_open = $course['visibility'] == COURSE_VISIBILITY_OPEN_PLATFORM; + $course_private = $course['visibility'] == COURSE_VISIBILITY_REGISTERED; + $course_closed = $course['visibility'] == COURSE_VISIBILITY_CLOSED; $course_subscribe_allowed = ($course['subscribe'] == 1); $course_unsubscribe_allowed = ($course['unsubscribe'] == 1); @@ -183,7 +183,7 @@ if ($showCourses && $action != 'display_sessions') { } // display thumbnail - $html .= returnThumbnail($course, $userRegisterd); + $html .= returnThumbnail($course, $userRegistered); $separator = '
|
@@ -209,56 +217,54 @@ if (!empty($courses_without_category)) {
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
0) { ?>
-
-
-
+
+
+
-
-
-
+ echo Display::display_icon('up_na.png', get_lang('Up'), '', 22);
+ }
+ if ($key < $number_of_courses - 1) { ?>
+
+
+
-
-
-
-
+ ?>
+
+
+
diff --git a/main/auth/gotocourse.php b/main/auth/gotocourse.php
index 37476a2260..b6bace05a5 100755
--- a/main/auth/gotocourse.php
+++ b/main/auth/gotocourse.php
@@ -50,7 +50,7 @@ if (isset($_GET['firstpage'])) {
}
$msg .= '';
- $msg .= $form->return_form();
+ $msg .= $form->returnForm();
$msg .= ' ';
if (api_is_cas_activated()) {
$msg .= "";
diff --git a/main/auth/inscription.php b/main/auth/inscription.php
index 253a821be0..726fb46ab6 100755
--- a/main/auth/inscription.php
+++ b/main/auth/inscription.php
@@ -109,7 +109,15 @@ if ($user_already_registered_show_terms === false) {
if (api_get_setting('registration', 'email') != 'true') {
$form->addRule('email', get_lang('ThisFieldIsRequired'), 'required');
}
- $form->addRule('email', sprintf(get_lang('UsernameMaxXCharacters'), (string) USERNAME_MAX_LENGTH), 'maxlength', USERNAME_MAX_LENGTH);
+ $form->addRule(
+ 'email',
+ sprintf(
+ get_lang('UsernameMaxXCharacters'),
+ (string)USERNAME_MAX_LENGTH
+ ),
+ 'maxlength',
+ USERNAME_MAX_LENGTH
+ );
$form->addRule('email', get_lang('UserTaken'), 'username_available');
}
@@ -151,7 +159,15 @@ if ($user_already_registered_show_terms === false) {
);
$form->applyFilter('username', 'trim');
$form->addRule('username', get_lang('ThisFieldIsRequired'), 'required');
- $form->addRule('username', sprintf(get_lang('UsernameMaxXCharacters'), (string) USERNAME_MAX_LENGTH), 'maxlength', USERNAME_MAX_LENGTH);
+ $form->addRule(
+ 'username',
+ sprintf(
+ get_lang('UsernameMaxXCharacters'),
+ (string)USERNAME_MAX_LENGTH
+ ),
+ 'maxlength',
+ USERNAME_MAX_LENGTH
+ );
$form->addRule('username', get_lang('UsernameWrong'), 'username');
$form->addRule('username', get_lang('UserTaken'), 'username_available');
}
@@ -253,10 +269,25 @@ if ($user_already_registered_show_terms === false) {
);
$form->addElement('static', null, null, get_lang('ClickOnTheImageForANewOne'));
- $form->addElement('text', 'captcha', get_lang('EnterTheLettersYouSee'), array('size' => 40));
- $form->addRule('captcha', get_lang('EnterTheCharactersYouReadInTheImage'), 'required', null, 'client');
-
- $form->addRule('captcha', get_lang('TheTextYouEnteredDoesNotMatchThePicture'), 'CAPTCHA', $captcha_question);
+ $form->addElement(
+ 'text',
+ 'captcha',
+ get_lang('EnterTheLettersYouSee'),
+ array('size' => 40)
+ );
+ $form->addRule(
+ 'captcha',
+ get_lang('EnterTheCharactersYouReadInTheImage'),
+ 'required',
+ null,
+ 'client'
+ );
+ $form->addRule(
+ 'captcha',
+ get_lang('TheTextYouEnteredDoesNotMatchThePicture'),
+ 'CAPTCHA',
+ $captcha_question
+ );
}
// EXTENDED FIELDS
@@ -570,7 +601,7 @@ if ($form->validate()) {
$form
);
- //update the extra fields
+ // Update the extra fields
$count_extra_field = count($extras);
if ($count_extra_field > 0 && is_integer($user_id)) {
foreach ($extras as $key => $value) {
diff --git a/main/auth/lostPassword.php b/main/auth/lostPassword.php
index 66007525a4..bdc566ab2c 100755
--- a/main/auth/lostPassword.php
+++ b/main/auth/lostPassword.php
@@ -1,5 +1,6 @@
addHeader($tool_name);
-$form->addText('user', [get_lang('LoginOrEmailAddress'), get_lang('EnterEmailUserAndWellSendYouPassword')], true);
+$form->addText('user',
+ [
+ get_lang('LoginOrEmailAddress'),
+ get_lang('EnterEmailUserAndWellSendYouPassword'),
+ ],
+ true
+);
$form->addButtonSend(get_lang('Send'));
if ($form->validate()) {
diff --git a/main/auth/profile.php b/main/auth/profile.php
index bfd3460bad..f7aa5e3c8c 100755
--- a/main/auth/profile.php
+++ b/main/auth/profile.php
@@ -230,7 +230,7 @@ if (api_get_setting('profile', 'language') !== 'true') {
$form->freeze('language');
}
-//THEME
+// THEME
if (is_profile_editable() && api_get_setting('user_selected_theme') == 'true') {
$form->addElement('SelectTheme', 'theme', get_lang('Theme'));
if (api_get_setting('profile', 'theme') !== 'true') {
diff --git a/main/auth/reset.php b/main/auth/reset.php
index e2bf9811ba..2556614b28 100644
--- a/main/auth/reset.php
+++ b/main/auth/reset.php
@@ -15,7 +15,12 @@ $form = new FormValidator('reset', 'POST', api_get_self().'?token='.$token);
$form->addElement('header', get_lang('ResetPassword'));
$form->addHidden('token', $token);
$form->addElement('password', 'pass1', get_lang('Password'));
-$form->addElement('password', 'pass2', get_lang('Confirmation'), array('id' => 'pass2', 'size' => 20, 'autocomplete' => 'off'));
+$form->addElement(
+ 'password',
+ 'pass2',
+ get_lang('Confirmation'),
+ array('id' => 'pass2', 'size' => 20, 'autocomplete' => 'off')
+);
$form->addRule('pass1', get_lang('ThisFieldIsRequired'), 'required');
$form->addRule('pass2', get_lang('ThisFieldIsRequired'), 'required');
$form->addRule(array('pass1', 'pass2'), get_lang('PassTwo'), 'compare');
diff --git a/main/auth/set_temp_password.php b/main/auth/set_temp_password.php
index 22a23261f5..395f5964ad 100755
--- a/main/auth/set_temp_password.php
+++ b/main/auth/set_temp_password.php
@@ -28,7 +28,11 @@ $course_info = api_get_course_info_by_id($course_id);
$tpl = new Template(null);
// Build the form
-$form = new FormValidator('set_temp_password', 'POST', api_get_self().'?course_id='.$course_id.'&session_id='.$session_id);
+$form = new FormValidator(
+ 'set_temp_password',
+ 'POST',
+ api_get_self().'?course_id='.$course_id.'&session_id='.$session_id
+);
$form->addElement('header', get_lang('CourseRequiresPassword'));
$form->addElement('hidden', 'course_id', $course_id);
$form->addElement('hidden', 'session_id', $session_id);
diff --git a/main/auth/unsubscribe_account.php b/main/auth/unsubscribe_account.php
index 0e19d9a353..fc950a6193 100755
--- a/main/auth/unsubscribe_account.php
+++ b/main/auth/unsubscribe_account.php
@@ -12,14 +12,28 @@ $tool_name = get_lang('Unsubscribe');
$message = Display::return_message(get_lang('UnsubscribeFromPlatform'), 'warning');
$form = new FormValidator('user_add');
-$form->addElement('button', 'submit', get_lang('Unsubscribe'), array('onclick' => "javascript:if(!confirm('".addslashes(api_htmlentities(get_lang("UnsubscribeFromPlatformConfirm")))."')) return false;"));
-$content = $form->return_form();
+$form->addElement(
+ 'button',
+ 'submit',
+ get_lang('Unsubscribe'),
+ array(
+ 'onclick' => "javascript:if(!confirm('".addslashes(api_htmlentities(get_lang("UnsubscribeFromPlatformConfirm")))."')) return false;",
+ )
+);
+$content = $form->returnForm();
if ($form->validate()) {
$user_info = api_get_user_info();
$result = UserManager::delete_user($user_info['user_id']);
if ($result) {
- $message = Display::return_message(sprintf(get_lang('UnsubscribeFromPlatformSuccess', $user_info['username'])));
+ $message = Display::return_message(
+ sprintf(
+ get_lang(
+ 'UnsubscribeFromPlatformSuccess',
+ $user_info['username']
+ )
+ )
+ );
$content = null;
online_logout($user_info['user_id'], false);
api_not_allowed(true, $message);
|