Minor - format code.

1.10.x
Julio Montoya 11 years ago
parent 41952c22d2
commit 2de3ff03dd
  1. 11
      main/course_home/course_home.php
  2. 23
      main/inc/global.inc.php

@ -160,7 +160,7 @@ if ($isSpecialCourse) {
if (isset($_GET['autoreg'])) {
$autoRegistration = Security::remove_XSS($_GET['autoreg']);
if ($autoRegistration == 1) {
if (CourseManager::subscribe_user($user_id, $course_code, $status = STUDENT)) {
if (CourseManager::subscribe_user($user_id, $course_code, STUDENT)) {
Session::write('is_allowed_in_course', true);
}
}
@ -212,7 +212,9 @@ if (!empty($auto_launch)) {
$condition = '';
if (!empty($session_id)) {
$condition = api_get_session_condition($session_id);
$sql = "SELECT id FROM $lp_table WHERE c_id = $course_id AND autolunch = 1 $condition LIMIT 1";
$sql = "SELECT id FROM $lp_table
WHERE c_id = $course_id AND autolunch = 1 $condition
LIMIT 1";
$result = Database::query($sql);
//If we found nothing in the session we just called the session_id = 0 autolunch
if (Database::num_rows($result) == 0) {
@ -222,7 +224,9 @@ if (!empty($auto_launch)) {
}
}
$sql = "SELECT id FROM $lp_table WHERE c_id = $course_id AND autolunch = 1 $condition LIMIT 1";
$sql = "SELECT id FROM $lp_table
WHERE c_id = $course_id AND autolunch = 1 $condition
LIMIT 1";
$result = Database::query($sql);
if (Database::num_rows($result) > 0) {
$lp_data = Database::fetch_array($result,'ASSOC');
@ -269,6 +273,7 @@ if ($show_autolunch_lp_warning) {
'warning'
);
}
if (api_get_setting('homepage_view') == 'activity' ||
api_get_setting('homepage_view') == 'activity_big'
) {

@ -16,7 +16,7 @@
* @todo isn't configuration.php renamed to configuration.inc.php yet?
* @todo use the $_configuration array for all the needed variables
* @todo remove the code that displays the button that links to the install page
* but use a redirect immediately. By doing so the $already_installed variable can be removed.
* but use a redirect immediately. By doing so the $alreadyInstalled variable can be removed.
* @todo make it possible to enable / disable the tracking through the Chamilo config page.
*
*/
@ -32,19 +32,18 @@ $kernel = new AppKernel();
// This path will be useful to include the other initialisation files.
$includePath = __DIR__;
// @todo Isn't this file renamed to configuration.inc.php yet?
// Include the main Chamilo platform configuration file.
$already_installed = false;
$alreadyInstalled = false;
if (file_exists($kernel->getConfigurationFile())) {
require_once $kernel->getConfigurationFile();
$already_installed = true;
$alreadyInstalled = true;
} else {
$_configuration = array();
}
//Redirects to the main/install/ page
if (!$already_installed) {
if (!$alreadyInstalled) {
$global_error_code = 2;
// The system has not been installed yet.
require $includePath.'/global_error_message.inc.php';
@ -187,7 +186,7 @@ $charset = 'UTF-8';
\Patchwork\Utf8\Bootup::initAll();
// Start session after the internationalization library has been initialized.
Chamilo::session()->start($already_installed);
Chamilo::session()->start($alreadyInstalled);
// Remove quotes added by PHP - get_magic_quotes_gpc() is deprecated in PHP 5 see #2970
@ -283,7 +282,7 @@ require $includePath.'/local.inc.php';
//Fixes bug in Chamilo 1.8.7.1 array was not set
$administrator['email'] = isset($administrator['email']) ? $administrator['email'] : 'admin@example.com';
$administrator['name'] = isset($administrator['name']) ? $administrator['name'] : 'Admin';
$administrator['name'] = isset($administrator['name']) ? $administrator['name'] : 'Admin';
// Including configuration files
$configurationFiles = array(
@ -303,6 +302,7 @@ foreach ($configurationFiles as $file) {
}
}
// Error reporting settings.
if (api_get_setting('server_type') == 'test') {
ini_set('display_errors', '1');
ini_set('log_errors', '1');
@ -339,7 +339,10 @@ $langpath = api_get_path(SYS_LANG_PATH);
/* This will only work if we are in the page to edit a sub_language */
if (isset($this_script) && $this_script == 'sub_language') {
// getting the arrays of files i.e notification, trad4all, etc
$language_files_to_load = SubLanguageManager:: get_lang_folder_files_list(api_get_path(SYS_LANG_PATH).'english', true);
$language_files_to_load = SubLanguageManager:: get_lang_folder_files_list(
api_get_path(SYS_LANG_PATH).'english',
true
);
//getting parent info
$parent_language = SubLanguageManager::get_all_information_of_language($_REQUEST['id']);
//getting sub language info
@ -517,7 +520,8 @@ if (!$x = strpos($_SERVER['PHP_SELF'], 'whoisonline.php')) {
// ===== end "who is logged in?" module section =====
//Update of the logout_date field in the table track_e_login (needed for the calculation of the total connection time)
//Update of the logout_date field in the table track_e_login
// (needed for the calculation of the total connection time)
if (!isset($_SESSION['login_as']) && isset($_user)) {
// if $_SESSION['login_as'] is set, then the user is an admin logged as the user
@ -561,6 +565,7 @@ if (!isset($_SESSION['login_as']) && isset($_user)) {
}
}
}
// Add language_measure_frequency to your main/inc/conf/configuration.php in
// order to generate language variables frequency measurements (you can then
// see them through main/cron/lang/langstats.php)

Loading…
Cancel
Save