Display::return_icon('new_template.png', get_lang('Add a template'), '', ICON_SIZE_MEDIUM).'</a>';
echo '</div>';
}
if ($action == 'add' || ($action == 'edit'&& is_numeric($_GET['id']))) {
if ('add' == $action || ('edit' == $action&& is_numeric($_GET['id']))) {
addEditTemplate();
// Add event to the system log.
@ -934,7 +932,7 @@ function handleTemplates()
$user_id
);
} else {
if ($action == 'delete' && is_numeric($_GET['id'])) {
if ('delete' == $action&& is_numeric($_GET['id'])) {
deleteTemplate($_GET['id']);
// Add event to the system log
@ -1108,7 +1106,7 @@ function addEditTemplate()
);
// Setting the form elements: the header.
if ($_GET['action'] == 'add') {
if ('add' == $_GET['action']) {
$title = get_lang('Add a template');
} else {
$title = get_lang('Template edition');
@ -1137,7 +1135,7 @@ function addEditTemplate()
$form->addElement('static', 'file_comment', '', get_lang('This image will represent the template in the templates list. It should be no larger than 100x70 pixels'));
// Getting all the information of the template when editing a template.
$intro = sprintf(get_lang('Define new terms for sub-language %s by searching some term, then save each translation by clicking the save button. You will then have to switch your own user language to see the new terms appear.'), strtolower($sub_language_name));
$msg .= Display::return_message(get_lang('The /main/lang directory, used on this portal to store the languages, is not writable. Please contact your platform administrator and report this message.'), 'error');
} else {
@ -267,7 +265,7 @@ if (isset($_POST['SubmitAddNewLanguage'])) {
$msg .= Display::return_message(get_lang('The /main/lang directory, used on this portal to store the languages, is not writable. Please contact your platform administrator and report this message.'), 'error');
}
} else {
if ($language_id_exist === false) {
if (false === $language_id_exist) {
$msg .= Display::return_message(get_lang('The parent language does not exist.'), 'error');
@ -104,7 +102,7 @@ if (isset($_POST['form_sent']) && $_POST['form_sent']) {
}
}
if ($errorDrh == 0) {
if (0 == $errorDrh) {
echo Display::return_message(get_lang('The selected users are subscribed to the selected course'), 'confirm');
} else {
echo Display::return_message(get_lang('Human resources managers should not be registered to courses. The corresponding users you selected have not been subscribed.'), 'error');
@ -137,9 +135,9 @@ if (is_array($extra_field_list)) {
$varname = 'field_'.$new_field['variable'];
$fieldtype = $new_field['type'];
if (UserManager::is_extra_field_available($new_field['variable'])) {
if (isset($_POST[$varname]) && $_POST[$varname] != '0') {
if (isset($_POST[$varname]) &&'0' != $_POST[$varname]) {
if (api_get_setting('login_is_email') == 'true') {
if ('true' == api_get_setting('login_is_email')) {
$form->addRule('email', sprintf(get_lang('The login needs to be maximum %s characters long'), (string) USERNAME_MAX_LENGTH), 'maxlength', USERNAME_MAX_LENGTH);
$form->addRule('email', get_lang('This login is already in use'), 'username_available');
$form->addRule('username', sprintf(get_lang('The login needs to be maximum %s characters long'), (string) USERNAME_MAX_LENGTH), 'maxlength', USERNAME_MAX_LENGTH);
if (api_get_setting('login_is_email') == 'true') {
if ('true' == api_get_setting('login_is_email')) {
$form->addRule('email', sprintf(get_lang('The login needs to be maximum %s characters long'), (string) USERNAME_MAX_LENGTH), 'maxlength', USERNAME_MAX_LENGTH);
$form->addRule('email', get_lang('This login is already in use'), 'username_available', $user_data['username']);
}
@ -167,7 +164,7 @@ if (strlen($user_data['picture_uri']) > 0) {
}
// Username
if (api_get_setting('login_is_email') != 'true') {
if ('true' != api_get_setting('login_is_email')) {
$form->addRule('username', sprintf(get_lang('The login needs to be maximum %s characters long'), (string) USERNAME_MAX_LENGTH), 'maxlength', USERNAME_MAX_LENGTH);
api_not_allowed(true, get_lang('Sorry, you are trying to access the registration page for this portal, but registration is currently disabled. Please contact the administrator (see contact information in the footer). If you already have an account on this site.'));
@ -59,7 +57,7 @@ if ($extraConditions && isset($extraConditions['conditions'])) {
if (api_get_setting('allow_terms_conditions') === 'true'&& $user_already_registered_show_terms) {
if ('true' === api_get_setting('allow_terms_conditions') && $user_already_registered_show_terms) {
$tool_name = get_lang('Terms and Conditions');
}
}
@ -476,18 +474,18 @@ if ($isNotAllowedHere) {
api_not_allowed(true, get_lang('Sorry, you are trying to access the registration page for this portal, but registration is currently disabled. Please contact the administrator (see contact information in the footer). If you already have an account on this site.'));
}
if (api_get_setting('allow_registration') === 'approval') {
if ('approval' === api_get_setting('allow_registration')) {
$content .= Display::return_message(get_lang('Your account has to be approved'));
}
$showTerms = false;
// Terms and conditions
if (api_get_setting('allow_terms_conditions') === 'true'&& $user_already_registered_show_terms) {
if ('true' === api_get_setting('allow_terms_conditions') && $user_already_registered_show_terms) {
if (!api_is_platform_admin()) {
if (api_get_setting('show_terms_if_profile_completed') === 'true') {
if ('true' === api_get_setting('show_terms_if_profile_completed')) {
$userInfo = api_get_user_info();
if ($userInfo && $userInfo['status'] != ANONYMOUS) {
if ((int) $userInfo['profile_completed'] !== 1) {
if ($userInfo &&ANONYMOUS != $userInfo['status']) {
if (1 !== (int) $userInfo['profile_completed']) {
api_not_allowed(true);
}
}
@ -517,7 +515,7 @@ if (api_get_setting('allow_terms_conditions') === 'true' && $user_already_regist
@ -347,8 +347,8 @@ if (!empty($user_course_categories)) {
</div>
<divstyle="float:left; margin-right:10px;">
<?php
if ($course['status'] != 1) {
if ($course['unsubscr'] == 1) {
if (1 != $course['status']) {
if (1 == $course['unsubscr']) {
?>
<formaction="<?phpechoapi_get_self();?>"method="post"onsubmit="javascript: if (!confirm('<?phpechoaddslashes(api_htmlentities(get_lang("Are you sure you want to unsubscribe?"),ENT_QUOTES,api_get_system_encoding()));?>')) return false">
@ -386,13 +386,13 @@ if (!empty($courses_without_category)) {
@ -430,8 +430,8 @@ if (!empty($courses_without_category)) {
</div>
<divstyle="float:left; margin-right:10px;">
<?php
if ($course['status'] != 1) {
if ($course['unsubscr'] == 1) {
if (1 != $course['status']) {
if (1 == $course['unsubscr']) {
?>
<!-- changed link to submit to avoid action by the search tool indexer -->
<formaction="<?phpechoapi_get_self();?>"method="post"onsubmit="javascript: if (!confirm('<?phpechoaddslashes(api_htmlentities(get_lang("Are you sure you want to unsubscribe?"),ENT_QUOTES,api_get_system_encoding()));?>')) return false;">