/** * The course code (id) to which the object belongs. * * @return string */ function course_code() { return Chamilo::session()->course()->code(); }
/** * * @return ChamiloSession */ function session() { return Chamilo::session(); }
$charset_initial_value = $charset; // Initialization of the internationalization library. api_initialize_internationalization(); // Initialization of the default encoding that will be used by the multibyte string routines in the internationalization library. api_set_internationalization_default_encoding($charset); // Initialization of the database encoding to be used. Database::query("SET SESSION character_set_server='utf8';"); Database::query("SET SESSION collation_server='utf8_general_ci';"); if (api_is_utf8($charset)) { // See Bug #1802: For UTF-8 systems we prefer to use "SET NAMES 'utf8'" statement in order to avoid a bizarre problem with Chinese language. Database::query("SET NAMES 'utf8';"); } else { Database::query("SET CHARACTER SET '" . Database::to_db_encoding($charset) . "';"); } // Start session after the internationalization library has been initialized. Chamilo::session()->start($already_installed); // Remove quotes added by PHP - get_magic_quotes_gpc() is deprecated in PHP 5 see #2970 if (function_exists('get_magic_quotes_gpc') && get_magic_quotes_gpc()) { array_walk_recursive_limited($_GET, 'stripslashes', true); array_walk_recursive_limited($_POST, 'stripslashes', true); array_walk_recursive_limited($_COOKIE, 'stripslashes', true); array_walk_recursive_limited($_REQUEST, 'stripslashes', true); } // access_url == 1 is the default chamilo location if ($_configuration['access_url'] != 1) { $url_info = api_get_access_url($_configuration['access_url']); if ($url_info['active'] == 1) { $settings_by_access =& api_get_settings(null, 'list', $_configuration['access_url'], 1); foreach ($settings_by_access as &$row) { if (empty($row['variable'])) { $row['variable'] = 0;