Fixing fatal error because of missing deprecated function "get_setting"

skala
Julio Montoya 13 years ago
parent 26c57292c1
commit c7063bd7c7
  1. 16
      main/admin/configure_inscription.php
  2. 54
      plugin/search_course/lib/search_course_widget.class.php

@ -13,7 +13,7 @@ require_once '../inc/global.inc.php';
api_protect_admin_script();
// Load terms & conditions from the current lang
if (get_setting('allow_terms_conditions') == 'true') {
if (api_get_setting('allow_terms_conditions') == 'true') {
$get = array_keys($_GET);
if (isset($get)) {
if ($get[0] == 'legal') {
@ -111,7 +111,7 @@ if (!empty($homep_new)) {
}
if (!empty($action)) {
if ($_POST['formSent']) {
if (isset($_POST['formSent']) && $_POST['formSent']) {
switch ($action) {
case 'edit_top':
// Filter
@ -167,12 +167,12 @@ echo Display::page_header($tool_name);
// The following security condition has been removed, because it makes no sense here. See Bug #1846.
//// Forbidden to self-register
//if (get_setting('allow_registration') == 'false') {
//if (api_get_setting('allow_registration') == 'false') {
// api_not_allowed();
//}
//api_display_tool_title($tool_name);
if (get_setting('allow_registration') == 'approval') {
if (api_get_setting('allow_registration') == 'approval') {
Display::display_normal_message(get_lang('YourAccountHasToBeApproved'));
}
//if openid was not found
@ -181,7 +181,7 @@ if (!empty($_GET['openid_msg']) && $_GET['openid_msg'] == 'idnotfound') {
}
$form = new FormValidator('registration');
if (get_setting('allow_terms_conditions') == 'true') {
if (api_get_setting('allow_terms_conditions') == 'true') {
$display_all_form = !isset($_SESSION['update_term_and_condition']['user_id']);
} else {
$display_all_form = true;
@ -237,12 +237,12 @@ if ($display_all_form) {
}
// LANGUAGE
if (get_setting('registration', 'language') == 'true') {
if (api_get_setting('registration', 'language') == 'true') {
$form->addElement('select_language', 'language', get_lang('Language'), '', array('disabled' => 'disabled'));
}
// STUDENT/TEACHER
if (get_setting('allow_registration_as_teacher') != 'false') {
if (api_get_setting('allow_registration_as_teacher') != 'false') {
$form->addElement('radio', 'status', get_lang('Status'), get_lang('RegStudent'), STUDENT, array('disabled' => 'disabled'));
$form->addElement('radio', 'status', null, get_lang('RegAdmin'), COURSEMANAGER, array('disabled' => 'disabled'));
}
@ -279,7 +279,7 @@ if ($display_all_form) {
}
// Terms and conditions
if (get_setting('allow_terms_conditions') == 'true') {
if (api_get_setting('allow_terms_conditions') == 'true') {
$language = api_get_interface_language();
$language = api_get_language_id($language);
$term_preview = LegalManager::get_last_condition($language);

@ -3,9 +3,9 @@
require_once dirname(__FILE__) . '/register_course_widget.class.php';
/**
* Search course widget.
* Search course widget.
* Display a search form and a list of courses that matches the search.
*
*
* @copyright (c) 2011 University of Geneva
* @license GNU General Public License - http://www.gnu.org/copyleft/gpl.html
* @author Laurent Opprecht
@ -18,10 +18,10 @@ class SearchCourseWidget
/**
* Returns $_POST data for $key is it exists or $default otherwise.
*
*
* @param string $key
* @param object $default
* @return string
* @return string
*/
public static function post($key, $default = '')
{
@ -30,10 +30,10 @@ class SearchCourseWidget
/**
* Returns $_GET data for $key is it exists or $default otherwise.
*
*
* @param string $key
* @param object $default
* @return string
* @return string
*/
public static function get($key, $default = '')
{
@ -91,7 +91,7 @@ class SearchCourseWidget
}
/**
*
*
*/
function accept()
{
@ -100,10 +100,10 @@ class SearchCourseWidget
/**
* Display the search course widget:
*
*
* Title
* Search form
*
*
* Search results
*/
function run()
@ -216,7 +216,7 @@ EOT;
/**
*
* @param array $courses
* @return bool
* @return bool
*/
function display_list($courses)
{
@ -227,8 +227,8 @@ EOT;
$user_courses = $this->retrieve_user_courses();
$display_coursecode = (get_setting('display_coursecode_in_courselist') == 'true');
$display_teacher = (get_setting('display_teacher_in_courselist') == 'true');
$display_coursecode = (api_get_setting('display_coursecode_in_courselist') == 'true');
$display_teacher = (api_get_setting('display_teacher_in_courselist') == 'true');
echo '<table cellpadding="4">';
foreach ($courses as $key => $course)
@ -262,13 +262,13 @@ EOT;
}
/**
* Displays the subscribe icon if subscribing is allowed and
* Displays the subscribe icon if subscribing is allowed and
* if the user is not yet subscribed to this course
*
*
* @global type $stok
* @param array $current_course
* @param array $user_courses
* @return bool
* @return bool
*/
function display_subscribe_icon($current_course, $user_courses)
{
@ -289,7 +289,7 @@ EOT;
return false;
}
//Subscribe form
//Subscribe form
$self = $_SERVER['PHP_SELF'];
echo <<<EOT
<form action="$self?action=subscribe" method="post">
@ -323,9 +323,9 @@ EOT;
/**
* Search courses that match the search term.
* Search is done on the code, title and tutor fields.
*
* @param string $search_term
* @return array
*
* @param string $search_term
* @return array
*/
function retrieve_courses($search_term)
{
@ -348,9 +348,9 @@ EOT;
}
$sql = <<<EOT
SELECT * FROM $course_table
WHERE ($course_fiter) AND (code LIKE '%$search_term%' OR visual_code LIKE '%$search_term%' OR title LIKE '%$search_term%' OR tutor_name LIKE '%$search_term%')
ORDER BY title, visual_code ASC
SELECT * FROM $course_table
WHERE ($course_fiter) AND (code LIKE '%$search_term%' OR visual_code LIKE '%$search_term%' OR title LIKE '%$search_term%' OR tutor_name LIKE '%$search_term%')
ORDER BY title, visual_code ASC
EOT;
$result = array();
@ -374,9 +374,9 @@ EOT;
/**
* Retrieves courses that the user is subscribed to
*
*
* @param int $user_id
* @return array
* @return array
*/
function retrieve_user_courses($user_id = null)
{
@ -418,15 +418,15 @@ EOT;
}
/*
* Utility functions - Utility functions - Utility functions
* Utility functions - Utility functions - Utility functions
*/
/**
* Removes from $courses all courses the user is subscribed to.
*
*
* @global array $_user
* @param array $courses
* @return array
* @return array
*/
function filter_out_user_courses($courses)
{

Loading…
Cancel
Save