Minor - format code.

1.9.x
Julio Montoya 12 years ago
parent 85490244f0
commit b6fab01f85
  1. 80
      main/auth/inscription.php
  2. 3
      main/exercice/exercise_history.php
  3. 4
      main/template/default/layout/layout_1_col.tpl

@ -10,7 +10,8 @@ use \ChamiloSession as Session;
$language_file = array('registration', 'admin');
if (!empty($_POST['language'])) { //quick hack to adapt the registration form result to the selected registration language
//quick hack to adapt the registration form result to the selected registration language
if (!empty($_POST['language'])) {
$_GET['language'] = $_POST['language'];
}
require_once '../inc/global.inc.php';
@ -25,7 +26,7 @@ $isNotAllowedHere = api_get_setting('allow_terms_conditions') === 'false' &&
api_get_setting('allow_registration') === 'false';
if ($isNotAllowedHere) {
api_not_allowed(true,get_lang('RegistrationDisabled'));
api_not_allowed(true, get_lang('RegistrationDisabled'));
}
if (!empty($_SESSION['user_language_choice'])) {
@ -44,7 +45,7 @@ if (api_get_setting('allow_terms_conditions') == 'true') {
$user_already_registered_show_terms = false;
}
//Direct Link Subscription feature #5299
// Direct Link Subscription feature #5299
$course_code_redirect = isset($_REQUEST['c']) && !empty($_REQUEST['c']) ? $_REQUEST['c'] : null;
$exercise_redirect = isset($_REQUEST['e']) && !empty($_REQUEST['e']) ? $_REQUEST['e'] : null;
@ -54,7 +55,6 @@ if (!empty($course_code_redirect)) {
}
if ($user_already_registered_show_terms == false) {
if (api_is_western_name_order()) {
// FIRST NAME and LAST NAME
$form->addElement('text', 'firstname', get_lang('FirstName'), array('size' => 40));
@ -145,20 +145,18 @@ if ($user_already_registered_show_terms == false) {
$allowCaptcha = isset($_configuration['allow_captcha']) ? $_configuration['allow_captcha'] : false;
if ($allowCaptcha) {
$ajax = api_get_path(WEB_AJAX_PATH).'form.ajax.php?a=get_captcha';
$options = array(
'width' => 220,
'height' => 90,
'callback' => $ajax.'&var='.basename(__FILE__, '.php'),
'sessionVar' => basename(__FILE__, '.php'),
'imageOptions' => array(
'font_size' => 20,
'font_path' => api_get_path(LIBRARY_PATH).'pchart/fonts/',
'font_file' => 'tahoma.ttf',
//'output' => 'gif'
)
'width' => 220,
'height' => 90,
'callback' => $ajax.'&var='.basename(__FILE__, '.php'),
'sessionVar' => basename(__FILE__, '.php'),
'imageOptions' => array(
'font_size' => 20,
'font_path' => api_get_path(LIBRARY_PATH).'pchart/fonts/',
'font_file' => 'tahoma.ttf',
//'output' => 'gif'
)
);
$captcha_question = $form->addElement('CAPTCHA_Image', 'captcha_question', '', $options);
@ -171,29 +169,45 @@ if ($user_already_registered_show_terms == false) {
}
// EXTENDED FIELDS
if (api_get_setting('extended_profile') == 'true' && api_get_setting('extendedprofile_registration', 'mycomptetences') == 'true') {
if (api_get_setting('extended_profile') == 'true' &&
api_get_setting('extendedprofile_registration', 'mycomptetences') == 'true'
) {
$form->add_html_editor('competences', get_lang('MyCompetences'), false, false, array('ToolbarSet' => 'register', 'Width' => '100%', 'Height' => '130'));
}
if (api_get_setting('extended_profile') == 'true' && api_get_setting('extendedprofile_registration', 'mydiplomas') == 'true') {
if (api_get_setting('extended_profile') == 'true' &&
api_get_setting('extendedprofile_registration', 'mydiplomas') == 'true'
) {
$form->add_html_editor('diplomas', get_lang('MyDiplomas'), false, false, array('ToolbarSet' => 'register', 'Width' => '100%', 'Height' => '130'));
}
if (api_get_setting('extended_profile') == 'true' && api_get_setting('extendedprofile_registration', 'myteach') == 'true') {
if (api_get_setting('extended_profile') == 'true' &&
api_get_setting('extendedprofile_registration', 'myteach') == 'true'
) {
$form->add_html_editor('teach', get_lang('MyTeach'), false, false, array('ToolbarSet' => 'register', 'Width' => '100%', 'Height' => '130'));
}
if (api_get_setting('extended_profile') == 'true' && api_get_setting('extendedprofile_registration', 'mypersonalopenarea') == 'true') {
if (api_get_setting('extended_profile') == 'true' &&
api_get_setting('extendedprofile_registration', 'mypersonalopenarea') == 'true'
) {
$form->add_html_editor('openarea', get_lang('MyPersonalOpenArea'), false, false, array('ToolbarSet' => 'register', 'Width' => '100%', 'Height' => '130'));
}
if (api_get_setting('extended_profile') == 'true') {
if (api_get_setting('extendedprofile_registration', 'mycomptetences') == 'true' && api_get_setting('extendedprofile_registrationrequired', 'mycomptetences') == 'true') {
if (api_get_setting('extendedprofile_registration', 'mycomptetences') == 'true' &&
api_get_setting('extendedprofile_registrationrequired', 'mycomptetences') == 'true'
) {
$form->addRule('competences', get_lang('ThisFieldIsRequired'), 'required');
}
if (api_get_setting('extendedprofile_registration', 'mydiplomas') == 'true' && api_get_setting('extendedprofile_registrationrequired', 'mydiplomas') == 'true') {
if (api_get_setting('extendedprofile_registration', 'mydiplomas') == 'true' &&
api_get_setting('extendedprofile_registrationrequired', 'mydiplomas') == 'true'
) {
$form->addRule('diplomas', get_lang('ThisFieldIsRequired'), 'required');
}
if (api_get_setting('extendedprofile_registration', 'myteach') == 'true' && api_get_setting('extendedprofile_registrationrequired', 'myteach') == 'true') {
if (api_get_setting('extendedprofile_registration', 'myteach') == 'true' &&
api_get_setting('extendedprofile_registrationrequired', 'myteach') == 'true'
) {
$form->addRule('teach', get_lang('ThisFieldIsRequired'), 'required');
}
if (api_get_setting('extendedprofile_registration', 'mypersonalopenarea') == 'true' && api_get_setting('extendedprofile_registrationrequired','mypersonalopenarea') == 'true') {
if (api_get_setting('extendedprofile_registration', 'mypersonalopenarea') == 'true' &&
api_get_setting('extendedprofile_registrationrequired', 'mypersonalopenarea') == 'true'
) {
$form->addRule('openarea', get_lang('ThisFieldIsRequired'), 'required');
}
}
@ -328,7 +342,12 @@ if (api_get_setting('allow_terms_conditions') == 'true') {
$form->addElement('hidden', 'legal_info', $term_preview['legal_id'].':'.$term_preview['language_id']);
if ($term_preview['type'] == 1) {
$form->addElement('checkbox', 'legal_accept', null, get_lang('IHaveReadAndAgree').'&nbsp;<a href="inscription.php?legal" target="_blank">'.get_lang('TermsAndConditions').'</a>');
$form->addElement(
'checkbox',
'legal_accept',
null,
get_lang('IHaveReadAndAgree').'&nbsp;<a href="inscription.php?legal" target="_blank">'.get_lang('TermsAndConditions').'</a>'
);
$form->addRule('legal_accept', get_lang('ThisFieldIsRequired'), 'required');
} else {
$preview = LegalManager::show_last_condition($term_preview);
@ -454,7 +473,9 @@ if ($form->validate()) {
// if there is a default duration of a valid account then we have to change the expiration_date accordingly
if (api_get_setting('account_valid_duration') != '') {
$sql = "UPDATE ".Database::get_main_table(TABLE_MAIN_USER)." SET expiration_date='registration_date+1' WHERE user_id='".$user_id."'";
$sql = "UPDATE ".Database::get_main_table(TABLE_MAIN_USER)."
SET expiration_date='registration_date+1'
WHERE user_id='".$user_id."'";
Database::query($sql);
}
@ -642,7 +663,7 @@ if ($form->validate()) {
);
$exercise_redirect = intval(Session::read('exercise_redirect'));
// Specifiy course ID as the current context does not
// Specifiy course ID as the current context does not
// hold a global $_course array
$objExercise = new Exercise($course_info['real_id']);
$result = $objExercise->read($exercise_redirect);
@ -682,7 +703,10 @@ if ($form->validate()) {
Session::erase('exercise_redirect');
if (CustomPages::enabled()) {
CustomPages::display(CustomPages::REGISTRATION_FEEDBACK, array('info' => $text_after_registration));
CustomPages::display(
CustomPages::REGISTRATION_FEEDBACK,
array('info' => $text_after_registration)
);
} else {
Display :: display_header($tool_name);
echo Display::page_header($tool_name);

@ -26,7 +26,6 @@ $show=(isset($_GET['show']) && $_GET['show'] == 'result')?'result':'test'; // mo
*/
require_once api_get_path(LIBRARY_PATH).'document.lib.php';
//include(api_get_path(LIBRARY_PATH).'mail.lib.inc.php');
/* Constants and variables */
$is_allowedToEdit = api_is_allowed_to_edit(null,true);
@ -65,7 +64,7 @@ echo '</div>';
<tr class="row_odd">
<th><?php echo get_lang('Question'); ?></th>
<th width="50px"><?php echo get_lang('Value'); ?></th>
<th><?php echo get_lang('Feedback'); ?></th>
<th><?php echo get_lang('Feedback'); ?></th>
<th><?php echo get_lang('Author'); ?></th>
<th width="160px"><?php echo get_lang('Date'); ?></th>
</tr>

@ -2,7 +2,6 @@
{# 1 column #}
{% block body %}
{# Plugin main top #}
{% if plugin_main_top %}
<div id="plugin_main_top" class="span12">
@ -19,7 +18,6 @@
<div class="span12">
{% include "default/layout/page_body.tpl" %}
{% block content %}
{% if content is not null %}
<section id="main_content">
@ -43,4 +41,4 @@
{{ plugin_main_bottom }}
</div>
{% endif %}
{% endblock %}
{% endblock %}

Loading…
Cancel
Save